MCP HubMCP Hub
sirmews

mcp-pinecone

by: sirmews

Model Context Protocol server to allow for reading and writing from Pinecone. Rudimentary RAG

110created 08/12/2024
Visit
Pinecone
RAG

📌Overview

Purpose: To provide a seamless framework for reading and writing to a Pinecone index for applications such as Claude Desktop.

Overview: The Pinecone Model Context Protocol Server facilitates efficient interactions with a Pinecone index, enabling users to conduct operations like semantic search, document reading, and statistics retrieval. This server is integral for applications needing quick access to large datasets through a robust indexing system.

Key Features:

  • Semantic Search: Allows users to perform searches within the Pinecone index, retrieving records based on semantic similarity.

  • Document Management: Features tools to read individual documents, list all documents, and process new documents into chunks for upsert into the index, ensuring efficient and organized data management.


Pinecone Model Context Protocol Server for Claude Desktop

Overview

The Pinecone Model Context Protocol (MCP) Server allows you to read and write to a Pinecone index.

Components

  • MCP Client (e.g., Claude Desktop): User Interface
  • MCP Server (pinecone-mcp): Contains the Server Class and Request Handlers
    • Request Handlers:
      • list_resources
      • read_resource
      • list_tools
      • call_tool
      • get_prompt
      • list_prompts
    • Implemented Tools:
      • semantic-search: Search for records in the Pinecone index.
      • read-document: Read a document from the Pinecone index.
      • list-documents: List all documents in the Pinecone index.
      • pinecone-stats: Get stats about the Pinecone index, including the number of records, dimensions, and namespaces.
      • process-document: Process a document into chunks and upsert them into the Pinecone index.
  • Pinecone Service: Contains Pinecone Client and Operations
    • Pinecone Operations:
      • search_records
      • upsert_records
      • fetch_records
      • list_records
      • generate_embeddings

Quickstart

Installing via Smithery

To install the Pinecone MCP Server for Claude Desktop, use the following command:

npx -y @smithery/cli install mcp-pinecone --client claude

Install the Server

You can use uv to install the server locally:

uvx install mcp-pinecone

or

uv pip install mcp-pinecone

Add your configurations in the specified location for Claude Desktop:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Configuration

Development/Unpublished Servers Configuration:

"mcpServers": {
  "mcp-pinecone": {
    "command": "uv",
    "args": [
      "--directory",
      "{project_dir}",
      "run",
      "mcp-pinecone"
    ]
  }
}

Published Servers Configuration:

"mcpServers": {
  "mcp-pinecone": {
    "command": "uvx",
    "args": [
      "--index-name",
      "{your-index-name}",
      "--api-key",
      "{your-secret-api-key}",
      "mcp-pinecone"
    ]
  }
}

Sign Up for Pinecone

You can sign up for a Pinecone account here.

Get an API Key

Create a new index in Pinecone and retrieve your API key from the Pinecone dashboard.

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update the lockfile:

    uv sync
    
  2. Build package distributions:

    uv build
    
  3. Publish to PyPI:

    uv publish
    

Debugging

For the best debugging experience, use the MCP Inspector. Launch the Inspector using:

npx @modelcontextprotocol/inspector uv --directory {project_dir} run mcp-pinecone

License

This project is licensed under the MIT License.

Source Code

The source code is available on GitHub.

Contributing

Feel free to share your ideas and feedback on Bluesky or by opening an issue.