Needle MCP Server

官方

生產就緒的RAG,開箱即用,可從您的文件中搜尋與檢索資料。

文件

使用 Needle MCP Server 構建代理

smithery badge

Screenshot of Feature - Claude

MCP(模型上下文協定)伺服器,用於透過 Claude 桌面應用程式管理文件並使用 Needle 執行搜尋。

Needle Server MCP server

目錄


概述

Needle MCP Server 讓您可以:

  • 整理並儲存文件以便快速檢索。
  • 透過 Claude 的大型語言模型執行強大的搜尋。
  • 與 Needle 生態系統無縫整合,實現進階文件管理。

MCP(模型上下文協定)標準化了 LLM 連接外部資料來源的方式。您可以使用 Needle MCP Server 輕鬆地在 AI 應用程式中啟用語義搜尋工具,讓埋藏在 PDF、DOCX、XLSX 和其他檔案中的資料能立即被 LLM 存取。

我們建議使用我們的遠端 MCP 伺服器以獲得最佳體驗——無需本機設定。


功能特色

  • 文件管理: 輕鬆在伺服器上新增和整理文件。
  • 搜尋與檢索: 基於 Claude 的自然語言搜尋,快速獲得解答。
  • 輕鬆整合: 可與 Claude Desktop 和 Needle 集合搭配使用。

使用方式

在 Claude Desktop 中的指令

以下是如何在 Claude Desktop 中使用指令與伺服器互動的範例:

Using commands in Claude Desktop

  1. 開啟 Claude Desktop 並連接到 Needle MCP Server。
  2. 使用簡單的文字指令來搜尋、檢索或修改文件。
  3. 檢視 Claude 回傳的搜尋結果,介面易於使用。

在 Needle 中的結果

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


Youtube 影片解說

如需觀看使用 Needle MCP Server 搭配 Claude 和 Claude Desktop 的完整操作示範,請觀看此 YouTube 解說影片


安裝

1. 遠端 MCP 伺服器(建議)

Claude Desktop 設定

建立或更新您的設定檔:

  • 對於 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 金鑰。

我們提供兩個端點:

  • 可串流的 HTTPhttps://mcp.needle.app/mcp(建議)
  • SSEhttps://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 Desktop 設定

{
  "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 Desktop

透過 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 Desktop 設定 (~/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 Desktop

使用範例

  • "建立一個名為「技術文件」的新集合"
  • "將此文件新增至集合,該文件為 https://needle.app"
  • "在集合中搜尋關於 AI 的資訊"
  • "列出我所有的集合"

疑難排解

如果無法運作:

  • 確保 uv 已全域安裝(如果沒有,請使用 pip uninstall uv 解除安裝,並使用 brew install uv 重新安裝)
  • 或者使用 which uv 尋找 uv 路徑,並將 "command": "uv" 替換為完整路徑
  • 驗證您的 Needle API 金鑰是否正確
  • 檢查設定中的 needle-mcp 路徑是否與您實際的儲存庫位置相符

重設 Claude Desktop 設定

如果您看到舊的設定或整合無法運作:

  1. 尋找所有 Claude Desktop 設定檔:
find / -name "claude_desktop_config.json" 2>/dev/null
  1. 移除所有 Claude Desktop 資料:
  • 在 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 Desktop(在 Mac 上為 Command+Q)並重新啟動

  2. 如果您仍然看到舊的設定:

  • 檢查其他位置是否有額外的設定檔
  • 如果使用網頁版,請嘗試清除瀏覽器快取
  • 驗證設定檔是否從正確的位置讀取