针线文档搜索

@needle-ai/needle-mcp
0 Stars 390 次浏览 needle-ai 更新于 2026-08-23

一个允许用户通过Claude桌面应用程序使用Needle管理文档并进行由Claude驱动的搜索的服务器。

该服务暂未提供标准配置,请参考 README 手动接入

可用工具 (7 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

needle_list_collections

Retrieve a complete list of all Needle document collections accessible to your account. Returns detailed information including collection IDs, names, and creation dates. Use this tool when you need to: - Get an overview of available document collections - Find collection IDs for subsequent operations - Verify collection existence before performing operations The response includes metadata that's required for other Needle operations.

该工具无需必填参数,直接调用即可

needle_create_collection 1 个参数 需填 1 项

Create a new document collection in Needle for organizing and searching documents. A collection acts as a container for related documents and enables semantic search across its contents. Use this tool when you need to: - Start a new document organization - Group related documents together - Set up a searchable document repository Returns a collection ID that's required for subsequent operations. Choose a descriptive name that reflects the collection's purpose for better organization.

必填参数:name

needle_get_collection_details 1 个参数 需填 1 项

Fetch comprehensive metadata about a specific Needle collection. Provides detailed information about the collection's configuration, creation date, and current status. Use this tool when you need to: - Verify a collection's existence and configuration - Check collection metadata before operations - Get creation date and other attributes Requires a valid collection ID and returns detailed collection metadata. Will error if collection doesn't exist.

必填参数:collection_id

needle_get_collection_stats 1 个参数 需填 1 项

Retrieve detailed statistical information about a Needle collection's contents and status. Provides metrics including: - Total number of documents - Processing status of documents - Storage usage and limits - Index status and health Use this tool to: - Monitor collection size and growth - Verify processing completion - Check collection health before operations Essential for ensuring collection readiness before performing searches.

必填参数:collection_id

needle_list_files 1 个参数 需填 1 项

List all documents stored within a specific Needle collection with their current status. Returns detailed information about each file including: - File ID and name - Processing status (pending, processing, complete, error) - Upload date and metadata Use this tool when you need to: - Inventory available documents - Check processing status of uploads - Get file IDs for reference - Verify document availability before searching Essential for monitoring document processing completion before performing searches.

必填参数:collection_id

needle_add_file 3 个参数 需填 3 项

Add a new document to a Needle collection by providing a URL for download. Supports multiple file formats including: - PDF documents - Microsoft Word files (DOC, DOCX) - Plain text files (TXT) - Web pages (HTML) The document will be: 1. Downloaded from the provided URL 2. Processed for text extraction 3. Indexed for semantic search Use this tool when you need to: - Add new documents to a collection - Make documents searchable - Expand your knowledge base Important: Documents require processing time before they're searchable. Check processing status using needle_list_files before searching new content.

必填参数:collection_id、name、url

needle_search 2 个参数 需填 2 项

Perform intelligent semantic search across documents in a Needle collection. This tool uses advanced embedding technology to find relevant content based on meaning, not just keywords. The search: - Understands natural language queries - Finds conceptually related content - Returns relevant text passages with source information - Ranks results by semantic relevance Use this tool when you need to: - Find specific information within documents - Answer questions from document content - Research topics across multiple documents - Locate relevant passages and their sources More effective than traditional keyword search for: - Natural language questions - Conceptual queries - Finding related content Returns matching text passages with their source file IDs.

必填参数:collection_id、query

服务介绍

使用 Needle MCP 服务器构建代理

功能截图 - Claude

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

目录


概述

Needle MCP 服务器允许您:

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

功能

  • 文档管理:轻松地在服务器上添加和组织文档。
  • 搜索与检索:基于 Claude 的自然语言搜索以快速获取答案。
  • 易于集成:与 Claudie Desktop 和 Needle 集合一起工作。

用法

Claudie 桌面中的命令

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

在 Claudie 桌面中使用命令

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

在 Needle 中的结果

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


YouTube 视频解释

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


安装

  1. 克隆仓库:
git clone https://github.com/yourusername/needle-mcp.git
  1. 使用 Homebrew 在终端中全局安装 UV:
brew install uv
  1. 创建 claude_desktop_config.json 文件:

    • 对于 MacOS:打开目录 ~/Library/Application Support/Claude/ 并在其中创建文件
    • 对于 Windows:打开目录 %APPDATA%/Claude/ 并在其中创建文件
  2. 将此配置添加到 claude_desktop_config.json 中:

{
  "mcpServers": {
    "needle_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/needle-mcp",
        "run",
        "needle-mcp"
      ],
      "env": {
        "NEEDLE_API_KEY": "your_needle_api_key"
      }
    }
  }
}
  1. 从 needle.xyz 获取您的 Needle API 密钥

  2. 更新配置文件:

    • /path/to/needle-mcp 替换为您的实际仓库路径
    • 添加您的 Needle API 密钥
  3. 完全退出 Claude 并重新打开它

用法示例

  • "创建一个名为 'Technical Docs' 的新集合"
  • "将此文档添加到集合中,该文档是 https://needle-ai.com"
  • "在集合中搜索关于 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_mcp": {
      "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. 如果您仍然看到旧的配置:

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

相关 MCP 服务