
MCP(模型上下文协议)服务器,用于通过 Claude 的桌面应用程序管理文档并使用 Needle 进行搜索。
Needle MCP 服务器允许您:
MCP(模型上下文协议)标准化了大型语言模型(LLM)连接到外部数据源的方式。您可以使用 Needle MCP 服务器轻松在 AI 应用程序中启用语义搜索工具,使 PDF、DOCX、XLSX 和其他文件中埋藏的数据能够被 LLM 即时访问。
我们推荐使用我们的远程 MCP 服务器以获得最佳体验——无需本地设置。
以下是如何在 Claude 桌面中使用命令与服务器交互的示例:

https://github.com/user-attachments/assets/0235e893-af96-4920-8364-1e86f73b3e6c
要全面了解如何使用 Needle MCP 服务器与 Claude 和 Claude 桌面,请观看此 YouTube 讲解视频。
Claude 桌面配置
创建或更新您的配置文件:
~/Library/Application Support/Claude/claude_desktop_config.json%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 密钥。
我们提供两个端点:
https://mcp.needle.app/mcp(推荐)https://mcp.needle.app/sse注意:MCP 在最新规范中弃用了 SSE 端点,因此新客户端应优先使用可流式 HTTP 端点。
git clone https://github.com/needle-ai/needle-mcp.git

brew install uv
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.jsonClaude 桌面配置
{
"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>"
}
}
}
}

/path/to/needle-mcp 替换为您的实际仓库路径通过 Smithery 安装
npx -y @smithery/cli install needle-mcp --client claude
git clone https://github.com/needle-ai/needle-mcp.git
cd needle-mcp
docker build -t needle-mcp .

~/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>"
}
}
}
}

如果无法工作:
uv 已全局安装(如果没有,请使用 pip uninstall uv 卸载,然后使用 brew install uv 重新安装)which uv 查找 uv 路径,并用完整路径替换 "command": "uv"如果您看到旧配置或集成无法工作:
find / -name "claude_desktop_config.json" 2>/dev/null

rm -rf ~/Library/Application\ Support/Claude/*%APPDATA%/Claude/ 的内容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
完全退出 Claude 桌面(在 Mac 上使用 Command+Q)并重新启动
如果您仍然看到旧配置: