SearXNG MCP server

Enables language models to perform web searches through SearXNG, a privacy-focused metasearch engine, with customizable parameters like categories, time ranges, and pagination.
Back to servers
Provider
aeon-seraph
Release date
Mar 08, 2025
Language
TypeScript
Stats
1 star

The SearXNG Model Context Protocol (MCP) server enables language models to perform web searches through SearXNG using the Model Context Protocol standard. It provides a straightforward interface for language models to send search queries to SearXNG and receive properly formatted results.

Installation Requirements

Setting Up the Server

# Clone the repository
git clone https://github.com/aeon-seraph/searxng-mcp.git
cd searxng-mcp

# Install dependencies
npm install

# Build the project
npm run build

Running the Server

The basic command to start the server:

node build/index.js

The server runs on stdio, making it compatible with MCP-enabled language models.

Configuration Options

You can customize the server behavior using environment variables:

Variable Description Default
SEARXNG_PROTOCOL Protocol to use (http/https) http
SEARXNG_HOST SearXNG host localhost
SEARXNG_PORT SearXNG port 8888
CACHE_TTL Cache time-to-live in milliseconds 600000 (10 minutes)
MAX_CACHE_SIZE Maximum number of cached queries 100

Example with Custom Configuration

SEARXNG_HOST=mysearx.example.com SEARXNG_PORT=443 SEARXNG_PROTOCOL=https node build/index.js

Docker Deployment

For containerized deployment, use the included Dockerfile:

# Build the Docker image
docker build -t searxng-mcp .

# Run the container with custom settings
docker run -e SEARXNG_HOST=mysearx.example.com -e SEARXNG_PROTOCOL=https searxng-mcp

Search Parameters

When using the search functionality, the following parameters are available:

  • query (required): The search query string
  • categories: Comma-separated list of search categories
  • pageno: Search page number (default: 1)
  • time_range: Time range for results ("day", "week", "month", "year")
  • raw_json: Return raw JSON response instead of formatted text (default: false)

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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