v0.10.13 · MIT · Python 3.11+

Self-hosted documentation search for AI agents.

gnosis-mcp indexes your docs, git history, and crawled sites into a searchable knowledge base exposed over MCP. Zero config. SQLite by default. Hybrid FTS5 + vector with optional cross-encoder reranking.

$ pip install gnosis-mcp
Live graph → Install for your editor →
9,463
QPS at 100 docs
8.7 ms
MCP e2e mean
1.00
Hit rate @ 5
610
Tests, all green

— What it does

Your docs, indexed

Markdown, text, notebooks, TOML, CSV, JSON. Optional rST + PDF. Heading-aware chunking that never splits inside code blocks or tables.

Hybrid search

BM25 + local ONNX embeddings merged via Reciprocal Rank Fusion. Tune the fusion constant with GNOSIS_MCP_RRF_K. No API key required.

Cross-encoder rerank

Optional [reranking] extra. A 22M-param ONNX cross-encoder that re-scores the top candidates. Off by default.

Git history

Ingest commit messages as searchable context. Find the reason a line exists, not just the line itself.

Web crawl

Sitemap discovery or BFS. Robots.txt with same-host redirect guard. ETag/Last-Modified caching. Trafilatura extraction with per-page timeout.

MCP + REST on one port

9 MCP tools + 3 resources. Optional REST API on the same process with Bearer auth (timing-safe). File watcher for auto re-ingest.

— Published numbers

SQLite keyword (FTS5 + BM25), in-memory, median of 3 runs on laptop CPU. Methodology →

CorpusQPSp50p95p99
100 docs / 300 chunks9,4630.10 ms0.16 ms0.19 ms
1,000 docs / 3,000 chunks2,7680.29 ms0.72 ms0.78 ms
5,000 docs / 15,000 chunks8390.80 ms2.97 ms3.54 ms
10,000 docs / 30,000 chunks4711.38 ms5.60 ms6.29 ms

Through the full MCP stdio protocol: 8.7 ms mean, 13.0 ms p95 per tool call. RAG eval across 10 cases: Hit@5 = 1.00, MRR = 0.95, Precision@5 = 0.67. Reproduce with gnosis-mcp eval.

— vs. alternatives

 gnosis-mcpContext7docs-mcp-servermcp-local-rag
Your own private docs
Self-hostedhosted
Zero config install
Local embeddings, no API keyONNXopt
Hybrid keyword + vector (RRF)opt
Cross-encoder rerankeropt
PostgreSQL + pgvector
Web crawl (sitemap + BFS)
Git history indexing
REST API on same port
File watcher auto re-ingest
Write tools (upsert/delete)
Published benchmarks
Built-in eval harness

Context7 indexes public library docs. gnosis-mcp indexes your own private docs. Use both.

— Get it running

Install
$ pip install gnosis-mcp
$ gnosis-mcp ingest ./docs && gnosis-mcp serve
Semantic search (local, no API key)
$ pip install gnosis-mcp[embeddings]
$ gnosis-mcp ingest ./docs --embed
Cross-encoder rerank (opt-in)
$ pip install gnosis-mcp[reranking]
$ GNOSIS_MCP_RERANK_ENABLED=true gnosis-mcp serve
Scale to PostgreSQL
$ pip install gnosis-mcp[postgres]
$ export GNOSIS_MCP_DATABASE_URL=postgresql://...
Wire it into Claude Code / Cursor / Windsurf
{
  "mcpServers": {
    "gnosis": {
      "command": "gnosis-mcp",
      "args": ["serve"]
    }
  }
}

Full editor snippets in llms-install.md.