claude-docs-mcp
v1.0.0
Published
Global MCP server for Claude Code — auto-generates and injects project docs (estructura.mmd, analysis.md) for any Python project. Per-project config via .claude/docs.json.
Maintainers
Readme
claude-docs-mcp
Global MCP server for Claude Code that automatically generates and injects project documentation for any Python project — no CLAUDE.md required.
What it does
estructura.mmd— Mermaid module dependency map, updated after every file editanalysis.md— per-file What/How/Why analysis with AST-extracted structure- Hooks — PostToolUse regenerates docs on Write/Edit; UserPromptSubmit injects them into every conversation turn
- Per-project config —
.claude/docs.jsoncontrols source dirs, subgraphs, and which files to inject
Install
npx claude-docs-mcpOr add globally to Claude Code via ~/.claude.json:
{
"mcpServers": {
"claude-docs": {
"type": "stdio",
"command": "npx",
"args": ["-y", "claude-docs-mcp"],
"env": {}
}
}
}Requirements
- Node.js 16+
- Python 3.8+ on PATH (the package auto-installs the
mcpPython dependency into~/.claude-docs-mcp/venv/on first run)
MCP Tools
| Tool | Description |
|------|-------------|
| get_project_docs | Returns all configured docs as a context block |
| refresh_docs | Regenerates estructura.mmd + updates analysis.md |
| get_file_analysis | Returns the What/How/Why section for a specific file |
| set_file_analysis | Writes or updates What/How/Why for a file |
| get_project_config | Shows effective config (defaults + .claude/docs.json) |
| init_project_docs | Bootstraps docs/ + .claude/docs.json for a new project |
Per-project config (.claude/docs.json)
{
"src_dirs": ["src", "lib"],
"docs_dir": "docs",
"inject": ["estructura.mmd", "analysis.md"],
"subgraphs": [
{ "prefix": "core/", "id": "CORE", "label": "Core Engine" },
{ "prefix": "ui/", "id": "UI", "label": "UI Layer" }
],
"skip_files": ["__init__.py"],
"keep_init": ["strategies/__init__.py"]
}Leave any field out to use smart defaults (auto-detects src/, lib/, app/ dirs and subgraphs from folder structure).
Hooks setup
Add to ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [{ "type": "command", "command": "npx claude-docs-mcp --refresh" }]
}
],
"UserPromptSubmit": [
{
"hooks": [{ "type": "command", "command": "npx claude-docs-mcp --inject" }]
}
]
}
}License
MIT
