The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Llmstxt Doc Search listing page.
Live, ranked search across any number of
llms.txtdocumentation sites - Strands, Kiro, the AWS guides, and whatever you add at runtime.
llmstxt-doc-search is a Model Context Protocol (MCP) server that turns the llms.txt index a documentation site publishes into a fast, ranked search tool your agent can call. It indexes titles at startup, ranks queries with BM25, and fetches the full document only when you open a result - so you get current docs with almost no local storage. Built on the search engine from @praveenc/mcp-docs-server, generalized to a runtime registry of sources.
An llms.txt file is a curated index of a doc site's pages, published for tools like this one to consume. They can be large - AWS Bedrock's lists roughly a thousand documents - so downloading everything is wasteful and goes stale fast.
This server takes a leaner approach:
mcp, json, and stdio are preserved rather than stemmed.fetch_doc.The result is a good fit for broad, fast-moving reference material - the opposite tradeoff to snapshotting docs into a local vault.
Add the server to your MCP client configuration (Claude Desktop, Kiro, and others). It is downloaded and run on demand via npx - no manual build:
Then point your MCP client at the installed binary:
Once the server is connected, the typical flow is three calls:
docs_home() - orient yourself: see the registered sources and how to search and fetch.search_docs("prompt caching", "aws-bedrock-userguide") - rank matching docs. Omit the source to search everything.fetch_doc(url) - read the full content of a result you like.Add your own source at any time and it is indexed immediately and persisted for future runs:
| Tool | Purpose |
|---|---|
docs_home() | Orientation: registered sources plus how to search and fetch. Call this first. |
list_doc_sources() | List sources with their llms.txt URL and index status. |
search_docs(query, source?, k?) | BM25 search. Omit source to search all, or scope to one. Returns ranked {source, url, title, score, snippet}. k defaults to 5 (max 50). |
fetch_doc(url) | Fetch the full content of a result URL. The URL must belong to a registered source. |
add_doc_source(name, llms_txt_url) | Register and index a new llms.txt source at runtime. Persisted. |
remove_doc_source(name) | Remove a registered source. |
refresh_doc_source(name) | Re-index a source to pick up new or changed docs. |
Seeded into the registry on first run:
strands, kiro, aws-bedrock-userguide, aws-agentic-ai-lens, aws-bedrock-agentcore-devguide, mcp.
The registry is persisted at ~/.config/llmstxt-doc-search/sources.json (override with LLMSTXT_REGISTRY_PATH). Anything you add, remove, or refresh at runtime is saved there.
All configuration is via environment variables; none are required.
| Variable | Default | Meaning |
|---|---|---|
LLMSTXT_REGISTRY_PATH | ~/.config/llmstxt-doc-search/sources.json | Where the source registry is persisted. |
LLMSTXT_SNIPPET_HYDRATE_MAX | 5 | How many top hits to fetch when building result snippets. |
LLMSTXT_LOG_LEVEL | info | Log verbosity: debug, info, warn, or error. Logs go to stderr only. |
Clone the repository for local work:
Point your client at a source checkout instead of the published package:
Or, after npm run build, at the compiled entry point:
Ranking uses BM25 (Best Matching 25) with several enhancements:
running and run).prompt caching).mcp, json, and stdio unstemmed so they match exactly.This server fetches user-supplied URLs at runtime, so its SSRF surface is guarded in depth:
fetch_doc only retrieves URLs under a registered source's origin and path prefix, matched on a path boundary rather than a raw string prefix. There is no arbitrary fetch.http(s) schemes are rejected.ipaddr.js), covering decimal, octal, and hex IPv4, IPv4-mapped IPv6, loopback, link-local, unique-local, carrier-grade NAT, and other reserved ranges - not just a hostname regex.Runtime dependencies report zero known vulnerabilities.
MIT - Copyright (c) 2026 Praveen Chamarthi
Contributions are welcome. If you find a bug or have an idea:
npm test, npm run typecheck, and npm run build all pass.main with a clear description of what changed and why.Commit messages follow the Conventional Commits style.
LLMSTXT_LOG_LEVEL=debug for more detail).