使用 Needle Mcp 伺服器建立代理人
概覽
什麼是 Needle-MCP?
Needle-MCP 是 Needle 框架與模型上下文協議(MCP)之間的創新整合。這個存儲庫作為開發者和研究人員的公共資源,旨在利用 Needle 的能力來進行項目開發。Needle 框架旨在提升模型性能並簡化開發過程,使其成為機器學習和人工智慧應用的寶貴工具。
Needle-MCP 的特點
- 無縫整合:Needle-MCP 允許將 Needle 框架輕鬆整合到現有項目中,促進開發者的工作流程。
- 性能提升:通過利用 Needle,用戶可以期待模型性能的改善,從而實現更準確的預測和更好的整體結果。
- 公共存儲庫:作為一個公共存儲庫,Needle-MCP 鼓勵社區的合作與貢獻,促進創新和知識共享。
- 文檔與支持:提供全面的文檔,以指導用戶安裝和使用 Needle-MCP,確保開發者能夠快速入門。
如何使用 Needle-MCP
- 克隆存儲庫:首先使用 Git 將 Needle-MCP 存儲庫克隆到本地機器。
git clone https://github.com/needle-ai/needle-mcp.git
- 安裝依賴項:導航到克隆的目錄並安裝必要的依賴項。
cd needle-mcp pip install -r requirements.txt
- 與您的模型整合:按照提供的文檔將 Needle 整合到您的模型上下文中。這可能涉及修改您的模型代碼,以有效利用 Needle 的功能。
- 運行您的模型:整合後,像往常一樣運行您的模型,並觀察 Needle 帶來的性能提升。
常見問題解答
Needle-MCP 的目的是什么?
Needle-MCP 旨在為開發者提供一個強大的框架,通過在模型上下文協議中整合 Needle 來提升模型性能。
Needle-MCP 適合所有類型的模型嗎?
是的,Needle-MCP 設計得非常靈活,可以與各種類型的機器學習模型整合,適用於廣泛的應用。
我該如何為 Needle-MCP 做出貢獻?
歡迎貢獻!您可以通過在 GitHub 存儲庫上提交問題、功能請求或拉取請求來貢獻。鼓勵合作以進一步改善框架。
我在哪裡可以找到 Needle-MCP 的文檔?
文檔通常在存儲庫內部提供,通常在 docs
文件夾或作為 README 文件。它提供了安裝、使用和示例的詳細說明。
Needle-MCP 使用什麼許可證?
Needle-MCP 採用 MIT 許可證,允許個人和商業使用,前提是給予適當的歸屬。
詳細
Build Agents with Needle MCP Server
MCP (Model Context Protocol) server to manage documents and perform searches using Needle through Claude’s Desktop Application.
<a href="https://glama.ai/mcp/servers/5jw1t7hur2"> <img width="380" height="200" src="https://glama.ai/mcp/servers/5jw1t7hur2/badge" alt="Needle Server MCP server" /> </a>Table of Contents
Overview
Needle MCP Server allows you to:
- Organize and store documents for quick retrieval.
- Perform powerful searches via Claude’s large language model.
- Integrate seamlessly with the Needle ecosystem for advanced document management.
Features
- Document Management: Easily add and organize documents on the server.
- Search & Retrieval: Claude-based natural language search for quick answers.
- Easy Integration: Works with Claude Desktop and Needle collections.
Usage
Commands in Claude Desktop
Below is an example of how the commands can be used in Claude Desktop to interact with the server:
- Open Claude Desktop and connect to the Needle MCP Server.
- Use simple text commands to search, retrieve, or modify documents.
- Review search results returned by Claude in a user-friendly interface.
Result in Needle
https://github.com/user-attachments/assets/0235e893-af96-4920-8364-1e86f73b3e6c
Youtube Video Explanation
For a full walkthrough on using the Needle MCP Server with Claude and Claude Desktop, watch this YouTube explanation video.
Installation
Installing via Smithery
To install Needle MCP for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install needle-mcp --client claude
Manual Installation
- Clone the repository:
git clone https://github.com/yourusername/needle-mcp.git
- Install UV globally using Homebrew in Terminal:
brew install uv
-
Create claude_desktop_config.json:
- For MacOS: Open directory
~/Library/Application Support/Claude/
and create the file inside it - For Windows: Open directory
%APPDATA%/Claude/
and create the file inside it
- For MacOS: Open directory
-
Add this configuration to 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"
}
}
}
}
-
Get your Needle API key from needle.xyz
-
Update the config file:
- Replace
/path/to/needle-mcp
with your actual repository path - Add your Needle API key
- Replace
-
Quit Claude completely and reopen it
Usage Examples
- "Create a new collection called 'Technical Docs'"
- "Add this document to the collection, which is https://needle-ai.com"
- "Search the collection for information about AI"
- "List all my collections"
Troubleshooting
If not working:
- Make sure UV is installed globally (if not, uninstall with
pip uninstall uv
and reinstall withbrew install uv
) - Or find UV path with
which uv
and replace"command": "uv"
with the full path - Verify your Needle API key is correct
- Check if the needle-mcp path in config matches your actual repository location
Reset Claude Desktop Configuration
If you're seeing old configurations or the integration isn't working:
- Find all Claude Desktop config files:
find / -name "claude_desktop_config.json" 2>/dev/null
- Remove all Claude Desktop data:
- On MacOS:
rm -rf ~/Library/Application\ Support/Claude/*
- On Windows: Delete contents of
%APPDATA%/Claude/
- Create a fresh config with only 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
-
Completely quit Claude Desktop (Command+Q on Mac) and relaunch it
-
If you still see old configurations:
- Check for additional config files in other locations
- Try clearing browser cache if using web version
- Verify the config file is being read from the correct location
伺服器配置
{
"mcpServers": {
"needle-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--needle-ai--needle-mcp--needle-mcp",
"needle-mcp"
],
"env": {
"NEEDLE_API_KEY": "needle-api-key"
}
}
}
}