返回市场
针迹-mcp

针迹-mcp

作者:needle-ai85 星标更新:2025-07-27

项目介绍

使用 Needle MCP 服务器构建代理

smithery 徽章

功能截图 - Claude

MCP (模型上下文协议) 服务器通过 Claude 的桌面应用程序使用 Needle 来管理和搜索文档。

<a href="https://glama.ai/mcp/servers/5jw1t7hur2"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=2909263281,921019248&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Needle Server MCP 服务器" /> </a>

目录


概述

Needle MCP 服务器允许您:

  • 组织和存储文档以实现快速检索。
  • 通过 Claude 的大型语言模型执行强大的搜索。
  • 无缝集成到 Needle 生态系统中进行高级文档管理。

MCP (模型上下文协议) 标准化了 LLM 连接到外部数据源的方式。您可以使用 Needle MCP 服务器轻松启用您的 AI 应用程序中的语义搜索工具,使埋藏在 PDF、DOCX、XLSX 和其他文件中的数据立即可被 LLM 访问。

我们推荐使用我们的远程 MCP 服务器以获得最佳体验——无需本地设置。


特性

  • 文档管理: 在服务器上轻松添加和组织文档。
  • 搜索与检索: 基于 Claude 的自然语言搜索,快速获取答案。
  • 简单集成:Claude 桌面 和 Needle 集合兼容。

使用方法

Claude 桌面中的命令

以下是在 Claude 桌面中如何使用命令与服务器交互的示例:

在 Claude 桌面中使用命令

  1. 打开 Claude 桌面 并连接到 Needle MCP 服务器。
  2. 使用简单的文本命令来搜索、检索或修改文档。
  3. 在用户友好的界面中查看 Claude 返回的搜索结果。

在 Needle 中的结果

https://github.com/user-attachments/assets/0235e893-af96-4920-8364-1e86f73b3e6c


YouTube 视频解释

要了解如何使用 Needle MCP 服务器与 Claude 和 Claude 桌面,请观看此 YouTube 解释视频


安装

1. 远程 MCP 服务器(推荐)

Claude 桌面配置

创建或更新您的配置文件:

  • 对于 MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 对于 Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "needle": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.needle.app/mcp",
        "--header",
        "Authorization:Bearer ${NEEDLE_API_KEY}"
      ],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}

Cursor 配置

创建或更新 .cursor/mcp.json

{
  "mcpServers": {
    "needle": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.needle.app/mcp",
        "--header",
        "Authorization:${NEEDLE_AUTH_HEADER}"
      ],
      "env": {
        "NEEDLE_AUTH_HEADER": "Bearer <your-needle-api-key>"
      }
    }
  }
}

Needle 设置 获取您的 API 密钥。

我们提供两个端点:

  • 流式 HTTP: https://mcp.needle.app/mcp(推荐)
  • SSE: https://mcp.needle.app/sse

注意:MCP 在最新规范中弃用了 SSE 端点,因此新客户端应优先选择流式 HTTP 端点。

2. 本地安装

  1. 克隆仓库:
git clone https://github.com/needle-ai/needle-mcp.git
  1. 使用 Homebrew 全局安装 UV:
brew install uv
  1. 创建您的配置文件:
    • 对于 MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 对于 Windows: %APPDATA%/Claude/claude_desktop_config.json

Claude 桌面配置

{
  "mcpServers": {
    "needle": {
      "command": "uv",
      "args": ["--directory", "/path/to/needle-mcp", "run", "needle-mcp"],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}

Cursor 配置

{
  "mcpServers": {
    "needle": {
      "command": "uv",
      "args": ["--directory", "/path/to/needle-mcp", "run", "needle-mcp"],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}
  1. /path/to/needle-mcp 替换为您实际的仓库路径
  2. 添加您的 Needle API 密钥
  3. 重启 Claude 桌面

通过 Smithery 安装

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

3. Docker 安装

  1. 克隆并构建:
git clone https://github.com/needle-ai/needle-mcp.git
cd needle-mcp
docker build -t needle-mcp .
  1. 添加到您的 Claude 桌面配置 (~/Library/Application Support/Claude/claude_desktop_config.json):
{
  "mcpServers": {
    "needle": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "needle-mcp"],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}
  1. 重启 Claude 桌面

使用示例

  • "创建一个名为 '技术文档' 的新集合"
  • "将此文档添加到集合中,该文档位于 https://needle.app"
  • "搜索集合中关于 AI 的信息"
  • "列出我所有的集合"

故障排除

如果不起作用:

  • 确保全局安装了 uv(如果没有,使用 pip uninstall uv 卸载,然后使用 brew install uv 重新安装)
  • 或者使用 which uv 查找 uv 路径,并替换 "command": "uv" 为完整路径
  • 验证您的 Needle API 密钥是否正确
  • 检查配置中的 needle-mcp 路径是否与实际仓库位置匹配

重置 Claude 桌面配置

如果您看到旧配置或集成不起作用:

  1. 查找所有 Claude 桌面配置文件:
find / -name "claude_desktop_config.json" 2>/dev/null
  1. 删除所有 Claude 桌面数据:
  • 对于 MacOS: rm -rf ~/Library/Application\ Support/Claude/*
  • 对于 Windows: 删除 %APPDATA%/Claude/ 内容
  1. 创建仅包含 Needle 的新配置:
mkdir -p ~/Library/Application\ Support/Claude
cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json
<< 'EOL'
{
  "mcpServers": {
    "needle": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/needle-mcp",
        "run",
        "needle-mcp"
      ],
      "env": {
        "NEEDLE_API_KEY": "your_needle_api_key"
      }
    }
  }
}
EOL
  1. 完全退出 Claude 桌面(Mac 上使用 Command+Q)并重新启动它

  2. 如果仍然看到旧配置:

  • 检查其他位置是否有额外的配置文件
  • 尝试清除浏览器缓存(如果使用 Web 版本)
  • 验证配置文件是否从正确的路径读取