SearXNG MCP Server
Provides privacy-focused web search through a SearXNG instance, supporting categories, language filters, time ranges, and configurable result limits.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SearXNG MCP Server
A Model Context Protocol (MCP) server that provides privacy-focused web search capabilities through SearXNG, a free metasearch engine. This server enables Claude Desktop and Claude Code to perform web searches while maintaining user privacy.
Features
Privacy-Focused Search: Leverages SearXNG for anonymous, tracker-free web searches
Advanced Search Parameters: Support for categories, language filters, and time ranges
MCP Integration: Seamlessly integrates with Claude Desktop and Claude Code
Async Architecture: Built with async/await for non-blocking, efficient operations
Type Safety: Full type hints and Pydantic models for robust data validation
Configurable: Environment-based configuration for flexible deployment
Local SearXNG Instance: Uses Docker to run SearXNG locally for complete privacy control
Related MCP server: Web Explorer MCP
Prerequisites
Before installing, ensure you have:
Python 3.13+ - Download Python
uv - Fast Python package installer and resolver
# Install uv (macOS/Linux) curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv (Windows) powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Docker - Required for running SearXNG locally
Docker Desktop (Windows/macOS)
Docker Engine (Linux)
Installation
1. Clone the Repository
git clone https://github.com/Basti-Fantasti/searXNG-mcp-server.git
cd searxng-mcp-server2. Install Dependencies
# Install dependencies using uv
uv sync
# This will create a virtual environment and install all required packages3. Configure Environment (Optional)
Create a .env file to customize configuration:
# .env
SEARXNG_BASE_URL=http://localhost:9999
SEARXNG_TIMEOUT=10
LOG_LEVEL=INFO
MAX_RESULTS_LIMIT=50Configuration Options:
Variable | Description | Default |
| Base URL of your SearXNG instance |
|
| Request timeout in seconds |
|
| Logging verbosity (DEBUG/INFO/WARNING/ERROR/CRITICAL) |
|
| Maximum results allowed per query |
|
SearXNG Docker Setup
The server requires a running SearXNG instance. Use Docker Compose for easy setup:
1. Start SearXNG
# Start SearXNG container in detached mode
docker-compose up -dThis will:
Pull the official SearXNG Docker image
Start SearXNG on port 9999 (mapped from container port 8080)
Mount the
searxng-settings.ymlconfiguration file
2. Verify SearXNG is Running
# Check container status
docker ps | grep searxng
# Test SearXNG API
curl "http://localhost:9999/search?q=test&format=json"3. Stop SearXNG
# Stop the container
docker-compose down4. View Logs
# View SearXNG logs
docker logs searxng
# Follow logs in real-time
docker logs -f searxngClaude Code Configuration
To use this MCP server with Claude Code, add it to your MCP configuration:
Global Configuration (All Projects)
Edit ~/.claude/mcp.json:
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/searxng-mcp-server",
"run",
"searxng-mcp"
],
"env": {
"SEARXNG_BASE_URL": "http://localhost:9999"
}
}
}
}Project-Level Configuration
Create .claude/mcp.json in your project root:
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/searxng-mcp-server",
"run",
"searxng-mcp"
],
"env": {
"SEARXNG_BASE_URL": "http://localhost:9999"
}
}
}
}Windows Path Example
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": [
"--directory",
"C:\\absolute\\path\\to\\searxng-mcp-server",
"run",
"searxng-mcp"
],
"env": {
"SEARXNG_BASE_URL": "http://localhost:9999"
}
}
}
}Important Notes:
Use absolute paths, not relative paths
Restart Claude Code after modifying the configuration
Ensure SearXNG is running before using the search tool
Claude Desktop Configuration
To use this MCP server with Claude Desktop, add it to your configuration file:
macOS/Linux
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/searxng-mcp-server",
"run",
"searxng-mcp"
],
"env": {
"SEARXNG_BASE_URL": "http://localhost:9999"
}
}
}
}Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"searxng": {
"command": "uv",
"args": [
"--directory",
"C:\\absolute\\path\\to\\searxng-mcp-server",
"run",
"searxng-mcp"
],
"env": {
"SEARXNG_BASE_URL": "http://localhost:9999"
}
}
}
}Important Notes:
Use absolute paths, not relative paths
Restart Claude Desktop after modifying the configuration
Ensure SearXNG is running before starting Claude Desktop
Usage Examples
Once configured, you can use the web_search tool in Claude Desktop or Claude Code:
Basic Search
Search for "Python async programming tutorials"Search with Maximum Results
Search for "machine learning news" and return up to 20 resultsCategory-Specific Search
Search for "climate change" in the science and news categoriesAvailable categories:
general- General web searchnews- News articlesimages- Image searchvideos- Video contentfiles- File downloadsscience- Scientific papers and resourcesmap- Maps and locationsmusic- Music contentit- IT and tech resources
Language-Specific Search
Search for "recettes françaises" in FrenchUse ISO 639-1 language codes: en, de, fr, es, it, pt, ru, zh, ja, etc.
Time-Range Filtered Search
Search for "AI breakthroughs" from the past weekAvailable time ranges:
day- Past 24 hoursweek- Past 7 daysmonth- Past 30 daysyear- Past year
Combined Advanced Search
Search for "renewable energy" in English, in science and news categories, from the past month, limit to 15 resultsTroubleshooting
SearXNG Connection Issues
Problem: Failed to connect to SearXNG
Solutions:
Verify SearXNG is running:
docker ps | grep searxngCheck the URL is correct:
curl http://localhost:9999/search?q=test&format=jsonEnsure the port (9999) matches your
docker-compose.yamland configurationCheck Docker is running:
docker info
Timeout Errors
Problem: Search request timed out
Solutions:
Increase timeout in
.env:SEARXNG_TIMEOUT=30Check SearXNG performance:
docker logs searxngRestart SearXNG container:
docker-compose restart
Claude Desktop Not Finding the Server
Problem: MCP server not showing up in Claude Desktop
Solutions:
Verify you're using absolute paths in the configuration
Check the path exists:
ls /absolute/path/to/searxng-mcp-serverRestart Claude Desktop completely
Check Claude Desktop logs for errors
Permission Errors on Windows
Problem: Permission denied when running uv or accessing files
Solutions:
Run terminal as Administrator
Check file permissions in the project directory
Ensure your antivirus isn't blocking uv or Python
No Search Results Returned
Problem: Search returns empty results
Solutions:
Test SearXNG directly:
curl "http://localhost:9999/search?q=test&format=json"Check SearXNG settings in
searxng-settings.ymlVerify search engines are enabled in SearXNG
Try a different query or remove filters
Development Setup
Install Development Dependencies
# Install dev dependencies
uv sync --devThis installs additional tools:
pytest- Testing frameworkpytest-asyncio- Async test supportpytest-cov- Coverage reportingmypy- Static type checkerruff- Fast Python linter and formatter
Running Tests
# Run all tests
uv run pytest
# Run with coverage report
uv run pytest --cov=src/searxng_mcp --cov-report=html
# Run specific test file
uv run pytest tests/test_server.py
# Run with verbose output
uv run pytest -v
# Run async tests
uv run pytest -v tests/test_searxng_client.pyCoverage reports are generated in htmlcov/index.html.
Code Quality Checks
# Run linter
uv run ruff check .
# Auto-fix linting issues
uv run ruff check --fix .
# Format code
uv run ruff format .
# Type checking
uv run mypy src/searxng_mcpRunning the Server Locally
# Run the MCP server
uv run searxng-mcpThe server uses stdio transport and expects MCP protocol messages on stdin.
Project Structure
searxng-mcp-server/
├── src/
│ └── searxng_mcp/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Entry point
│ ├── server.py # MCP server implementation
│ ├── searxng_client.py # SearXNG HTTP client
│ ├── config.py # Configuration management
│ └── models.py # Pydantic data models
├── tests/
│ ├── test_server.py # Server tests
│ ├── test_searxng_client.py # Client tests
│ └── test_config.py # Config tests
├── docker-compose.yaml # SearXNG container config
├── searxng-settings.yml # SearXNG configuration
├── pyproject.toml # Project metadata and dependencies
├── CLAUDE.md # Claude Code project guide
└── README.md # This fileContributing
Contributions are welcome! Here's how to contribute:
1. Fork and Clone
git clone <YOUR_REPO_URL>.git
cd searxng-mcp-server2. Create a Feature Branch
git checkout -b feature/your-feature-name3. Make Your Changes
Follow existing code style (enforced by Ruff)
Add tests for new features
Update documentation as needed
Ensure all tests pass:
uv run pytestRun linting:
uv run ruff check .Run type checking:
uv run mypy src/searxng_mcp
4. Commit Your Changes
git add .
git commit -m "Add your descriptive commit message"Use conventional commit messages:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changestest:- Test additions or changesrefactor:- Code refactoringchore:- Maintenance tasks
5. Push and Create Pull Request
git push origin feature/your-feature-nameThen create a Pull Request on GitHub with:
Clear description of changes
Reference any related issues
Screenshots/examples if applicable
Code Review Process
All PRs require passing tests
Code must pass linting and type checking
At least one maintainer approval required
Documentation must be updated for user-facing changes
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
SearXNG - The privacy-respecting metasearch engine
Model Context Protocol - The protocol enabling AI tool integration
Anthropic - For Claude and the MCP SDK
Support
Issues: [GitHub Issues](<YOUR_REPO_URL>/issues)
Discussions: [GitHub Discussions](<YOUR_REPO_URL>/discussions)
SearXNG Documentation: docs.searxng.org
MCP Documentation: modelcontextprotocol.io/docs
Built with privacy in mind. Search freely.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Scrape, map, crawl, search and monitor the web. Runs locally with no API key, cites every source.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables local semantic search over documents and code for Claude Code and Claude Desktop, running entirely offline with local embeddings and vector storage.147MIT
- AlicenseAqualityDmaintenanceEnables private web search and webpage content extraction using a local SearxNG instance, prioritizing user privacy and autonomy.22MIT
- AlicenseAqualityBmaintenanceEnables privacy-friendly web searches through the SearXNG engine, with support for multiple engines, categories, languages, time ranges, and configurable result counts.1469 PyPI1AGPL 3.0
- AlicenseAqualityCmaintenanceAdds web search to Claude Desktop through a user-selected SearXNG instance, with engine and category selection, language and time-range filters, and bounded result counts.1AGPL 3.0