mdctx
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., "@mdctxfind files about authentication"
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.
mdctx
A zero-ML-dependency keyword index for markdown context files. Built for
large workspaces where dumping every doc into an LLM's context window
wastes tokens — mdctx indexes your markdown once, then answers "which
files are relevant to X" in milliseconds, from a flat JSON file you can
commit and diff like code.
Why this exists
There are already several MCP servers that index markdown notes with
hybrid keyword+semantic search (qmd, dotmd, foam-notes-mcp, and others).
mdctx is deliberately narrower than those:
No SQLite, no vector DB, no embedding model to download. The index is a single flat JSON file you can read, diff, and review in a PR.
Keyword-only by design, using RAKE-style extraction and BM25 ranking — fully deterministic, fully offline, no cost per index update.
Cross-model on purpose. Ships as both a CLI (usable from any script or agent that can shell out) and an MCP server (usable by Claude, ChatGPT, Cursor, and anything else that speaks MCP).
If you need semantic/fuzzy matching across large free-text notes, one of the heavier tools above is likely a better fit. If you have a workspace of structured docs and want a fast, transparent, git-friendly index, that's what this is for.
Related MCP server: md-graph
Install
npm install -g mdctxCLI usage
# Index every .md/.mdx file under a directory (incremental — only
# changed files are re-processed)
mdctx build ./docs
# Search the index
mdctx search "auth flow"
mdctx search "auth flow" --json --limit 3MCP usage
Add to your MCP client config (e.g. Claude Desktop's
claude_desktop_config.json):
{
"mcpServers": {
"mdctx": {
"command": "mdctx-mcp",
"env": {
"MDCTX_ROOT": "/absolute/path/to/your/docs"
}
}
}
}This exposes three tools: search_context, refresh_index, and
list_context. search_context auto-heals: if the index is missing,
corrupt, or was written by an older mdctx version, it gets rebuilt
transparently on the next call rather than erroring out.
Keeping the index up to date automatically
Run this once per repo:
mdctx init ./docsThis wires up everything needed so you never have to remember to run
mdctx build by hand:
.mdctx.json— records which directory holds your docs and where the index lives, so the hooks and CI job below don't need arguments.A pre-commit hook — rebuilds the index and stages it before every commit, so
context-index.jsonalways reflects what you're about to commit. If nothing changed, the rebuild is a no-op and nothing gets added to the commit.post-merge / post-checkout hooks — rebuild the index after a pull or a branch switch, so local search results match whatever's on disk. These are advisory: if the rebuild fails for any reason they print a warning to stderr rather than blocking the merge or checkout.
.github/workflows/mdctx-index.yml— a CI check that rebuilds the index on every push/PR and fails the build if it doesn't match what's committed. This is the backstop for commits made with--no-verify, from a machine that never ranmdctx init, or by a bot.
Re-running mdctx init is safe. It won't overwrite a hook it didn't
install unless you pass --force, so it won't clobber pre-existing
hooks from another tool.
If you'd rather not touch git hooks, the CI workflow alone is enough to
catch staleness; just don't run mdctx init and use mdctx build
manually or in whatever pipeline already touches your docs.
How it works
mdctx buildwalks the target directory for.md/.mdxfiles, hashes each one, and skips any file whose hash hasn't changed since the last run.For new/changed files, it extracts a title (from frontmatter or the first heading) and a set of keywords using a RAKE-style scoring algorithm — no LLM call, no network request.
Everything is written to
context-index.json— one JSON object per file, human-readable and git-diffable. A rebuild that finds no content changes writes back the exact same bytes (therootpath is stored relative to the index file, and thegeneratedAttimestamp only moves when something actually changed), so runningmdctx buildrepeatedly never produces spurious diffs.mdctx searchloads that JSON, builds a BM25 index in memory over each file's title+keywords, and returns ranked results.
Development
npm install
npm run build
npm testLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.Last updated325MIT
- Flicense-qualityAmaintenanceMCP server that enables full-text search and link navigation over Markdown files as a knowledge graph.Last updated
- Alicense-qualityDmaintenanceA local-first MCP server that turns a .context/ folder of markdown files into a searchable knowledge layer for AI coding agents.Last updated212MIT
- Alicense-qualityCmaintenanceMCP server for local knowledge management with Markdown and PDF indexing using SQLite FTS5.Last updated92MIT
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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/zachkepe/mdctx'
If you have feedback or need assistance with the MCP directory API, please join our Discord server