README
ยถ
web-search-mcp ๐ธ๏ธ
MCP server for intelligent web search โ no API keys required, with local AI-powered semantic analysis running on your machine.
๐ก Why This Exists & The Magic
When an AI assistant needs to find information on the web, the typical approach is wasteful:
โ BAD APPROACH (without web-search-mcp):
AI: "find me Go trends 2025"
โ AI invokes a search engine
โ AI reads ALL pages in full
โ AI loads MEGABYTES of text into context
โ Wastes tons of tokens analyzing everything
โ Expensive, slow, inefficient
With web-search-mcp the analysis happens locally:
โ
GOOD APPROACH (with web-search-mcp):
AI: "find me Go trends 2025"
โ web_search_analyze:
โโ DuckDuckGo โ 8 URLs (0 tokens)
โโ chromedp + readability โ clean text (0 tokens)
โโ Ollama embedding โ semantic ranking (0 tokens!)
โ AI gets: [{url, title, relevance: 66%, snippet}, ...]
โ AI PICKS only 1-2 best pages
โ AI reads ONLY their full text (few tokens)
โ Fast, cheap, intelligent
The killer feature: semantic analysis (comparing query meaning with page meaning) is done locally via Ollama โ it consumes zero AI API tokens! The AI receives a pre-ranked list and can decide which page to read without burning through kilobytes of garbage.
๐ Quick Start
1. Install dependencies
# Ollama + embedding model (required for semantic analysis)
ollama pull embeddinggemma:latest
ollama serve
# Chromium (for JavaScript-rendered pages, optional)
# Arch: sudo pacman -S chromium
# Ubuntu: sudo apt install chromium-browser
# macOS: brew install chromium
2. Build and run
git clone https://github.com/kirill-scherba/web-search-mcp
cd web-search-mcp
go build -o web-search-mcp .
# Start โ server listens on stdin/stdout for MCP
./web-search-mcp
3. Connect to an AI agent
Any MCP-capable agent can use this server: it speaks the standard stdio transport, so the only thing a client needs is a command to start and the name it should call it by. The settings file differs per client, the entry does not.
The entry itself (same everywhere, only the path changes):
{
"mcpServers": {
"web-search-mcp": {
"command": "/path/to/web-search-mcp",
"args": [],
"env": {},
"disabled": false
}
}
}
Cline
Paste the entry into the Cline MCP settings file, then press "Restart MCP Servers" in the Cline
panel (or reload the page). Optionally add the tool names to autoApprove so searches run without a
confirmation prompt:
"autoApprove": ["web_search", "web_search_analyze", "web_fetch", "web_semantic_search"]
Codex
Codex reads MCP servers from its own configuration and starts them the same way:
# ~/.codex/config.toml
[mcp_servers.web-search-mcp]
command = "/path/to/web-search-mcp"
args = []
Restart the session; the tools appear as web_search, web_search_analyze, web_fetch and
web_semantic_search.
Claude
Claude Desktop takes the same JSON entry in claude_desktop_config.json (Settings โ Developer โ Edit
Config), after which the application is restarted:
{
"mcpServers": {
"web-search-mcp": {
"command": "/path/to/web-search-mcp",
"args": []
}
}
}
On Linux and macOS the file lives at ~/Library/Application Support/Claude/ (macOS) or
~/.config/Claude/ (Linux), on Windows under %APPDATA%\Claude\.
Windows users: the command is the path to web-search-mcp.exe, and forward slashes or doubled
backslashes both work in JSON.
๐ฎ How to Use โ Examples
Just tell the AI what you need. The tools are invoked automatically:
๐ Simple URL Search
User: "find information about Go in 2025"
AI calls: web_search("Go 2025 trends", limit=8)
โ Gets: URL list + snippets
โ Shows: top 3 links with descriptions
๐ Smart Search with Semantic Ranking (saves tokens!)
User: "analyze what people are writing about Go trends"
AI calls: web_search_analyze("Go programming trends 2025", limit=8)
โ 1. DuckDuckGo โ fetches 8 URLs
โ 2. Downloads each page (in parallel!)
โ 3. Ollama embeds each page's text
โ 4. Ollama embeds the query
โ 5. Cosine similarity โ ranks by meaning
โ 6. Saves everything to DB for future searches
โ Returns: [{url, title, relevance: 66%, snippet}, ...]
AI: "Most relevant results:
1. Go Developer Survey 2025 โ 66% match
2. JetBrains Go Ecosystem โ 57%
3. GeeksForGeeks Future of Go โ 51%
Want me to read the first article in full?"
The magic: AI doesn't waste tokens analyzing all pages โ that work is done by local Ollama.
๐ Read Full Page Content
User: "open the developer survey article"
AI calls: web_fetch("https://go.dev/blog/survey2025")
โ Checks cache (if already fetched โ returns from DB)
โ If not: chromedp + readability โ clean text
โ Returns: full article text (18K chars)
โ AI reads it and answers your question
๐ Semantic Search Over Previously Indexed Content
User: "what was there about Go popularity?"
AI calls: web_semantic_search("Go popularity among developers")
โ Ollama embeds the query
โ Searches all stored chunks in DB
โ Returns: relevant text fragments with match %
AI: "From the Go Developer Survey 2025:
Go ranks in the top 5 languages by developer
satisfaction (relevance: 48%)"
๐ ๏ธ Tool Reference
| Tool | What it does | When to use |
|---|---|---|
web_search |
Searches DuckDuckGo, returns URL + snippet | Need a quick list of links |
web_search_analyze ๐ |
Search + fetch + semantic analysis | Primary tool! Saves tokens |
web_fetch |
Fetches page, renders JS, extracts text | Need full content of a specific page |
web_semantic_search |
Semantic search over indexed content | "What was there about X?" โ no need to re-google |
๐ฐ Why This Saves Tokens
Without web-search-mcp:
- AI โ search โ gets HTML result list
- AI โ reads first result (full HTML)
- AI โ if wrong, reads second... and so on
- Each page = thousands of tokens
- Total: 10-50K tokens per search
With web-search-mcp:
- AI โ
web_search_analyzeโ gets ranked list - AI picks 1-2 best pages based on relevance
- AI โ
web_fetchโ reads only the best one - Total: 3-5K tokens per search (10x savings!)
โ๏ธ Configuration
./web-search-mcp \
--db ~/.config/web-search-mcp/web_search.db \
--ollama-url http://localhost:11434 \
--embedding-model embeddinggemma:latest \
--chromium-path /usr/bin/chromium
# Or via environment variables
export OLLAMA_BASE_URL=http://localhost:11434
export CHROME_PATH=/usr/bin/chromium
./web-search-mcp
CLI flags
| Flag | Default | Description |
|---|---|---|
--db |
~/.config/web-search-mcp/web_search.db |
Database path (cache) |
--ollama-url |
http://localhost:11434 |
Ollama endpoint |
--embedding-model |
embeddinggemma:latest |
Embedding model |
--chromium-path |
auto-detect | Chromium binary path |
-h |
โ | Help |
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Client (AI) โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ JSON-RPC / stdin-stdout
โโโโโโโโโโโโผโโโโโโโโโโโ
โ web-search-mcp โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ web_search โโโผโโโ DuckDuckGo
โ โโโโโโโโโโโโโโโโโโค โ
โ โ web_fetch โโโผโโโ chromedp + readability
โ โโโโโโโโโโโโโโโโโโค โ
โ โ search_analyzeโโโผโโโ search + fetch + embed
โ โโโโโโโโโโโโโโโโโโค โ
โ โ semantic_searchโโโผโโโ vector search (libSQL)
โ โโโโโโโโโโโโโโโโโโ โ
โโโโโโโโฌโโโโโโโโโฌโโโโโโ
โ โ
โโโโโโโโผโ โโโโโโผโโโโโโโ
โOllama โ โ libSQL โ
โembed โ โ (cache) โ
โโโโโโโโโ โโโโโโโโโโโโโ
Stack: Go + chromedp + go-readability + Ollama + go-libsql + mcp-go Transport: stdin/stdout (JSON-RPC 2.0) License: MIT
๐จ Logo Prompt
Send this prompt to Gemini or any image generation AI to create a logo for the project:
Minimalist logo for "web-search-mcp" โ an MCP server for intelligent web search.
A stylized spider web (representing "web" and "MCP") with a magnifying glass in the center. The web is drawn with thin, clean cyan/blue lines on a dark background. In the center, the magnifying glass overlaps the web intersection โ the glass lens contains a subtle glow effect symbolizing "intelligence" and "AI." The style is flat vector, modern, cyberpunk-lite. No text needed. Simple icon, suitable for a 128x128 app icon.
Style: flat vector, dark theme, cyan/blue accent palette (#00ADD8 for Go, #3B82F6). Minimal lines, tech aesthetics.
๐งช Quick Test
# Direct test (without MCP)
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' | timeout 3 ./web-search-mcp 2>/dev/null
# If you see 4 tools โ everything works!
License
MIT ยฉ Kirill Scherba
Built with Go + chromedp + go-readability + Ollama + go-libsql + mcp-go.
Documentation
ยถ
There is no documentation for this package.

