Use the Pinecone MCP server
Connect AI agents to Pinecone through the MCP server to search docs, manage indexes, and query data from Claude, Cursor, Antigravity, or Claude Code.
The Pinecone MCP server enables AI agents to interact directly with Pinecone's functionality and documentation via the standardized Model Context Protocol (MCP). Using the MCP server, agents can search Pinecone documentation, manage indexes, upsert data, and query indexes for relevant information.
This page shows you how to configure Antigravity, Claude Desktop, Claude Code, and Cursor to connect with the Pinecone MCP server.
The Pinecone MCP server provides the following tools:
search-docs: Search the official Pinecone documentation.list-indexes: Lists all Pinecone indexes.describe-index: Describes the configuration of an index.describe-index-stats: Provides statistics about the data in the index, including the number of records and available namespaces.create-index-for-model: Creates a new index that uses an integrated inference model to embed text as vectors.upsert-records: Inserts or updates records in an index with integrated inference.search-records: Searches for records in an index based on a text query, using integrated inference for embedding. Has options for metadata filtering and reranking.cascading-search: Searches for records across multiple indexes, deduplicating and reranking the results.rerank-documents: Reranks a collection of records or text documents using a specialized reranking model.
Before you begin
Section titled “Before you begin”Ensure you have the following:
- A Pinecone API key
- Node.js installed, with
nodeandnpxavailable on yourPATH
Configure Antigravity
Section titled “Configure Antigravity”Antigravity supports MCP via its built-in MCP Store. You can install the Pinecone server from the store or add it via the raw config.
Add the MCP server
Install from the MCP Store
- Open the MCP Store via the "..." dropdown at the top of the editor's agent panel.
- Find Pinecone in the list of supported servers and click Install.
- Follow the on-screen prompts to authenticate and set your Pinecone API key.
Add via raw config
- Open the MCP Store via the "..." dropdown at the top of the editor's agent panel.
- Click Manage MCP Servers, then View raw config.
- Edit
mcp_config.jsonand add the Pinecone server:
JSON { "mcpServers": { "pinecone": { "command": "npx", "args": [ "-y", "@pinecone-database/mcp" ], "env": { "PINECONE_API_KEY": "{{YOUR_API_KEY}}" } } } }Replace
YOUR_API_KEYwith your Pinecone API key.Check the status
After installing or saving the config, the Pinecone server and its tools should appear in the agent panel. Use the MCP tools list to confirm the server is connected.
Test the server
In the agent chat, try prompts that use Pinecone. For example, try generating code that creates an index, upserts records, or searches the index. The AI can use the connected MCP server for context and actions.
Configure Claude Code
Section titled “Configure Claude Code”Add the MCP server
Run the following command to add the Pinecone MCP server to your Claude Code instance:
Bash claude mcp add-json pinecone-mcp \ '{"type": "stdio", "command": "npx", "args": ["-y", "@pinecone-database/mcp"], "env": {"PINECONE_API_KEY": "YOUR_API_KEY"}}'Check the status
Restart Claude Code. Then, run the
/mcpcommand to check the status of the Pinecone MCP. You should see the following:Bash > /mcp ⎿ MCP Server Status • pinecone-mcp: ✓ connectedTest the server
Test the Pinecone MCP server with prompts to Claude Code that require the server to generate Pinceone-compatible code and perform tasks in your Pinecone account.
Generate code:
Write a Python script that creates an index for dense vectors with integrated embedding, upserts 20 sentences about dogs, waits 10 seconds, searches the index, and reranks the results.
Perform tasks:
Create an index for dense vectors with integrated embedding, upsert 20 sentences about dogs, waits 10 seconds, search the index, and reranks the results.
Configure Claude Desktop
Section titled “Configure Claude Desktop”Add the MCP server
Go to Settings > Developer > Edit Config and add the following configuration:
JSON { "mcpServers": { "pinecone": { "command": "npx", "args": [ "-y", "@pinecone-database/mcp" ], "env": { "PINECONE_API_KEY": "YOUR_API_KEY" } } } }Replace
YOUR_API_KEYwith your Pinecone API key.Check the status
Restart Claude Desktop. On the new chat screen, you should see a hammer (MCP) icon appear with the new MCP tools available.
Test the server
Test the Pinecone MCP server with prompts that required the server to generate Pinceone-compatible code and perform tasks in your Pinecone account.
Generate code:
Write a Python script that creates an index for dense vectors with integrated embedding, upserts 20 sentences about dogs, waits 10 seconds, searches the index, and reranks the results.
Perform tasks:
Create an index for dense vectors with integrated embedding, upsert 20 sentences about dogs, waits 10 seconds, search the index, and reranks the results.
Configure Cursor
Section titled “Configure Cursor”Add the MCP server
In your project root, create a
.cursor/mcp.jsonfile, if it doesn't exist, and add the following configuration:JSON { "mcpServers": { "pinecone": { "command": "npx", "args": [ "-y", "@pinecone-database/mcp" ], "env": { "PINECONE_API_KEY": "{{YOUR_API_KEY}}" } } } }Check the status
Go to Cursor Settings > MCP. You should see the server and its list of tools.
Add Pinecone rules
The Pinecone MCP server works well out of the box. However, you can add explicit rules to ensure the server behaves as you expect.
In your project root, create a
.cursor/rules/pinecone.mdcfile and add the following:[expandable] ### Tool Usage for Code Generation - When generating code related to Pinecone, always use the `pinecone` MCP and the `search_docs` tool. - Perform at least two distinct searches per request using different, relevant questions to ensure comprehensive context is gathered before writing code. ### Error Handling - If an error occurs while executing Pinecone-related code, immediately invoke the `pinecone` MCP and the `search_docs` tool. - Search for guidance on the specific error encountered and incorporate any relevant findings into your resolution strategy. ### Syntax and Version Accuracy - Before writing any code, verify and use the correct syntax for the latest stable version of the Pinecone SDK. - Prefer official code snippets and examples from documentation over generated or assumed field values. - Do not fabricate field names, parameter values, or request formats. ### SDK Installation Best Practices - When providing installation instructions, always reference the current official package name. - For Pinecone, use `pip install pinecone` not deprecated packages like `pinecone-client`.Test the server
Press
Command + ito open the Agent chat. Test the Pinecone MCP server with prompts that required the server to generate Pinceone-compatible code and perform tasks in your Pinecone account.Generate code:
Write a Python script that creates an index for dense vectors with integrated embedding, upserts 20 sentences about dogs, waits 10 seconds, searches the index, and reranks the results.
Perform tasks:
Create an index for dense vectors with integrated embedding, upsert 20 sentences about dogs, waits 10 seconds, search the index, and reranks the results.