needle mcp
A server that allows users to manage documents and perform Claude-powered searches using Needle through the Claude Desktop application.
A server that allows users to manage documents and perform Claude-powered searches using Needle through the Claude Desktop application.
MCP (Model Context Protocol) server to manage documents and perform searches using Needle through Claude’s Desktop Application.
Needle MCP Server allows you to:
Below is an example of how the commands can be used in Claudie Desktop to interact with the server:
https://github.com/user-attachments/assets/0235e893-af96-4920-8364-1e86f73b3e6c
For a full walkthrough on using the Needle MCP Server with Claude and Claudie Desktop, watch this YouTube explanation video.
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:
~/Library/Application Support/Claude/
and create the file inside itFor Windows: Open directory %APPDATA%/Claude/
and create the file inside it
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:
/path/to/needle-mcp
with your actual repository pathAdd your Needle API key
Quit Claude completely and reopen it
If not working:
- Make sure UV is installed globally (if not, uninstall with pip uninstall uv
and reinstall with brew 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
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:
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:
[
{
"description": "Retrieve a complete list of all Needle document collections accessible to your account. n Returns detailed information including collection IDs, names, and creation dates. Use this tool when you need to:n - Get an overview of available document collectionsn - Find collection IDs for subsequent operationsn - Verify collection existence before performing operationsn The response includes metadata that's required for other Needle operations.",
"inputSchema": {
"properties": {},
"required": [],
"type": "object"
},
"name": "needle_list_collections"
},
{
"description": "Create a new document collection in Needle for organizing and searching documents. n A collection acts as a container for related documents and enables semantic search across its contents.n Use this tool when you need to:n - Start a new document organizationn - Group related documents togethern - Set up a searchable document repositoryn Returns a collection ID that's required for subsequent operations. Choose a descriptive name that n reflects the collection's purpose for better organization.",
"inputSchema": {
"properties": {
"name": {
"description": "A clear, descriptive name for the collection that reflects its purpose and contents",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"name": "needle_create_collection"
},
{
"description": "Fetch comprehensive metadata about a specific Needle collection. n Provides detailed information about the collection's configuration, creation date, and current status.n Use this tool when you need to:n - Verify a collection's existence and configurationn - Check collection metadata before operationsn - Get creation date and other attributesn Requires a valid collection ID and returns detailed collection metadata. Will error if collection doesn't exist.",
"inputSchema": {
"properties": {
"collection_id": {
"description": "The unique collection identifier returned from needle_create_collection or needle_list_collections",
"type": "string"
}
},
"required": [
"collection_id"
],
"type": "object"
},
"name": "needle_get_collection_details"
},
{
"description": "Retrieve detailed statistical information about a Needle collection's contents and status.n Provides metrics including:n - Total number of documentsn - Processing status of documentsn - Storage usage and limitsn - Index status and healthn Use this tool to:n - Monitor collection size and growthn - Verify processing completionn - Check collection health before operationsn Essential for ensuring collection readiness before performing searches.",
"inputSchema": {
"properties": {
"collection_id": {
"description": "The unique collection identifier to get statistics for",
"type": "string"
}
},
"required": [
"collection_id"
],
"type": "object"
},
"name": "needle_get_collection_stats"
},
{
"description": "List all documents stored within a specific Needle collection with their current status.n Returns detailed information about each file including:n - File ID and namen - Processing status (pending, processing, complete, error)n - Upload date and metadatan Use this tool when you need to:n - Inventory available documentsn - Check processing status of uploadsn - Get file IDs for referencen - Verify document availability before searchingn Essential for monitoring document processing completion before performing searches.",
"inputSchema": {
"properties": {
"collection_id": {
"description": "The unique collection identifier to list files from",
"type": "string"
}
},
"required": [
"collection_id"
],
"type": "object"
},
"name": "needle_list_files"
},
{
"description": "Add a new document to a Needle collection by providing a URL for download.n Supports multiple file formats including:n - PDF documentsn - Microsoft Word files (DOC, DOCX)n - Plain text files (TXT)n - Web pages (HTML)n n The document will be:n 1. Downloaded from the provided URLn 2. Processed for text extractionn 3. Indexed for semantic searchn n Use this tool when you need to:n - Add new documents to a collectionn - Make documents searchablen - Expand your knowledge basen n Important: Documents require processing time before they're searchable.n Check processing status using needle_list_files before searching new content.",
"inputSchema": {
"properties": {
"collection_id": {
"description": "The unique collection identifier where the file will be added",
"type": "string"
},
"name": {
"description": "A descriptive filename that will help identify this document in results",
"type": "string"
},
"url": {
"description": "Public URL where the document can be downloaded from",
"type": "string"
}
},
"required": [
"collection_id",
"name",
"url"
],
"type": "object"
},
"name": "needle_add_file"
},
{
"description": "Perform intelligent semantic search across documents in a Needle collection.n This tool uses advanced embedding technology to find relevant content based on meaning,n not just keywords. The search:n - Understands natural language queriesn - Finds conceptually related contentn - Returns relevant text passages with source informationn - Ranks results by semantic relevancen n Use this tool when you need to:n - Find specific information within documentsn - Answer questions from document contentn - Research topics across multiple documentsn - Locate relevant passages and their sourcesn n More effective than traditional keyword search for:n - Natural language questionsn - Conceptual queriesn - Finding related contentn n Returns matching text passages with their source file IDs.",
"inputSchema": {
"properties": {
"collection_id": {
"description": "The unique collection identifier to search within",
"type": "string"
},
"query": {
"description": "Natural language query describing the information you're looking for",
"type": "string"
}
},
"required": [
"collection_id",
"query"
],
"type": "object"
},
"name": "needle_search"
}
]