mcp-pinecone

mcp-pinecone

Pinecone 集成向量搜索功能 (Pinecone jí chéng xiàngliàng sōusuǒ gōngnéng)

数字笔记管理
内容获取
AI集成系统
访问服务器

README

用于 Claude Desktop 的 Pinecone 模型上下文协议服务器

smithery badge

PyPI - Downloads

读取和写入 Pinecone 索引。

组件

flowchart TB
    subgraph Client["MCP 客户端 (例如,Claude Desktop)"]
        UI[用户界面]
    end

    subgraph MCPServer["MCP 服务器 (pinecone-mcp)"]
        Server[服务器类]
        
        subgraph Handlers["请求处理程序"]
            ListRes[list_resources]
            ReadRes[read_resource]
            ListTools[list_tools]
            CallTool[call_tool]
            GetPrompt[get_prompt]
            ListPrompts[list_prompts]
        end
        
        subgraph Tools["已实现的工具"]
            SemSearch[semantic-search]
            ReadDoc[read-document]
            ListDocs[list-documents]
            PineconeStats[pinecone-stats]
            ProcessDoc[process-document]
        end
    end

    subgraph PineconeService["Pinecone 服务"]
        PC[Pinecone 客户端]
        subgraph PineconeFunctions["Pinecone 操作"]
            Search[search_records]
            Upsert[upsert_records]
            Fetch[fetch_records]
            List[list_records]
            Embed[generate_embeddings]
        end
        Index[(Pinecone 索引)]
    end

    %% Connections
    UI --> Server
    Server --> Handlers
    
    ListTools --> Tools
    CallTool --> Tools
    
    Tools --> PC
    PC --> PineconeFunctions
    PineconeFunctions --> Index
    
    %% Data flow for semantic search
    SemSearch --> Search
    Search --> Embed
    Embed --> Index
    
    %% Data flow for document operations
    UpsertDoc --> Upsert
    ReadDoc --> Fetch
    ListRes --> List

    classDef primary fill:#2563eb,stroke:#1d4ed8,color:white
    classDef secondary fill:#4b5563,stroke:#374151,color:white
    classDef storage fill:#059669,stroke:#047857,color:white
    
    class Server,PC primary
    class Tools,Handlers secondary
    class Index storage

资源

该服务器实现了读取和写入 Pinecone 索引的功能。

工具

  • semantic-search: 在 Pinecone 索引中搜索记录。
  • read-document: 从 Pinecone 索引中读取文档。
  • list-documents: 列出 Pinecone 索引中的所有文档。
  • pinecone-stats: 获取有关 Pinecone 索引的统计信息,包括记录数、维度和命名空间。
  • process-document: 将文档处理成块,并将它们更新到 Pinecone 索引中。 这执行分块、嵌入和更新的总体步骤。

注意:嵌入是通过 Pinecone 的推理 API 生成的,分块是使用基于令牌的分块器完成的。 通过从 langchain 复制大量代码并使用 Claude 进行调试编写。

快速开始

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 Pinecone MCP Server:

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

安装服务器

建议使用 uv 在本地为 Claude 安装服务器。

uvx install mcp-pinecone

或者

uv pip install mcp-pinecone

添加您的配置,如下所述。

Claude Desktop

在 MacOS 上:~/Library/Application\ Support/Claude/claude_desktop_config.json 在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json

注意:您可能需要使用 uv 的直接路径。 使用 which uv 查找路径。

开发/未发布的服务器配置

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

已发布的服务器配置

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

注册 Pinecone

您可以在此处注册一个 Pinecone 帐户。

获取 API 密钥

在 Pinecone 中创建一个新索引,替换 {your-index-name},并从 Pinecone 仪表板获取 API 密钥,替换配置中的 {your-secret-api-key}

开发

构建和发布

要准备用于分发的软件包:

  1. 同步依赖项并更新锁定文件:
uv sync
  1. 构建软件包分发:
uv build

这将在 dist/ 目录中创建源和 wheel 分发。

  1. 发布到 PyPI:
uv publish

注意:您需要通过环境变量或命令标志设置 PyPI 凭据:

  • 令牌:--tokenUV_PUBLISH_TOKEN
  • 或用户名/密码:--username/UV_PUBLISH_USERNAME--password/UV_PUBLISH_PASSWORD

调试

由于 MCP 服务器通过 stdio 运行,因此调试可能具有挑战性。 为了获得最佳的调试体验,我们强烈建议使用 MCP Inspector

您可以使用 npm 通过以下命令启动 MCP Inspector:

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

启动后,Inspector 将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

许可证

该项目已获得 MIT 许可证的许可。 有关详细信息,请参见 LICENSE 文件。

源代码

源代码可在 GitHub 上获得。

贡献

Bluesky 上或通过打开一个 issue 将您的想法和反馈发送给我。

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
mult-fetch-mcp-server

mult-fetch-mcp-server

一个多功能的、符合 MCP 规范的网页内容抓取工具,支持多种模式(浏览器/Node)、格式(HTML/JSON/Markdown/文本)和智能代理检测,并提供双语界面(英语/中文)。

精选
本地
AIO-MCP Server

AIO-MCP Server

🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。

精选
本地
Knowledge Graph Memory Server

Knowledge Graph Memory Server

为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。

精选
本地
Hyperbrowser

Hyperbrowser

欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:

精选
本地
https://github.com/Streen9/react-mcp

https://github.com/Streen9/react-mcp

react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。

精选
本地
MCP Atlassian

MCP Atlassian

适用于 Atlassian Cloud 产品(Confluence 和 Jira)的 Model Context Protocol (MCP) 服务器。此集成专为 Atlassian Cloud 实例设计,不支持 Atlassian Server 或 Data Center 部署。

精选
any-chat-completions-mcp

any-chat-completions-mcp

将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。

精选