Generate-documentation-MCP
Generate Markdown documentation skeletons from a Git repository’s changes, leaving analysis placeholders for Claude Code to fill in.
Document uncommitted changes (
working_tree, default), a single commit, or a branch diff against a base branch.Filter changed files with
includeandexcludeglob patterns.Write output to a configurable path via
output_file.Choose English or Portuguese skeletons, plus custom title and template.
Default to the server cwd,
HEADfor commits, andorigin/mainfor branch comparisons.Return success status, output file path, processed/ignored counts, or an error on failure.
Make no AI/API calls; generated skeletons contain diffs, file lists, and placeholders such as
AI Usage.
Click on "Deploy 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., "@Generate-documentation-MCP Document my uncommitted changes."
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.
Diffscribe
Website: diffscribe.online
MCP server for Claude Code that turns a Git repository's changes — uncommitted, a single commit, or a whole branch — into a structured Markdown documentation skeleton — diffs, file list and placeholders — ready for Claude Code to fill in with the actual analysis.
This is a standalone product, not an evolution of
Generate-documentation-IA.
That project's gendoc shell script was used only as a reference for the
skeleton format; this repo does not reuse its code.
Design
No AI API calls. All language understanding ("ignore CSS files", "document this in Portuguese") happens in Claude Code, which translates the request into structured parameters. The MCP server only executes them: reads Git diffs, applies include/exclude filters, renders a template, and writes the file.
core/owns all logic.cli/andmcp_server/are thin adapters that callcore.generator.generate_documentation()and format its result — neither contains business rules.Skeleton, not final prose. The generated Markdown mirrors the original script's workflow: diffs are embedded with
[To be filled by AI]placeholders. After calling the tool, Claude Code edits the output file directly to fill in the analysis.
core/ diff collection, filtering, template rendering, file writing
cli/ argparse wrapper around core, for local/manual use
mcp_server/ FastMCP server exposing the generate_documentation tool
templates/ Jinja2 skeleton templates (default_en.md.j2, default_pt.md.j2)
tests/ pytest suite (uses real throwaway Git repos via subprocess)All Git commands live in core/git_diff.py — nothing else in the project
shells out to git. It exposes one function per diff source:
get_working_tree_diff(project_path)— staged + unstaged uncommitted changesget_commit_diff(project_path, commit_hash)— a single commit (defaults toHEAD)get_branch_diff(project_path, base_branch)— current branch vsbase_branch...HEAD
All three return the same list[ChangedFile] shape, so
core/generator.py and the Markdown template never know which mode produced
the diff — only mode picks which function runs; everything downstream
(filtering, rendering, writing) is identical for every mode.
Note: the MCP-facing package is named
mcp_server/, notmcp/, becausemcpis the name of the official MCP SDK this project depends on — a top-levelmcp/package in this repo would shadow it on import.
Related MCP server: Autodocument MCP Server
The generate_documentation tool
Parameters:
Name | Type | Default | Meaning |
| string | server cwd | Git repository to analyze |
| string[] | none (= all) | Glob patterns; only matching changed files are kept |
| string[] | none | Glob patterns to drop, applied after |
| string |
| Output path, relative to |
|
|
| Skeleton language |
| string | language default | Document title |
| string |
| Template name, resolved as |
|
|
| Diff source |
| string | null |
| Commit to document, used when |
| string |
| Base branch to diff against, used when |
Calling the tool with no arguments beyond project_path keeps documenting
uncommitted changes exactly as before — mode defaults to "working_tree".
Returns:
{
"success": true,
"output_file": "/path/to/documentation.md",
"files_processed": 12,
"files_ignored": 3
}On failure (success: false), a error field explains what went wrong (not a
Git repo, unknown template, unwritable path).
Diff scope matches the original script: staged + unstaged uncommitted changes, staged diff taking priority for files with both.
Installation
Option A — run it straight from GitHub (no clone)
Requires uv. uvx downloads and caches the
package on first launch:
claude mcp add --scope user --transport stdio gendoc -- \
uvx --from git+https://github.com/Paulosouzx/mcp-gen-documentation.git gendoc-mcp-serverOption B — clone and install locally
Requires Python 3.10+.
git clone https://github.com/Paulosouzx/mcp-gen-documentation.git
cd mcp-gen-documentation
python3 -m venv .venv
source .venv/bin/activate
pip install -e .This installs the gendoc-mcp (CLI) and gendoc-mcp-server (MCP server)
console scripts into .venv/bin/.
Registering with Claude Code
Register it once, at user scope, so it's available in every project:
claude mcp add --scope user --transport stdio gendoc -- \
/absolute/path/to/mcp-gen-documentation/.venv/bin/gendoc-mcp-serverVerify it's registered:
claude mcp listor run /mcp inside a Claude Code session.
Using it
Inside any Git repository, in Claude Code, describe what you want in plain
language — Claude Code translates it into tool parameters, the server writes
documentation.md with the diffs and placeholders, and Claude Code then
edits that file in place to fill in the actual analysis.
Document local (uncommitted) changes
"Document the changes on this branch, ignoring CSS files, in Portuguese."
{"exclude": ["*.css"], "language": "pt"}(mode omitted — defaults to "working_tree".)
Document a specific commit
"Document what changed in commit a1b2c3d."
{"mode": "commit", "commit_hash": "a1b2c3d"}"Document the last commit."
{"mode": "commit"}(commit_hash omitted — defaults to HEAD.)
Document a whole branch
"Document everything this branch adds compared to origin/develop."
{"mode": "branch", "base_branch": "origin/develop"}(base_branch omitted — defaults to "origin/main".)
AI Usage section
Every generated skeleton, in every mode, ends with an empty placeholder section:
## AI Usage
- Model:
- Input tokens:
- Output tokens:The MCP server never fills this in — it makes no external API calls and has no session data to draw from. It's a placeholder for Claude Code, which (like the "Changes made" and "Testing process" fields) edits the file directly after the tool call, filling in these fields from its own current-session data when available and leaving them empty otherwise. Values are never invented, and no monetary cost is calculated.
If you generate documentation from the plain gendoc-mcp CLI, with no LLM in
the loop, this section stays empty — the rest of the document works exactly
as before.
Development
pip install -e ".[dev]"
pytestCLI usage (no Claude Code needed), useful for manual testing:
# Uncommitted changes (default mode)
gendoc-mcp
gendoc-mcp --mode working_tree --exclude "*.css" --language pt
# A specific commit (defaults to HEAD if --commit omitted)
gendoc-mcp --mode commit --commit a1b2c3d
# Current branch vs a base branch (defaults to origin/main)
gendoc-mcp --mode branch --base origin/developAdding a new tool
Add the core function in core/, then expose it with a new @mcp.tool()
function in mcp_server/server.py that calls it — no logic in the server
itself. Add a matching CLI subcommand in cli/ if useful for manual/local
use.
Available Tools
1 toolgenerate_documentationA
Generate a Markdown documentation skeleton from Git changes.
Args: project_path: Path to the Git repository. Defaults to the server's current working directory (the project Claude Code is running in). include: Glob patterns; only matching changed files are documented (e.g. [".py", "src/**"]). If omitted, all changed files match. exclude: Glob patterns to drop from the result (e.g. [".css"]), applied after include. output_file: Path (relative to project_path, unless absolute) for the generated Markdown file. language: Skeleton language, "en" or "pt". title: Document title. Defaults to a language-appropriate title. template: Template name to render (see templates/ directory). mode: Diff source — "working_tree" (uncommitted changes, default), "commit" (a single commit), or "branch" (current branch vs base_branch). commit_hash: Commit to document when mode="commit". Defaults to HEAD. base_branch: Base branch to diff against when mode="branch" (uses base_branch...HEAD). Defaults to "origin/main".
Returns: {"success": bool, "output_file": str | None, "files_processed": int, "files_ignored": int, "error": str (only on failure)}
Inputs: mode, title, exclude, include, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools.
Single tool has a descriptive, snake_case name; consistency is trivially maintained.
One tool is on the low end but acceptable given the focused purpose; the tool's many parameters handle multiple use cases without needing separate tools.
The tool covers the core task of generating documentation from Git changes with various modes, though lacking features like updating or previewing could be considered minor gaps.
Maintenance
Related MCP Connectors
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
MCP server for generating rough-draft project plans from natural-language prompts.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.15305MIT
- AlicenseNot gradedqualityFmaintenanceAn MCP server that automatically generates documentation, test plans, and code reviews for code repositories by analyzing directory structures and code files using AI models via OpenRouter API.6Creative Commons Zero v1.0 Universal
- FlicenseAqualityDmaintenanceAn MCP server that connects Gemini 2.5 Pro to Claude Code, enabling users to generate detailed implementation plans based on their codebase and receive feedback on code changes.514-
- FlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables Claude to generate, search, and manage documentation for codebases using vector embeddings and semantic search, providing tools for creating user guides, technical documentation, code explanations, and architectural diagrams.6-