From 1ca5c6d9b8d97d37057091cb6dd5f90a9cdec6cc Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Tue, 29 Apr 2025 02:40:02 +0530 Subject: [PATCH 1/8] windows locally install readme.md update --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 7b84e65..cb75dc0 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,16 @@ Use Claude desktop to locate the `claude_desktop_config.json` file by navigating Restart Claude desktop. On the new chat screen, you should see a hammer (MCP) icon appear with the new MCP tools available. + +## Windows + +-Create .enc file and add PINECONE_API_KEY= +-npm install dotenv +-At constant.ts : import 'dotenv/config'; +-npx ts-node src/server.ts +-npm run build +-npm run start + ## Usage Once configured, your AI tool will automatically make use of the MCP to interact with Pinecone. You may be prompted for permission before a tool can be used. Try asking your AI assistant to set up an example index, upload sample data, or search for you! From acca6a87cb6e1df5e4d7270475ea19312f0e8c12 Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Tue, 29 Apr 2025 02:44:00 +0530 Subject: [PATCH 2/8] iddentation fix --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb75dc0..cc70769 100644 --- a/README.md +++ b/README.md @@ -70,13 +70,14 @@ Restart Claude desktop. On the new chat screen, you should see a hammer (MCP) ic ## Windows - +``` -Create .enc file and add PINECONE_API_KEY= -npm install dotenv -At constant.ts : import 'dotenv/config'; -npx ts-node src/server.ts -npm run build -npm run start +``` ## Usage Once configured, your AI tool will automatically make use of the MCP to interact with Pinecone. You may be prompted for permission before a tool can be used. Try asking your AI assistant to set up an example index, upload sample data, or search for you! From 58c7f3276a415a71c01a691bde91a68ddc8f306b Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Tue, 29 Apr 2025 02:44:25 +0530 Subject: [PATCH 3/8] identation fix 1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc70769..f78a927 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Restart Claude desktop. On the new chat screen, you should see a hammer (MCP) ic -At constant.ts : import 'dotenv/config'; -npx ts-node src/server.ts -npm run build --npm run start +-npm run start ``` ## Usage From eb33839bf68c2c783ea501799157fe46614e955d Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Tue, 29 Apr 2025 02:45:04 +0530 Subject: [PATCH 4/8] text fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f78a927..be2c1b1 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Restart Claude desktop. On the new chat screen, you should see a hammer (MCP) ic ## Windows ``` --Create .enc file and add PINECONE_API_KEY= +-Create .env file and add PINECONE_API_KEY= -npm install dotenv -At constant.ts : import 'dotenv/config'; -npx ts-node src/server.ts From 1eef3378714b84c34d82af25a86cc68dfff81c35 Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Thu, 1 May 2025 02:49:55 +0530 Subject: [PATCH 5/8] delet-record implementation --- src/tools/database/delete-index-records.ts | 24 ++++++++++++++++++++++ src/tools/database/index.ts | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 src/tools/database/delete-index-records.ts diff --git a/src/tools/database/delete-index-records.ts b/src/tools/database/delete-index-records.ts new file mode 100644 index 0000000..173ee19 --- /dev/null +++ b/src/tools/database/delete-index-records.ts @@ -0,0 +1,24 @@ +import {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js'; +import {Pinecone} from '@pinecone-database/pinecone'; +import {z} from 'zod'; + +const INSTRUCTIONS = 'Delete records from a Pinecone index by ID'; + +const SCHEMA = { + name: z.string().describe('The index to delete from.'), + namespace: z.string().describe('The namespace to delete from.'), + ids: z + .array(z.string()) + .nonempty() + .describe('A list of record IDs to delete.'), +}; + +export function deleteIndexRecordsTool(server: McpServer, pc: Pinecone) { + server.tool('delete-index-records', INSTRUCTIONS, SCHEMA, async ({name, namespace, ids}) => { + const ns = pc.index(name).namespace(namespace); + await ns.deleteMany(ids); + return { + content: [{type: 'text', text: 'Records deleted successfully'}], + }; + }); +} diff --git a/src/tools/database/index.ts b/src/tools/database/index.ts index 9a3870a..60a34a8 100644 --- a/src/tools/database/index.ts +++ b/src/tools/database/index.ts @@ -10,11 +10,14 @@ import {addListIndexesTool} from './list-indexes.js'; import {addRerankDocumentsTool} from './rerank-documents.js'; import {addSearchRecordsTool} from './search-records.js'; import {addUpsertRecordsTool} from './upsert-records.js'; +import {deleteIndexRecordsTool} from './delete-index-records.js' export default function addDatabaseTools(server: McpServer) { if (!PINECONE_API_KEY) { console.error('Skipping database tools -- PINECONE_API_KEY environment variable is not set.'); return; + }else{ + console.log("PINECONE_API_KEY", PINECONE_API_KEY); } const pc = new Pinecone({ @@ -30,4 +33,5 @@ export default function addDatabaseTools(server: McpServer) { addSearchRecordsTool(server, pc); addRerankDocumentsTool(server, pc); addCascadingSearchTool(server, pc); + deleteIndexRecordsTool(server, pc); } From 1a79059bbe3607afdb33f3ed990bd9172d5a1afc Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Thu, 1 May 2025 03:03:30 +0530 Subject: [PATCH 6/8] revert-changes --- src/tools/database/delete-index-records.ts | 24 ---------------------- src/tools/database/index.ts | 1 - 2 files changed, 25 deletions(-) delete mode 100644 src/tools/database/delete-index-records.ts diff --git a/src/tools/database/delete-index-records.ts b/src/tools/database/delete-index-records.ts deleted file mode 100644 index 173ee19..0000000 --- a/src/tools/database/delete-index-records.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js'; -import {Pinecone} from '@pinecone-database/pinecone'; -import {z} from 'zod'; - -const INSTRUCTIONS = 'Delete records from a Pinecone index by ID'; - -const SCHEMA = { - name: z.string().describe('The index to delete from.'), - namespace: z.string().describe('The namespace to delete from.'), - ids: z - .array(z.string()) - .nonempty() - .describe('A list of record IDs to delete.'), -}; - -export function deleteIndexRecordsTool(server: McpServer, pc: Pinecone) { - server.tool('delete-index-records', INSTRUCTIONS, SCHEMA, async ({name, namespace, ids}) => { - const ns = pc.index(name).namespace(namespace); - await ns.deleteMany(ids); - return { - content: [{type: 'text', text: 'Records deleted successfully'}], - }; - }); -} diff --git a/src/tools/database/index.ts b/src/tools/database/index.ts index 60a34a8..e9bb678 100644 --- a/src/tools/database/index.ts +++ b/src/tools/database/index.ts @@ -33,5 +33,4 @@ export default function addDatabaseTools(server: McpServer) { addSearchRecordsTool(server, pc); addRerankDocumentsTool(server, pc); addCascadingSearchTool(server, pc); - deleteIndexRecordsTool(server, pc); } From c1a2752694846dcf15b2b1146414ff2880b062ec Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Thu, 1 May 2025 03:04:44 +0530 Subject: [PATCH 7/8] remove-console-index.ts --- src/tools/database/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tools/database/index.ts b/src/tools/database/index.ts index e9bb678..8ae8734 100644 --- a/src/tools/database/index.ts +++ b/src/tools/database/index.ts @@ -16,8 +16,6 @@ export default function addDatabaseTools(server: McpServer) { if (!PINECONE_API_KEY) { console.error('Skipping database tools -- PINECONE_API_KEY environment variable is not set.'); return; - }else{ - console.log("PINECONE_API_KEY", PINECONE_API_KEY); } const pc = new Pinecone({ From 8053d896d1145b884dcbadab28d5f3f43cb20776 Mon Sep 17 00:00:00 2001 From: Abhishek1441 Date: Thu, 1 May 2025 03:05:31 +0530 Subject: [PATCH 8/8] remove import deletmethod from index.ts --- src/tools/database/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/database/index.ts b/src/tools/database/index.ts index 8ae8734..9a3870a 100644 --- a/src/tools/database/index.ts +++ b/src/tools/database/index.ts @@ -10,7 +10,6 @@ import {addListIndexesTool} from './list-indexes.js'; import {addRerankDocumentsTool} from './rerank-documents.js'; import {addSearchRecordsTool} from './search-records.js'; import {addUpsertRecordsTool} from './upsert-records.js'; -import {deleteIndexRecordsTool} from './delete-index-records.js' export default function addDatabaseTools(server: McpServer) { if (!PINECONE_API_KEY) {