
SearXNG
STDIOHTTP-SSEWeb search MCP server integrating SearXNG API for comprehensive web queries
Web search MCP server integrating SearXNG API for comprehensive web queries
An MCP server implementation that integrates the SearXNG API, providing web search capabilities.
searxng_web_search
query
(string): The search query. This string is passed to external search services.pageno
(number, optional): Search page number, starts at 1 (default 1)time_range
(string, optional): Filter results by time range - one of: "day", "month", "year" (default: none)language
(string, optional): Language code for results (e.g., "en", "fr", "de") or "all" (default: "all")safesearch
(number, optional): Safe search filter level (0: None, 1: Moderate, 2: Strict) (default: instance setting)web_url_read
url
(string): The URL to fetch and processThe SEARXNG_URL
environment variable defines which SearxNG instance to connect to.
SEARXNG_URL=<protocol>://<hostname>[:<port>]
# Local development (default) SEARXNG_URL=http://localhost:8080 # Public instance SEARXNG_URL=https://search.example.com # Custom port SEARXNG_URL=http://my-searxng.local:3000
SEARXNG_URL
environment variable to the complete instance URLhttp://localhost:8080
will be usedIf you are using a password protected SearxNG instance you can set a username and password for HTTP Basic Auth:
AUTH_USERNAME
environment variable to your usernameAUTH_PASSWORD
environment variable to your passwordNote: Authentication is only required for password-protected SearxNG instances. See the usage examples below for how to configure authentication with different installation methods.
The server supports HTTP and HTTPS proxies through environment variables. This is useful when running behind corporate firewalls or when you need to route traffic through a specific proxy server.
Set one or more of these environment variables to configure proxy support:
HTTP_PROXY
: Proxy URL for HTTP requestsHTTPS_PROXY
: Proxy URL for HTTPS requestshttp_proxy
: Alternative lowercase version for HTTP requestshttps_proxy
: Alternative lowercase version for HTTPS requestsThe proxy URL can be in any of these formats:
# Basic proxy export HTTP_PROXY=http://proxy.company.com:8080 export HTTPS_PROXY=http://proxy.company.com:8080 # Proxy with authentication export HTTP_PROXY=http://username:[email protected]:8080 export HTTPS_PROXY=http://username:[email protected]:8080
Note: If no proxy environment variables are set, the server will make direct connections as normal. See the usage examples below for how to configure proxy settings with different installation methods.
{ "mcpServers": { "searxng": { "command": "npx", "args": ["-y", "mcp-searxng"], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL" } } } }
{ "mcpServers": { "searxng": { "command": "npx", "args": ["-y", "mcp-searxng"], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password" } } } }
{ "mcpServers": { "searxng": { "command": "npx", "args": ["-y", "mcp-searxng"], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
{ "mcpServers": { "searxng": { "command": "npx", "args": ["-y", "mcp-searxng"], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
npm install -g mcp-searxng
{ "mcpServers": { "searxng": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL" } } } }
{ "mcpServers": { "searxng": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password" } } } }
{ "mcpServers": { "searxng": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
{ "mcpServers": { "searxng": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
docker pull isokoliuk/mcp-searxng:latest
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "isokoliuk/mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL" } } } }
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "-e", "AUTH_USERNAME", "-e", "AUTH_PASSWORD", "isokoliuk/mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password" } } } }
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "-e", "HTTP_PROXY", "-e", "HTTPS_PROXY", "isokoliuk/mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "-e", "AUTH_USERNAME", "-e", "AUTH_PASSWORD", "-e", "HTTP_PROXY", "-e", "HTTPS_PROXY", "isokoliuk/mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
docker build -t mcp-searxng:latest -f Dockerfile .
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL" } } } }
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "-e", "AUTH_USERNAME", "-e", "AUTH_PASSWORD", "mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password" } } } }
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "-e", "HTTP_PROXY", "-e", "HTTPS_PROXY", "mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
{ "mcpServers": { "searxng": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "SEARXNG_URL", "-e", "AUTH_USERNAME", "-e", "AUTH_PASSWORD", "-e", "HTTP_PROXY", "-e", "HTTPS_PROXY", "mcp-searxng:latest" ], "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
The server supports both STDIO (default) and HTTP transports:
MCP_HTTP_PORT
environment variable{ "mcpServers": { "searxng-http": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "MCP_HTTP_PORT": "3000" } } } }
{ "mcpServers": { "searxng-http": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "MCP_HTTP_PORT": "3000", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password" } } } }
{ "mcpServers": { "searxng-http": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "MCP_HTTP_PORT": "3000", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
{ "mcpServers": { "searxng-http": { "command": "mcp-searxng", "env": { "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL", "MCP_HTTP_PORT": "3000", "AUTH_USERNAME": "your_username", "AUTH_PASSWORD": "your_password", "HTTP_PROXY": "http://proxy.company.com:8080", "HTTPS_PROXY": "http://proxy.company.com:8080" } } } }
HTTP Endpoints:
POST/GET/DELETE /mcp
GET /health
Testing HTTP Server:
# Start HTTP server MCP_HTTP_PORT=3000 SEARXNG_URL=http://localhost:8080 mcp-searxng # Check health curl http://localhost:3000/health
The evals package loads an mcp client that then runs the src/index.ts file, so there is no need to rebuild between tests. You can see the full documentation here.
SEARXNG_URL=SEARXNG_URL OPENAI_API_KEY=your-key npx mcp-eval evals.ts src/index.ts
We welcome contributions! Here's how to get started:
# Fork the repository on GitHub, then clone your fork git clone https://github.com/YOUR_USERNAME/mcp-searxng.git cd mcp-searxng # Add the original repository as upstream git remote add upstream https://github.com/ihor-sokoliuk/mcp-searxng.git
# Install dependencies npm install # Start development with file watching npm run watch
Create a feature branch:
git checkout -b feature/your-feature-name
Make your changes in src/
directory
src/index.ts
src/error-handler.ts
Build and test:
npm run build # Build the project npm test # Run unit tests npm run test:coverage # Run tests with coverage report npm run inspector # Run MCP inspector
Run evals to ensure functionality:
SEARXNG_URL=http://localhost:8080 OPENAI_API_KEY=your-key npx mcp-eval evals.ts src/index.ts
# Commit your changes git add . git commit -m "feat: description of your changes" # Push to your fork git push origin feature/your-feature-name # Create a Pull Request on GitHub
The project includes comprehensive unit tests with excellent coverage.
# Run all tests npm test # Run with coverage reporting npm run test:coverage # Watch mode for development npm run test:watch
coverage/
directoryThis MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.