mcp-docs-ask
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-docs-askSearch the docs for the OAuth authentication flow"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-docs-ask
Local RAG MCP for documentation. Point source at any markdown repository
(local path or git URL).
The server does retrieval only (no answer LLM). ask_docs returns grounded
passages and citations; the MCP host (Cursor / Claude) synthesizes the answer.
Features
ask_docsretrieval with configurable path-based layer filterslist_docsdiscovery for configured docs collections and layer filtersreindexrebuilds the local vector index; for git URL sources it also fetches updates
Related MCP server: mcp-rag-server
Requirements
Python 3.13+
giton PATH (only ifsourceis a git URL)Git credentials on the machine when
sourceis a private git URL (gh auth login, HTTPS credential helper, or SSH). No tokens in config.First run downloads the embedding model weights once (sentence-transformers)
Quick start
git clone git@github.com:alyiox/mcp-docs-ask.git
cd mcp-docs-ask
uv sync
mkdir -p ~/.config/mcp-docs-ask
cp config.example.json ~/.config/mcp-docs-ask/config.json
# Prefer a local checkout while developing:
# set docs.<id>.source to your docs repo path
npx -y @modelcontextprotocol/inspector uv run mcp-docs-askConfiguration
Config path: ~/.config/mcp-docs-ask/config.json
Windows:
%USERPROFILE%\.config\mcp-docs-ask\config.json
{
"docs": {
"product": {
"source": "https://github.com/example/docs.git",
"desc": "Product guides and API reference",
"ref": "main",
"include": ["**/*.md"],
"exclude": ["archive/**"],
"layers": {
"guides": {
"desc": "How-to and onboarding guides",
"include": ["docs/guides/**"]
},
"api": {
"desc": "HTTP API reference",
"include": ["docs/api/**"]
}
},
"embedding_model": "sentence-transformers/all-MiniLM-L6-v2"
},
"team-notes": {
"source": "/path/to/docs",
"desc": "Internal team notes (local path; ref unused)",
"include": ["**/*.md"],
"exclude": ["archive/**"]
}
},
"default": {
"docs": "product",
"embedding_model": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
"top_k": 8,
"chunk_max_chars": 1500
}
}product is a git URL (ref applies). team-notes is a filesystem path (ref unused).
Optional desc on each docs collection and layer helps agents pick the right target.
embedding_model, top_k, and chunk_max_chars resolve as:
docs.<id>.X → default.X → built-in. Omit per-docs keys to inherit.
Embedding model recommendation
Any Hugging Face id loadable by sentence-transformers works. Pick by language mix:
Docs / queries | Recommended |
English-only (built-in when omitted) |
|
Chinese-only |
|
Multilingual (~50 langs) |
|
Changing embedding_model requires a reindex (the on-disk index stores the model name).
Field | Description |
| Docs repo root: local path or git URL |
| Short description for discovery ( |
| Branch / tag / SHA for git URL sources only (default |
| Globs relative to repo root (default |
| Globs to skip |
| Path globs for that layer (first match wins) |
| Short layer description for discovery |
| Optional override (see recommendation above) |
| Optional override for default retrieval count |
| Optional override for max body chars per heading chunk |
| Default docs collection id |
| Default sentence-transformers model id |
| Default retrieval count |
| Default max body chars per heading chunk |
Layers partition indexed files by path glob. First match wins. Names are
case-insensitive; all is reserved (cannot be configured as a layer name).
| Meaning |
| Every indexed chunk (named layers and paths outside them) |
| Only chunks whose path matched that named layer’s |
Paths that match no named-layer glob are still indexed and only appear under
layer=all. Omit layers (or set "layers": {}) for flat repos — use
layer=all.
Cache layout:
Repos (git URL):
~/.cache/mcp-docs-ask/repos/<docs-id>/Indexes:
~/.cache/mcp-docs-ask/indexes/<docs-id>/
Tools
Tool | Description |
| List configured docs collections, layer filters, and index state |
| Retrieve grounded passages + citations ( |
| Sync git source (if URL) and rebuild the vector index |
list_docs returns a default block with the same keys as the config default
block (docs, embedding_model, top_k, chunk_max_chars), plus a docs list
where each entry carries its resolved values, a default flag, and an index
block (null when the collection has never been indexed). Valid layer values
are all plus the named layer ids — see Layers above.
Index block
list_docs and reindex return the same index keys: origin, root, rev,
files, chunks, layers.
origin mirrors the configured source: file for a filesystem path, git for
a URL the server clones into ~/.cache/mcp-docs-ask/repos/<docs-id>/ and
fetches on reindex. root is where the files actually are — null only when
a built index outlived its source directory. rev is the checkout HEAD when
there is one, so a file source that is itself a git clone still reports one;
its working tree may hold uncommitted edits, so rev labels the checkout, not
the exact indexed content.
ask_docs carries only the two answer-scoped keys, root and rev: the
checkout that produced the passages, and the revision they came from.
Reading a full source file
citations[].path is repo-relative and stable; answer_context holds the
passage text once, keyed by the [n] markers that match citations[].n. To read
a whole source file, join index.root from the same ask_docs response with a
citation path:
/home/you/docs-repo + product/features/budget.mdTake root from the response that produced the citations rather than an earlier
reindex — ask_docs rebuilds a stale index itself, so its rev is the one
that matches the passages in hand.
MCP host examples
The examples below launch the server with uvx, which installs the package on first
use. Run it once in a terminal beforehand so your host does not block on that install:
$ uvx mcp-docs-ask
Installed 84 packages in 275msThe server then starts on stdio and waits for input — press Ctrl-C once you see the
install line. Embedding model weights are fetched separately, on the first ask_docs
or reindex call.
Linux (including WSL, containers, and CI): the PyPI
torchwheel for Linux is the CUDA build. It pulls ~15nvidia-*packages whether or not the machine has an NVIDIA GPU — about 2.7 GB of wheels and ~4 GB on disk. Windows and macOS resolve to a CPU-only wheel (~1 GB) and never download CUDA. Pre-warming matters most here: expect the firstuvxrun to take minutes, not milliseconds.
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"docs-ask": {
"command": "uvx",
"args": ["mcp-docs-ask"]
}
}
}Claude Code
Add to your Claude Code MCP config:
{
"mcpServers": {
"docs-ask": {
"command": "uvx",
"args": ["mcp-docs-ask"]
}
}
}Codex
[mcp_servers.docs-ask]
command = "uvx"
args = ["mcp-docs-ask"]OpenCode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"docs-ask": {
"type": "local",
"enabled": true,
"command": ["uvx", "mcp-docs-ask"]
}
}
}GitHub Copilot
{
"inputs": [],
"servers": {
"docs-ask": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-docs-ask"]
}
}
}Development
uv sync
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run pyright
uv run pytestNotes
Local path:
ask_docsrebuilds the index automatically when file mtimes/sizes change (fingerprint check). You do not needreindexafter editing local docs.Git URL:
ask_docsnever fetches. Callreindextogit fetchthe configuredrefand rebuild.Changing
embedding_modelinvalidates the on-disk index (rebuild on next use /reindex).
This server cannot be installed
Maintenance
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Read-only MCP server for the OrchestKit docs: full-text search + Markdown fetch. No auth.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
MCP server for querying Forkast documentation
Related MCP Servers
- AlicenseAqualityDmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.316MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that indexes documents and serves relevant context to LLMs via Retrieval Augmented Generation (RAG).4837MIT
- FlicenseNot gradedqualityCmaintenanceProvides a local MCP server for Claude Code to retrieve relevant documentation slices from a repository's auto-generated reference docs using hybrid search (vector + BM25).
- FlicenseNot gradedqualityBmaintenanceMCP server that exposes one or more documentation folders (Markdown, MDX, TXT) to AI agents, enabling listing, reading, and searching of documentation files.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/alyiox/mcp-docs-ask'
If you have feedback or need assistance with the MCP directory API, please join our Discord server