Pinecone MCP Server
April 14, 2025 ยท View on GitHub
An MCP (Model Context Protocol) server for interacting with Pinecone vector database. This server provides tools for AI agents to interact with Pinecone databases through natural language.
Prerequisites
This project requires the MCP TypeScript SDK. Until it's publicly available on npm, you'll need to:
- Download the latest release of the SDK (file named like
modelcontextprotocol-sdk-0.1.0.tgz) - Install it manually:
npm install --save path/to/modelcontextprotocol-sdk-0.1.0.tgz
Features
- List all Pinecone indexes
- Describe specific indexes
- Query vectors with customizable parameters
- Support for namespaces and filters
- Easy integration with AI agents
Installation
You can install and run this package directly using npx:
npx pinecone-mcp
Or install it globally:
npm install -g pinecone-mcp
pinecone-mcp
You can also install it from GitHub:
npx github:azizcoban/pinecone-mcp
Integration with AI Agents
To add this MCP server to your AI agent, add the following configuration to your mcp.json file:
{
"mcpServers": {
"pinecone": {
"command": "npx",
"args": ["-y", "pinecone-mcp"],
"env": {
"PINECONE_API_KEY": "your_api_key_here"
}
}
}
}
This configuration:
- Creates a Pinecone tool namespace in your AI agent
- Uses npx to run the pinecone-mcp server
- Passes your Pinecone API key as an environment variable
For the Claude Desktop app, you can add this configuration to the Claude settings. This will make Pinecone tools available to Claude when interacting with the app.
If you're using a custom AI agent integration, you can reference the MCP documentation at modelcontextprotocol.io for more details on how to implement the client-side configuration.
Configuration
There are two ways to provide your Pinecone API key to the MCP server:
Option 1: Using a .env file (for direct usage)
When running the server directly:
- Copy the example environment file:
cp .env.example .env
- Edit the
.envfile and replaceyour_api_key_herewith your actual Pinecone API key from the Pinecone dashboard.
Option 2: Using environment variables in mcp.json (for AI agent integration)
When using with an AI agent, add the API key to your mcp.json configuration as shown in the Integration with AI Agents section above.
Using Pinecone Tools with AI Agents
Once you've integrated the Pinecone MCP server with your AI agent, the agent can use natural language to access Pinecone functionality. Here are some examples of prompts you can use:
- "List all my Pinecone indexes"
- "Describe the details of my 'my-embeddings' index"
- "Get statistics for my 'product-embeddings' index"
- "Search for vectors similar to [0.1, 0.2, 0.3, ...] in my 'customer-data' index"
- "Fetch the vector with ID '12345' from my 'document-embeddings' index"
The AI agent will translate these natural language requests into the appropriate tool calls to the Pinecone MCP server.
Available Tools
All tools are automatically available to AI agents when properly configured. Here's what each tool does:
listIndexes
Lists all available Pinecone indexes in your account.
Example:
Use the listIndexes tool
describeIndex
Get detailed information about a specific index.
Example:
Use the describeIndex tool with indexName = "my-index"
queryVectors
Query vectors in an index with various parameters.
Example:
Use the queryVectors tool with:
- indexName = "my-index"
- queryVector = [0.1, 0.2, 0.3]
- topK = 5
- namespace = "my-namespace" (optional)
describeIndexStats
Get statistical information about a specific index.
Example:
Use the describeIndexStats tool with:
- indexName = "my-index"
fetchVectors
Fetch specific vectors by their IDs from an index.
Example:
Use the fetchVectors tool with:
- indexName = "my-index"
- ids = ["vector-id-1", "vector-id-2"]
- namespace = "my-namespace" (optional)
listCollections
List all collections in your Pinecone account.
Example:
Use the listCollections tool
describeCollection
Get detailed information about a specific collection.
Example:
Use the describeCollection tool with:
- collectionName = "my-collection"
Complete Example
Here's a complete example of setting up and using the Pinecone MCP server with Claude Desktop:
- Install the Pinecone MCP server globally (optional):
npm install -g pinecone-mcp
- Create or edit the Claude Desktop configuration file (typically located at
~/.config/claude-desktop/config.jsonon macOS/Linux or%APPDATA%\claude-desktop\config.jsonon Windows):
{
"mcpServers": {
"pinecone": {
"command": "npx",
"args": ["-y", "pinecone-mcp"],
"env": {
"PINECONE_API_KEY": "your_actual_api_key_here"
}
}
}
}
-
Restart Claude Desktop to apply the configuration.
-
Now you can ask Claude questions like:
- "What Pinecone indexes do I have?"
- "Show me statistics for my 'product-embeddings' index"
- "Query my 'customer-data' index for vectors similar to [0.1, 0.2, ...]"
Claude will use the Pinecone MCP server to execute these requests and show you the results.
Development
To build the project:
npm run build
To run in development mode:
npm run dev
License
MIT