The SearXNG MCP server allows AI assistants to search the web through a SearXNG instance using the Model Control Protocol (MCP). It enables web searching via simple API calls and provides access to SearXNG's search capabilities and configuration options.
You can quickly get started with the SearXNG MCP server using Docker:
# Build the Docker image
docker build -t searxng-mcp-server .
# Run the container
# Replace https://searxng.example.com with your actual SearXNG instance URL
docker run -p 8080:8080 searxng-mcp-server
If you prefer to run the server directly with Python:
# Requirements:
# - Python 3.11+
# - uv (Python package manager)
# Install dependencies
uv sync
# Run the server
uv run server.py --url https://searxng.example.com
To add the SearXNG MCP server to your MCP configuration, include the following in your config file:
"searxng-mcp-server": {
"command": "uv",
"args": [
"run",
"https://raw.githubusercontent.com/maccam912/searxng-mcp-server/refs/heads/main/server.py",
"--url",
"https://searxng.example.com"
]
}
Be sure to replace https://searxng.example.com
with the URL of your SearXNG instance.
The search function allows you to query SearXNG with various parameters:
def search(query: str, categories: Optional[str] = None, engines: Optional[str] = None,
language: Optional[str] = None, page: int = 1, time_range: Optional[str] = None,
safe_search: int = 1)
Parameters:
query
: Your search termcategories
: Filter by categories (comma-separated)engines
: Specific search engines to use (comma-separated)language
: Language code for resultspage
: Result page numbertime_range
: Time period for resultssafe_search
: Safe search level (0-2)To get information about what search engines are available:
def get_available_engines()
This function returns a list of search engines that can be used with the SearXNG instance.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "searxng-mcp-server" '{"command":"uv","args":["run","https://raw.githubusercontent.com/maccam912/searxng-mcp-server/refs/heads/main/server.py","--url","https://searxng.example.com"]}'
See the official Claude Code MCP documentation for more details.
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.
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": {
"searxng-mcp-server": {
"command": "uv",
"args": [
"run",
"https://raw.githubusercontent.com/maccam912/searxng-mcp-server/refs/heads/main/server.py",
"--url",
"https://searxng.example.com"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"searxng-mcp-server": {
"command": "uv",
"args": [
"run",
"https://raw.githubusercontent.com/maccam912/searxng-mcp-server/refs/heads/main/server.py",
"--url",
"https://searxng.example.com"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect