Agent Search
A self-hosted, MCP-native web-search backend for AI agents that provides meta-search, clean extraction, RAG with citations, and GitHub project selection.
README
<div align="center">
๐ Agent Search
A self-hosted, MCP-native web-search backend for AI agents โ meta-search, clean extraction, RAG with citations, GitHub project selection, and a Tavily-compatible API. All free, all local.
English ยท ็ฎไฝไธญๆ
</div>
Why?
Built-in WebSearch / WebFetch give you links and snippets. Your agent still has to search โ fetch โ read โ reconcile by hand, and the results are easily polluted by SEO blogs and inflated stars.
Agent Search turns "search primitives" into "search outcomes": aggregate many engines, rank with official-source priority, extract clean text, and answer with chunk-level citations โ exposed as one MCP server any agent (Claude Code, Codex, Cursor, โฆ) can call by default. It also does the things the built-ins can't: typed GitHub search, first-party project comparison for tech selection, site mapping, and a Tavily-compatible endpoint.
โจ Features
- Meta-search over 9 engines via SearXNG (Google/Bing/DDG/Brave/Wikipedia/GitHub/StackOverflow/Reddit/News) with URL dedup.
- Smart local reranking โ boosts official docs / API / pricing / changelog pages, down-weights SEO content farms, multi-query expansion for doc & pricing intent.
- Robust extraction โ
trafilatura โ Jina Reader โ requestsfallback chain, ratio-based noise cleaning (keeps tables/code/prices/dates), optional Crawl4AI for JS-heavy pages. - RAG with citations โ search โ parallel multi-source fetch โ LLM summary with
[1][2]references and per-source excerpts (chunk-level evidence); bad body falls back to snippet. - GitHub, done right โ typed
repos/code/issues/prssearch via theghCLI, returninglicense / last-commit / archived / forksfor real evaluation, not just stars. - ๐ Tech-selection compare โ
github_comparepulls first-party facts (gh api) + OpenSSF Scorecard health (via the free deps.dev API) and flags archived / stale / no-release / copyleft. Evidence, not verdicts. - Site mapping โ
sitemap.xmlfirst, page-link fallback, same-domain dedup. - Tavily-compatible API โ drop-in
/tavily/searchwith stableinclude_raw_content. - Caching โ SQLite TTL cache; works offline against the cache.
๐ฌ Demo
Tech-selection comparison โ first-party facts + OpenSSF Scorecard health, never just stars:
repo stars license last commit scorecard flags
fastapi/fastapi 99669 MIT 2026-06-25 7.8 -
django/django 87997 BSD-3-Clause 2026-06-25 6.8 [no release]
encode/starlette 12432 BSD-3-Clause 2026-06-19 7.5 -
Search that prefers official docs (content farms down-ranked automatically):
$ agent-search "python asyncio tutorial"
[1] A Conceptual Overview of asyncio โ Python 3 docs https://docs.python.org/3/howto/...
[3] asyncio โ Asynchronous I/O โ Python 3 docs https://docs.python.org/3/library/asyncio.html
...
๐ How it compares
No single OSS project covers this niche โ most are end-user apps, single-capability tools, or higher-level orchestrators.
| Project | Multi-engine | Extract (JS) | RAG + cites | GitHub typed | Site map | Native MCP | Tavily-compat |
|---|---|---|---|---|---|---|---|
| Firecrawl | โ ๏ธ single-src | โ โ | โ | โ ๏ธ | โ | โ | โ |
| Crawl4AI | โ | โ โ | โ ๏ธ | โ | โ | โ | โ |
| Perplexica | โ | โ ๏ธ | โ | โ | โ | โ | โ |
| GPT Researcher | โ ๏ธ | โ | โ report | โ | โ | โ | โ |
| SearXNG | โ โ | โ | โ | โ | โ | โ | โ |
| mcp-searxng | โ | โ ๏ธ | โ | โ | โ | โ | โ |
| Agent Search | โ 9 | โ ๏ธ/โ opt | โ chunk | โ โ | โ | โ 6 tools | โ only one |
๐๏ธ Architecture
flowchart TD
A["Agent / MCP client"] -->|"web_search ยท web_ask ยท web_extract<br/>web_map ยท github_search ยท github_compare"| B["Agent Search<br/>FastAPI ยท MCP ยท CLI"]
B --> C["SearXNG ยท 9 engines<br/>meta-search + rerank"]
B --> D["trafilatura / Jina / requests<br/>(+ Crawl4AI) ยท clean extraction"]
B --> E["LLM (OpenAI-compatible)<br/>RAG with citations"]
B --> F["gh CLI<br/>typed GitHub search"]
B --> G["deps.dev + OpenSSF Scorecard<br/>project selection"]
๐ Quickstart
1. Start SearXNG (and optional FlareSolverr):
cp .env.example .env # then edit: SEARXNG_SECRET_KEY, (optional) LLM key
docker compose up -d searxng # add `flaresolverr` only if you need anti-bot handling
2. Install the Python side:
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # core
pip install -r requirements-optional.txt # optional: better extraction (trafilatura)
Or install the CLIs globally with pipx / uv (from a clone):
pipx install . # โ `agent-search`, `agent-search-mcp`, `agent-search-server`
3. Use it โ three ways:
# CLI
python search.py "python asyncio tutorial"
python search.py "Anthropic Claude API pricing" --answer
# HTTP API (binds 127.0.0.1 by default)
python server.py # โ http://127.0.0.1:8077/docs
# MCP (Claude Code / Cursor / Codex โฆ)
cp .mcp.json.example .mcp.json # set the absolute path to this repo
๐งฐ MCP tools
| Tool | What it does |
|---|---|
web_search |
Meta-search, ranked results |
web_ask |
RAG answer with [n] citations + per-source excerpts |
web_extract |
Fetch a page โ clean Markdown |
web_map |
Discover a site's links (sitemap-first) |
github_search |
Typed repos/code/issues/prs search |
github_compare |
First-party tech-selection comparison (facts + OpenSSF Scorecard) |
๐ก Coverage depends on your SearXNG instance & region. The bundled config ships some China-friendly engines (e.g. Doubao), so an instance hosted in or tuned for mainland China tends to rank Chinese sources higher and some international/English sources lower (and vice-versa elsewhere). For the widest reach, have your agent run its native
WebSearch/WebFetchin parallel and merge โ Agent Search for aggregation/RAG/GitHub, native search for extra reach. You can also add/remove engines insearxng/settings.yml.
โ ๏ธ Notes & limitations
web_ask(RAG) needs an OpenAI-compatible LLM key; everything else (search/extract/map/github) needs no API key.- Extraction does not render JS by default โ install the optional
crawl4aiand usedeep=Truefor JS-heavy pages. - Built for local / trusted use: the HTTP server binds
127.0.0.1by default and extraction has an SSRF guard (blocks localhost / private / cloud-metadata IPs). Add auth + a reverse proxy before exposing it. - This is a personal project, maintained best-effort. Issues/PRs welcome but no SLA.
๐ Acknowledgements
Stands on the shoulders of: SearXNG ยท trafilatura ยท Jina Reader ยท Crawl4AI ยท FlareSolverr ยท OpenSSF Scorecard + deps.dev ยท GitHub CLI ยท FastAPI ยท the Model Context Protocol. RAG summaries via any OpenAI-compatible endpoint (e.g. DeepSeek).
๐ License
MIT โ do whatever, no warranty. Agent Search orchestrates SearXNG as a separate service (it does not bundle or modify SearXNG's source), so its AGPL does not extend to this project.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.