Skip to main content
Glama
LMilazzo

web-search-mcp

by LMilazzo

web-search-mcp

A Python MCP server that exposes a WebSearch tool backed by a self-hosted SearXNG instance — a free, private web search engine.

Replace Claude's default web search with your own private instance. No API keys, no rate limits, no third-party tracking.

Quick Start

1. Clone and start SearXNG

git clone https://github.com/<username>/web-search-mcp.git
cd web-search-mcp

2. I recommend using the SearXNG docker container method as this is a quick easy set up if you already have docker installed.

#Pull the image
docker pull searxng/searxng

# Start SearXNG in the background
docker compose -f infra/docker-compose.yml up -d

SearXNG will be available at http://localhost:8080. This can be configured in /infra/docker-compose.yml.

3. Add the MCP server to Claude Code

  • You may need to replace the mcp_server.py path with a complete path rather than project relative path for claude to find it properly.

uv sync
claude mcp add web-search -- uv run --with "mcp[cli]" mcp run "src/web_search_mcp/mcp_server.py"

That's it. Restart Claude Code and you'll have a WebSearch tool available in your conversations.

4. Use it

Ask Claude to perform WebSearch and return formatted results:

"What are the latest developments in quantum computing?"

Related MCP server: SearXNG MCP Server

Configuration

SearXNG URL

By default the tool connects to http://localhost:8080. If your SearXNG instance runs on a different port or host configured in docker-compose.yml:

  • You may need to replace the mcp_server.py path with a complete path rather than project relative path for claude to find it properly.

claude mcp add web-search \
  --env SEARXNG_BASE_URL="http://localhost:8080" \
  -- uv run --with "mcp[cli]" mcp run "src/web_search_mcp/mcp_server.py"

Search Engines

Edit infra/data/searxng/settings.yml to add or disable search engines:

engines:
  - name: google
    engine: google
  - name: wikipedia
    engine: wikipedia
  - name: duckduckgo
    engine: duckduckgo
  - name: bing
    engine: bing

Restart SearXNG after changes:

  • Note that occasional you may be timed out from certain search engines if you make very frequent requests, typically restarting your container resets these timers.

docker compose -f infra/docker-compose.yml restart

Stopping

docker compose -f infra/docker-compose.yml down

Claude Code (via MCP protocol) └── web-search-mcp (Python MCP server) └── SearXNG (self-hosted search frontend)


The MCP server registers a single `WebSearch` tool that calls SearXNG's JSON API and returns results as a markdown-formatted string. Claude Code reads the markdown and presents it to you as a normal response.

## Requirements

- [Docker](https://www.docker.com/) (for SearXNG)
- Python 3.14+ (for the MCP server)
- [uv](https://github.com/astral-sh/uv) (for dependency management)

## License

SearXNG is licensed under the GNU Affero General Public License v3. See [searxng/searxng](https://github.com/searxng/searxng) for details.
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Tools

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to perform privacy-respecting web searches through SearXNG, with support for multiple search engines, categories, and advanced filtering options.
    24
  • A
    license
    A
    quality
    D
    maintenance
    Enables web search, image search, and news search through a self-hosted SearXNG instance. Provides privacy-focused meta-search capabilities aggregating results from multiple search engines.
    3
    1
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables privacy-respecting web, image, video, and news searches through SearxNG metasearch engine, with options for URL fetching and time filtering.
    5

View all related MCP servers

Related MCP Connectors

  • Serper MCP — wraps the Serper Google Search API (serper.dev)

  • The best web search for your AI Agent

  • Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LMilazzo/FreeSearch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server