Needle MCP server

Bridges Needle AI platform with MCP servers to enable advanced natural language processing and machine learning capabilities.
Back to servers
Setup instructions
Provider
Jan Heimes
Release date
Dec 21, 2024
Language
Python
Stats
71 stars

Needle MCP Server is a tool that allows you to organize documents and perform powerful searches using Needle through Claude's Desktop Application. It acts as a bridge between large language models and your document collections, making information in various file formats (PDFs, DOCX, XLSX) easily accessible.

Installation Options

Remote MCP Server (Recommended)

This option requires no local setup - just configuration in your Claude Desktop.

Claude Desktop Configuration

Create or update your config file:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "needle": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.needle.app/mcp",
        "--header",
        "Authorization:Bearer ${NEEDLE_API_KEY}"
      ],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}

Cursor Configuration

Create or update .cursor/mcp.json:

{
  "mcpServers": {
    "needle": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.needle.app/mcp",
        "--header",
        "Authorization:${NEEDLE_AUTH_HEADER}"
      ],
      "env": {
        "NEEDLE_AUTH_HEADER": "Bearer <your-needle-api-key>"
      }
    }
  }
}

You'll need to get your API key from Needle Settings.

Local Installation

  1. Clone the repository:
git clone https://github.com/needle-ai/needle-mcp.git
  1. Install UV globally using Homebrew:
brew install uv
  1. Create your config file in the appropriate location (see above)

Claude Desktop Configuration

{
  "mcpServers": {
    "needle": {
      "command": "uv",
      "args": ["--directory", "/path/to/needle-mcp", "run", "needle-mcp"],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}

Cursor Configuration

{
  "mcpServers": {
    "needle": {
      "command": "uv",
      "args": ["--directory", "/path/to/needle-mcp", "run", "needle-mcp"],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}
  1. Replace /path/to/needle-mcp with your actual repository path
  2. Add your Needle API key
  3. Restart Claude Desktop

Docker Installation

  1. Clone and build:
git clone https://github.com/needle-ai/needle-mcp.git
cd needle-mcp
docker build -t needle-mcp .
  1. Add to your Claude Desktop config:
{
  "mcpServers": {
    "needle": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "needle-mcp"],
      "env": {
        "NEEDLE_API_KEY": "<your-needle-api-key>"
      }
    }
  }
}
  1. Restart Claude Desktop

Using Needle MCP Server

Once connected, you can use simple text commands in Claude Desktop to manage your documents:

Basic Commands

  • "Create a new collection called 'Technical Docs'"
  • "Add this document to the collection, which is https://needle.app"
  • "Search the collection for information about AI"
  • "List all my collections"

Workflow

  1. Open Claude Desktop and connect to the Needle MCP Server
  2. Use text commands to create collections and add documents
  3. Perform natural language searches to retrieve information
  4. Review search results returned by Claude

Troubleshooting

If the integration isn't working:

  • Ensure uv is installed globally (if using local installation)
  • Verify your Needle API key is correct
  • Check if the needle-mcp path in config matches your actual repository location

Resetting Claude Desktop Configuration

If you're having persistent issues:

  1. Find all Claude Desktop config files:
find / -name "claude_desktop_config.json" 2>/dev/null
  1. Remove all Claude Desktop data:
# On MacOS
rm -rf ~/Library/Application\ Support/Claude/*

# On Windows
# Delete contents of %APPDATA%/Claude/
  1. Create a fresh config and restart Claude Desktop

For a complete walkthrough, you can watch the explanation video on YouTube.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "needle_mcp" '{"command":"uv","args":["--directory","/path/to/needle-mcp","run","needle-mcp"],"env":{"NEEDLE_API_KEY":"your_needle_api_key"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "needle_mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/needle-mcp",
                "run",
                "needle-mcp"
            ],
            "env": {
                "NEEDLE_API_KEY": "your_needle_api_key"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "needle_mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/needle-mcp",
                "run",
                "needle-mcp"
            ],
            "env": {
                "NEEDLE_API_KEY": "your_needle_api_key"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later