使用 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
Server配置
{
"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"
}
}
}
}