generate_documentationLABSCO SUMMARY
Bottom-up is the design decision that makes the output coherent.
Documenting a repository top-down produces a summary of filenames; starting at the leaves and carrying child documentation upward produces an overview grounded in what the code actually does. Budget for it — a model call per qualifying directory against your own OpenRouter key adds up on a large tree, and the file-size and files-per-directory caps exist to keep that bounded.
What it is
An MCP server that documents a codebase by traversal rather than by prompt. It starts at leaf directories and works upward, writing a file at each level and folding child output into the parent, so the top-level overview is built from what was actually written below it.
What you get
- Documentation generated for a repository, written as
documentation.mdat each qualifying directory —generate_documentation - Test plans with test types, edge cases and mock requirements, written as
testplan.md—autotestplan - A senior-developer-level code review focused on security, best practices and improvements, written as
review.md—autoreview - All three take the same arguments:
path, an optionalopenRouterApiKey, an optionalmodel, andupdateExistingwhich defaults to true - Directory handling that avoids noise —
.gitignorepatterns respected, single-file directories skipped but their content folded into the parent, and fallback files created for directories that exceed limits - Progress reporting during long runs so the call does not look stalled
- Prompts kept in one place —
src/prompt-config.ts— so tone and project-specific instructions can be changed without touching tool code
Requirements
An OpenRouter API key, set as OPENROUTER_API_KEY — it calls a model per directory, so this is a metered operation. Node.js v16 or newer. Clone, npm install, npm run build, then point the client at build/index.js with node. Tuning is by environment variable: OPENROUTER_MODEL (default anthropic/claude-3-7-sonnet), MAX_FILE_SIZE_KB (default 100) and MAX_FILES_PER_DIR (default 20).
Setup effort
Build from source — git clone https://github.com/PARS-DOE/autodocument.git
USE CASES
Documenting a codebase nobody wrote docs for
Run the generator over the repository and get a documentation.md at each level, with the top-level overview built from the ones below it.
Working out what to test
Generate test plans that name the test types, edge cases and mocks each area needs.
Getting a security-minded read on unfamiliar code
Run the review pass and read the review.md files it leaves behind.
Making the output sound like your team
Edit the prompt configuration file rather than the tool code, and re-run.
3 tools
Listed in project docs. Your client may show a different list.
autotestplanautoreviewBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- Node.js
- OPENROUTER_API_KEY in your environment
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
# Clone the repository
git clone https://github.com/PARS-DOE/autodocument.git
cd autodocument
# Install dependencies
npm install
# Build the project
npm run buildMCP Clients
Roo Code, Claude Desktop
{
"mcpServers": {
"autodocument": {
"command": "node",
"args": [
"<YOUR_PATH_TO_AUTODOCUMENT>/build/index.js"
],
"env": {
"OPENROUTER_API_KEY": "<YOUR_OPENROUTER_API_KEY>"
},
"disabled": false,
"alwaysAllow": []
}
}
}