A metasearch engine that expects to be bossed around by agents
RustXNG gives AI agents a local, key-free web search endpoint with tight text budgets — so the model only sees what it actually asked for.
What it does
RustXNG is a self-hosted metasearch engine written in Rust, based on SearXNG. It fans queries out to multiple upstream engines, merges the results, and serves them as JSON over a local HTTP API. Many engines work without API keys. It can also fetch page text on demand for grounding, so an agent pulls evidence only when it needs it instead of stuffing a whole web page into context.
The interesting bit
The whole design is shaped around token discipline. The MCP server (rustxng mcp) exposes read-only search and read_page tools with serialized character and byte budgets — snippets get shortened first, then trailing results get dropped while preserving complete URLs and metadata, with truncated and next_offset flags so callers know whether to keep going. The README even ships a copy-paste instruction block for telling an agent to install and use the tool itself, which is either delightful or slightly ominous.
Key highlights
- JSON, CSV, RSS, and HTML output; browser UI included
max_results(1–200), domain include/exclude filters, engine selection,time_range- MCP tools with bounded responses, Unicode-offset pagination, and up to three matching passages per
read_page - Engines that repeatedly return empty results are automatically rested, visible via
/statsand/metrics - Runs fully offline of third-party accounts for most engines; search terms still go to whichever upstream engines you select
- Prebuilt binaries for Linux, macOS, and Windows; optional Valkey/Redis cache and an experimental local BM25 index
Caveats
- Page reads fail closed if any outgoing proxy is configured — DNS and redirects must be checkable against public addresses, so proxied environments lose
read_pageentirely. - Character limits are not token limits; tokenizer-specific budgets are explicitly future work.
- Yahoo! JAPAN and Mojeek adapters are disabled by default pending permission review, and the published SealQA numbers used an older engine set, so they don’t reflect current defaults.
Verdict
Worth a look if you’re wiring an agent to the web and want search you control, without API keys or per-query bills. If you just want a human-facing metasearch page, plain SearXNG already does that job.
Frequently asked
- What is sahenjp/RustXNG?
- RustXNG gives AI agents a local, key-free web search endpoint with tight text budgets — so the model only sees what it actually asked for.
- Is RustXNG open source?
- Yes — sahenjp/RustXNG is open source, released under the AGPL-3.0 license.
- What language is RustXNG written in?
- sahenjp/RustXNG is primarily written in Rust.
- How popular is RustXNG?
- sahenjp/RustXNG has 721 stars on GitHub.
- Where can I find RustXNG?
- sahenjp/RustXNG is on GitHub at https://github.com/sahenjp/RustXNG.