search-engine

search-engine

An MCP server that searches and scrapes multiple sources concurrently (web, DuckDuckGo, Wikipedia, arXiv, Hacker News) and renders an interactive picker UI where users can multi-select sources and delve into full page content.

Category
Visit Server

README

MCP SearchEngine

An MCP server that searches & scrapes multiple sources, then renders an interactive picker UI (a FastMCP App) so you can click which sources you want to delve into. Built on the FastMCP 4 prerelease and the MCP Apps extension.

How it works

LLM ──search(query)──► server ──► queries web, DuckDuckGo, Wikipedia,
│                                  arXiv & Hacker News concurrently
│                                  and returns normalized results
│
│                        ┌──── ui://search-engine/picker.html ────┐
│                        │ interactive card grid, source filters, │
│◄────── rendered app ───┤ multi-select, "Delve into selected"   │
│                        └──────────────┬─────────────────────────┘
│                                       │ callServerTool('delve_sources')
LLM ◄── delve_sources(picks) ◄──────────┘
        scrapes each picked URL and
        returns full readable content

The flow is symmetrical: the LLM gets the same JSON the UI renders, so it can also pick sources programmatically and call delve_sources directly — the UI is additive, not a gate.

Sources

Source Backend Notes
web DuckDuckGo instant-answer API abstract + related topics
duckduckgo DuckDuckGo HTML endpoint general web results, no key
wikipedia Wikipedia OpenSearch / summary API
arxiv arXiv Atom API papers, authors, links
hackernews Algolia HN search API points + comment counts
reddit Reddit public JSON search no API key, own UA
x Nitter HTML instances keyword search; nitter mirror configurable via X_NITTER_INSTANCE
perplexity Perplexity Chat API opt-in, needs PERPLEXITY_API_KEY; not in the defaults

A failing source never sinks the search — it comes back as an error card in the UI.

Tools

  • search(query, sources?, max_per_source?) — search all sources and render the picker UI. Returns JSON { mode: "pick", results: [...] } plus a text summary.
  • delve_sources(picks, max_chars?) — scrape the picked URLs concurrently and return full extracted text per page. picks items need at least a url.

The interactive UI

search_engine/ui/picker.html is served as a ui:// resource (text/html;profile=mcp-app) and rendered in a sandboxed iframe by hosts that support MCP Apps (Claude, ChatGPT, VS Code, Goose, …). It uses the @modelcontextprotocol/ext-apps SDK:

  • app.ontoolresult — receives the search payload pushed by the host
  • app.callServerTool({ name: "delve_sources", … }) — delves into picked sources

Click cards to multi-select, double-click to delve into a single source, filter by source chip, then press Delve into selected. The scraped pages are shown in the UI and returned to the conversation.

Install & run

python -m venv .venv
.\.venv\Scripts\python -m pip install -e .

The pyproject.toml pins the FastMCP 4 prerelease (fastmcp==4.0.0b1 + fastmcp-slim==4.0.0b1 constraint, per the v4 upgrade guide).

Run over stdio (what most MCP clients use):

.\.venv\Scripts\python -m search_engine

or test it in-process:

.\.venv\Scripts\python test_client.py

There is also a Playwright-driven UI harness (test_ui_harness.py) that renders the real picker HTML in Chromium with the SDK stubbed, clicks through select → filter → delve, and screenshots each stage. Run it with .\.venv\Scripts\python test_ui_harness.py (requires playwright install chromium).

Privacy & proxying

All network egress (search + delve_sources scraping) goes through a single privacy layer (search_engine/net.py):

  • No local persistence, ever. There is no browser: no cache, history or cookies on disk. Every request gets a fresh ephemeral client with its own empty cookie jar that is discarded afterwards.
  • Proxy via envSEARCH_PROXY_URL (falling back to HTTPS_PROXY, then ALL_PROXY). Supports http://, socks5:// and socks5h:// (the h means DNS is resolved at the proxy, avoiding local DNS leaks — handy for Tor, e.g. SEARCH_PROXY_URL=socks5h://127.0.0.1:9050). Requires httpx[socks].
  • External sandbox relay — set SEARCH_SANDBOX_URL to a disposable sandbox (e.g. a self-hosted agentOS/Rivet VM relay, https://agentos-sdk.dev/docs/apps/) and every fetch is rewritten to {SEARCH_SANDBOX_URL}<url-encoded target> so the local machine never touches the target site. agentOS is TS/Rivet, not Python-importable — this env-relay is the integration seam.
  • VPN note — a VPN is OS-level: when the OS is on one, all traffic already routes through it; the proxy and sandbox options are orthogonal to that.

See .env.example for all options. No secrets live in code and URLs that might carry credentials are never logged.

Deploy to Prefect Horizon (hosted, off your PC)

Prefect Horizon is the managed MCP hosting platform from the FastMCP team. Deploying there runs the engine on their infra — so all searching/scraping egresses from Prefect's IPs, not your PC — and serves it at an OAuth-protected URL like https://<name>.fastmcp.app/mcp. Free for personal projects.

  1. Verify the entrypoint locally (this is exactly what Horizon sees):
    .\.venv\Scripts\fastmcp inspect search_engine/server.py:mcp
    
    You should see 2 tools (search, delve_sources) and 1 resource (picker_view). server.py self-bootstraps the repo root onto sys.path so the standalone import Horizon performs resolves the package.
  2. Dependenciesrequirements.txt pins fastmcp==4.0.0b1 + fastmcp-slim==4.0.0b1 explicitly (pip doesn't read pyproject's [tool.uv] constraint), plus httpx[socks] and beautifulsoup4. Horizon auto-detects and installs it.
  3. Push to GitHub and deploy at horizon.prefect.io: sign in with GitHub, select the repo, set entrypoint search_engine/server.py:mcp, pick a server name (sets the URL), enable Authentication (built-in OAuth), and add secrets (PERPLEXITY_API_KEY, optionally X_NITTER_INSTANCE / SEARCH_PROXY_URL / SEARCH_SANDBOX_URL).
  4. Connect — Horizon redeploys on push and generates connection snippets for Claude/Cursor/VS Code. Verify with its Inspector / ChatMCP, and confirm egress via delve_sources on an IP-echo URL.

Note: Horizon is serverless (cold starts, stateless per call, ~170s timeout) — fine for this stateless engine. Its egress is Prefect's shared IP; it cannot run a host-level VPN (use a VPS instead if you ever need a dedicated VPN exit).

Example client configuration

{
  "mcpServers": {
    "search-engine": {
      "command": "C:\\Users\\kevin\\Projekt\\MCP-SearchEngine\\.venv\\Scripts\\python.exe",
      "args": ["-m", "search_engine"]
    }
  }
}

Layout

search_engine/
├── __init__.py
├── __main__.py          # python -m search_engine
├── server.py            # FastMCP server: tools + ui:// resource
├── sources.py           # multi-source search + scraping engine
└── ui/
    └── picker.html      # interactive MCP App source-picker UI

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured