Skip to main content
Glama
Paulosouzx

Generate-documentation-MCP

by Paulosouzx

Generate-documentation-MCP

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/ and mcp_server/ are thin adapters that call core.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 changes

  • get_commit_diff(project_path, commit_hash) — a single commit (defaults to HEAD)

  • get_branch_diff(project_path, base_branch) — current branch vs base_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/, not mcp/, because mcp is the name of the official MCP SDK this project depends on — a top-level mcp/ package in this repo would shadow it on import.

Related MCP server: Autodocument MCP Server

The generate_documentation tool

Parameters:

Name

Type

Default

Meaning

project_path

string

server cwd

Git repository to analyze

include

string[]

none (= all)

Glob patterns; only matching changed files are kept

exclude

string[]

none

Glob patterns to drop, applied after include

output_file

string

documentation.md

Output path, relative to project_path unless absolute

language

"en"|"pt"

"en"

Skeleton language

title

string

language default

Document title

template

string

"default"

Template name, resolved as templates/{template}_{language}.md.j2

mode

"working_tree"|"commit"|"branch"

"working_tree"

Diff source

commit_hash

string | null

null (= HEAD)

Commit to document, used when mode="commit"

base_branch

string

"origin/main"

Base branch to diff against, used when mode="branch" (base_branch...HEAD)

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

Requires Python 3.10+.

git clone https://github.com/Paulosouzx/Generate-documentation-MCP.git
cd Generate-documentation-MCP
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/Generate-documentation-MCP/.venv/bin/gendoc-mcp-server

Verify it's registered:

claude mcp list

or 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".)

Development

pip install -e ".[dev]"
pytest

CLI 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/develop

Adding 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 tool
generate_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)}

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNoworking_tree
titleNo
excludeNo
includeNo
languageNoen
templateNodefault
base_branchNoorigin/main
commit_hashNo
output_fileNodocumentation.md
project_pathNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the input parameters, default behaviors, and the return format (success, output_file, etc.). It does not disclose potential side effects like file creation or permissions needed, but the output_file parameter implies file creation. The behavioral scope is well-covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured as a docstring with a purpose sentence, parameter list, and return specification. It is appropriately sized for the tool's complexity (10 params). Each sentence adds value, though the template description could be more specific rather than directing to a directory. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 10 parameters, no output schema, and no annotations, the description covers all necessary aspects: purpose, parameters with defaults and examples, return format, and behavior per mode. It allows the agent to invoke the tool correctly without external knowledge. The only minor omission is template options, but that does not hinder basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain all 10 parameters. It does so with per-parameter descriptions, defaults, and examples for include/exclude. The only minor gap is the template parameter: it references 'templates/' directory without listing available templates. Still, the semantics are largely complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Generate a Markdown documentation skeleton from Git changes.' This is a specific verb+resource combination that precisely describes the tool's function. Even without sibling tools, the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the three modes (working_tree, commit, branch) with default values, and gives guidance on include/exclude glob patterns with examples. It implicitly tells when to use each mode. However, it lacks explicit exclusions or alternatives (e.g., when not to use this tool). Overall, usage context is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev0.1.0
    • First observedgenerate_documentation

TDQS

A4.4/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion between tools.

Naming Consistency5/5

Single tool has a descriptive, snake_case name; consistency is trivially maintained.

Tool Count3/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An 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.
    15
    303
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    An 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.
    5
    14
    -
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    An 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
    -

Latest Blog Posts

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/Paulosouzx/mcp-gen-documentation'

If you have feedback or need assistance with the MCP directory API, please join our Discord server