Needle Mcpサーバーでエージェントを構築する
概要
Needle-MCPとは?
Needle-MCPは、Model Context Protocol(MCP)内でNeedleフレームワークを革新的に統合したものです。このリポジトリは、Needleの機能をプロジェクトに活用したい開発者や研究者のための公共リソースとして機能します。Needleフレームワークは、モデルのパフォーマンスを向上させ、開発プロセスを効率化するように設計されており、機械学習やAIアプリケーションにとって貴重なツールです。
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をModel Context Protocol内に統合することで、モデルのパフォーマンスを向上させるための堅牢なフレームワークを開発者に提供することを目的としています。
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"
}
}
}
}