This is a small MCP server that exposes local documentation to development tools. It reads files from a docs directory, chunks them, builds an in-memory TF-IDF search index, and provides MCP tools for listing, reading, searching, and reloading docs.
list_docs: list readable docs under the configured docs rootread_doc: read a specific doc by relative pathsearch_docs: search local docs and return matching chunks with line numbersreload_docs: rebuild the in-memory index after files change
python3 server.py --docs-root docsThe default transport is stdio, which is what most MCP clients expect for a
local server.
python3 smoke_test.pyThe smoke test starts the server over stdio, checks that all expected tools are
registered, and calls search_docs.
You can also set the docs root with an environment variable:
DOCS_MCP_ROOT=/path/to/your/docs python3 server.pyPoint your MCP client at the server script:
{
"mcpServers": {
"local-docs": {
"command": "python3",
"args": ["/Users/malimran/Desktop/docs-mcp/server.py", "--docs-root", "/path/to/your/docs"]
}
}
}This version intentionally uses an in-memory lexical search index so it works without a database or external embedding API. Good next steps are adding file watching, persistent indexing, richer parsers for doc formats, and optional semantic embeddings.