From 8bd1d16165ca0fc8a1f5d929044a3cc41262919f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 22:11:05 +0000 Subject: [PATCH 1/3] Add support for fixed pipeline ID via environment variable Co-Authored-By: nicolo.boschi@vectorize.io --- src/index.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 76fabd9..c046cc1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,7 +32,7 @@ const RETRIEVAL_TOOL: Tool = { description: 'The number of documents to retrieve.', }, }, - required: ['pipelineId', 'question', 'k'], + required: process.env.VECTORIZE_PIPELINE_ID ? ['question', 'k'] : ['pipelineId', 'question', 'k'], }, }; @@ -56,7 +56,7 @@ const DEEP_RESEARCH_TOOL: Tool = { description: 'Whether to perform a web search.', }, }, - required: ['pipelineId', 'query', 'webSearch'], + required: process.env.VECTORIZE_PIPELINE_ID ? ['query', 'webSearch'] : ['pipelineId', 'query', 'webSearch'], }, }; @@ -97,6 +97,7 @@ const server = new Server( // Get optional API URL const VECTORIZE_ORG_ID = process.env.VECTORIZE_ORG_ID; const VECTORIZE_TOKEN = process.env.VECTORIZE_TOKEN; +const VECTORIZE_PIPELINE_ID = process.env.VECTORIZE_PIPELINE_ID; // Check if API key is required (only for cloud service) if (!VECTORIZE_ORG_ID || !VECTORIZE_TOKEN) { console.error( @@ -250,7 +251,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { case 'retrieve': { return await performRetrieval( VECTORIZE_ORG_ID, - args.pipelineId + '', + args.pipelineId ? (args.pipelineId + '') : (VECTORIZE_PIPELINE_ID || ''), args.question + '', Number(args.k) ); @@ -265,7 +266,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { case 'deep-research': { return await performDeepResearch( VECTORIZE_ORG_ID, - args.pipelineId + '', + args.pipelineId ? (args.pipelineId + '') : (VECTORIZE_PIPELINE_ID || ''), args.query + '', Boolean(args.webSearch) ); @@ -305,6 +306,13 @@ async function runServer() { data: `Configuration: Organization ID: ${VECTORIZE_ORG_ID || 'default'}`, }); + if (VECTORIZE_PIPELINE_ID) { + server.sendLoggingMessage({ + level: 'info', + data: `Configuration: Using fixed Pipeline ID: ${VECTORIZE_PIPELINE_ID}`, + }); + } + console.error('Vectorize MCP Server running'); } From f31112c8bf3d1beb103d06c06c71cf52d371170a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 22:12:50 +0000 Subject: [PATCH 2/3] Update README to document VECTORIZE_PIPELINE_ID environment variable Co-Authored-By: nicolo.boschi@vectorize.io --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f3151f..46ea5bc 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ A Model Context Protocol (MCP) server implementation that integrates with [Vecto ```bash export VECTORIZE_ORG_ID=YOUR_ORG_ID export VECTORIZE_TOKEN=YOUR_TOKEN +# Optional: Set a fixed pipeline ID to use for all requests +export VECTORIZE_PIPELINE_ID=YOUR_PIPELINE_ID npx -y @vectorize-io/vectorize-mcp-server ``` @@ -28,7 +30,8 @@ npx -y @vectorize-io/vectorize-mcp-server "args": ["-y", "@vectorize-io/vectorize-mcp-server"], "env": { "VECTORIZE_ORG_ID": "your-org-id", - "VECTORIZE_TOKEN": "your-token" + "VECTORIZE_TOKEN": "your-token", + "VECTORIZE_PIPELINE_ID": "your-pipeline-id" // Optional: Set a fixed pipeline ID } } } @@ -94,4 +97,4 @@ npm run build 1. Fork the repository 2. Create your feature branch -3. Submit a pull request \ No newline at end of file +3. Submit a pull request From e34781867a36daf6c1eaefddabcc682bca790b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Fri, 28 Mar 2025 13:47:31 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 46ea5bc..4d9ad89 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ export VECTORIZE_PIPELINE_ID=YOUR_PIPELINE_ID npx -y @vectorize-io/vectorize-mcp-server ``` -## Configuration on Claude/Windsurf +## Configuration on Claude/Windsurf/Cursor/Cline ```json { @@ -31,7 +31,7 @@ npx -y @vectorize-io/vectorize-mcp-server "env": { "VECTORIZE_ORG_ID": "your-org-id", "VECTORIZE_TOKEN": "your-token", - "VECTORIZE_PIPELINE_ID": "your-pipeline-id" // Optional: Set a fixed pipeline ID + "VECTORIZE_PIPELINE_ID": "your-pipeline-id" } } }