@@ -32,7 +32,7 @@ const RETRIEVAL_TOOL: Tool = {
32
32
description : 'The number of documents to retrieve.' ,
33
33
} ,
34
34
} ,
35
- required : [ 'pipelineId' , 'question' , 'k' ] ,
35
+ required : process . env . VECTORIZE_PIPELINE_ID ? [ 'question' , 'k' ] : [ 'pipelineId' , 'question' , 'k' ] ,
36
36
} ,
37
37
} ;
38
38
@@ -56,7 +56,7 @@ const DEEP_RESEARCH_TOOL: Tool = {
56
56
description : 'Whether to perform a web search.' ,
57
57
} ,
58
58
} ,
59
- required : [ 'pipelineId' , 'query' , 'webSearch' ] ,
59
+ required : process . env . VECTORIZE_PIPELINE_ID ? [ 'query' , 'webSearch' ] : [ 'pipelineId' , 'query' , 'webSearch' ] ,
60
60
} ,
61
61
} ;
62
62
@@ -97,6 +97,7 @@ const server = new Server(
97
97
// Get optional API URL
98
98
const VECTORIZE_ORG_ID = process . env . VECTORIZE_ORG_ID ;
99
99
const VECTORIZE_TOKEN = process . env . VECTORIZE_TOKEN ;
100
+ const VECTORIZE_PIPELINE_ID = process . env . VECTORIZE_PIPELINE_ID ;
100
101
// Check if API key is required (only for cloud service)
101
102
if ( ! VECTORIZE_ORG_ID || ! VECTORIZE_TOKEN ) {
102
103
console . error (
@@ -250,7 +251,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
250
251
case 'retrieve' : {
251
252
return await performRetrieval (
252
253
VECTORIZE_ORG_ID ,
253
- args . pipelineId + '' ,
254
+ args . pipelineId ? ( args . pipelineId + '' ) : ( VECTORIZE_PIPELINE_ID || '' ) ,
254
255
args . question + '' ,
255
256
Number ( args . k )
256
257
) ;
@@ -265,7 +266,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
265
266
case 'deep-research' : {
266
267
return await performDeepResearch (
267
268
VECTORIZE_ORG_ID ,
268
- args . pipelineId + '' ,
269
+ args . pipelineId ? ( args . pipelineId + '' ) : ( VECTORIZE_PIPELINE_ID || '' ) ,
269
270
args . query + '' ,
270
271
Boolean ( args . webSearch )
271
272
) ;
@@ -305,6 +306,13 @@ async function runServer() {
305
306
data : `Configuration: Organization ID: ${ VECTORIZE_ORG_ID || 'default' } ` ,
306
307
} ) ;
307
308
309
+ if ( VECTORIZE_PIPELINE_ID ) {
310
+ server . sendLoggingMessage ( {
311
+ level : 'info' ,
312
+ data : `Configuration: Using fixed Pipeline ID: ${ VECTORIZE_PIPELINE_ID } ` ,
313
+ } ) ;
314
+ }
315
+
308
316
console . error ( 'Vectorize MCP Server running' ) ;
309
317
}
310
318
0 commit comments