needle mcp

Local 2025-08-31 23:25:41 0

A server that allows users to manage documents and perform Claude-powered searches using Needle through the Claude Desktop application.


Screenshot of Feature - Claude

MCP (Model Context Protocol) server to manage documents and perform searches using Needle through Claude’s Desktop Application.

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 Claudie Desktop and Needle collections.

Usage

Commands in Claudie Desktop

Below is an example of how the commands can be used in Claudie Desktop to interact with the server:

Using commands in Claudie Desktop

  1. Open Claudie Desktop and connect to the Needle MCP Server.
  2. Use simple text commands to search, retrieve, or modify documents.
  3. 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 Claudie Desktop, watch this YouTube explanation video.


Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/needle-mcp.git

  2. Install UV globally using Homebrew in Terminal:

    brew install uv

  3. Create claude_desktop_config.json:

  4. For MacOS: Open directory ~/Library/Application Support/Claude/ and create the file inside it
  5. For Windows: Open directory %APPDATA%/Claude/ and create the file inside it

  6. 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"
          }
        }
      }
    }

  7. Get your Needle API key from needle.xyz

  8. Update the config file:

  9. Replace /path/to/needle-mcp with your actual repository path
  10. Add your Needle API key

  11. 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 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

Reset Claude Desktop Configuration

If you're seeing old configurations or the integration isn't working:

  1. Find all Claude Desktop config files:

    find / -name "claude_desktop_config.json" 2>/dev/null

  2. Remove all Claude Desktop data:

  3. On MacOS: rm -rf ~/Library/Application Support/Claude/*
  4. On Windows: Delete contents of %APPDATA%/Claude/

  5. 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

  6. Completely quit Claude Desktop (Command+Q on Mac) and relaunch it

  7. If you still see old configurations:

  8. Check for additional config files in other locations
  9. Try clearing browser cache if using web version
  10. Verify the config file is being read from the correct location
[
  {
    "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"
  }
]