kirill-scherba

web-search-mcp ๐Ÿ•ธ๏ธ

Community kirill-scherba
Updated

MCP server for intelligent web search โ€” no API keys required, with local AI-powered semantic analysis running on your machine.

web-search-mcp ๐Ÿ•ธ๏ธ

web-search-mcp

GoMCPLicenseOllamaDuckDuckGo

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:

web-search-mcp-d1

โŒ 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 Cline

Add to your Cline MCP settings file:

{
  "mcpServers": {
    "web-search-mcp": {
      "command": "/path/to/web-search-mcp",
      "args": [],
      "env": {},
      "disabled": false,
      "autoApprove": [
        "web_search",
        "web_search_analyze",
        "web_fetch",
        "web_semantic_search"
      ]
    }
  }
}

Then click "Restart MCP Servers" in the Cline panel or reload the page.

๐ŸŽฎ 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:

  1. AI โ†’ search โ†’ gets HTML result list
  2. AI โ†’ reads first result (full HTML)
  3. AI โ†’ if wrong, reads second... and so on
  4. Each page = thousands of tokens
  5. Total: 10-50K tokens per search

With web-search-mcp:

  1. AI โ†’ web_search_analyze โ†’ gets ranked list
  2. AI picks 1-2 best pages based on relevance
  3. AI โ†’ web_fetch โ†’ reads only the best one
  4. 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-goTransport: 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.

MCP Server ยท Populars

MCP Server ยท New

    mcpware

    Cross-Code Organizer (CCO)

    Cross-Code Organizer (formerly Claude Code Organizer): cross-harness config dashboard for Claude Code, Codex CLI, MCP servers, skills, memories, agents, sessions, security scanning, context budget, and backups.

    Community mcpware
    dcostenco

    ๐Ÿง  Prism MCP โ€” The Mind Palace for AI Agents

    The Mind Palace for AI Agents - HIPAA-hardened Cognitive Architecture with on-device LLM (prism-coder:7b), Hebbian learning, ACT-R spreading activation, adversarial evaluation, persistent memory, multi-agent Hivemind and visual dashboard. Zero API keys required.

    Community dcostenco
    Mcp-Brasil

    mcp-brasil

    MCP Server para 70 APIs pรบblicas brasileiras

    Community Mcp-Brasil
    kridaydave

    File Organizer MCP Server

    This MCP server will organize your files using connections to MCP using clients like Claude, Cursor and Gemini Cli

    Community kridaydave
    higress-group

    AI Gateway

    ๐Ÿค– AI Gateway | AI Native API Gateway

    Community higress-group