Autodocument MCP Server
About
An MCP (Model Context Protocol) server that automatically generates documentation for code repositories by analyzing directory structures and code files using OpenRouter API.
Details
- License
- CC0-1.0
Explore
- Smart Directory Analysis: Recursively analyzes directories and files in a code repository
- Git Integration: Respects .gitignore patterns to skip ignored files
- AI-Powered Documentation: Uses OpenRouter API (with Claude 3.7 by default) to generate comprehensive documentation
- Test Plan Generation: Automatically creates test plans with suitable test types, edge cases, and mock requirements
- Code Review: Performs senior developer-level code reviews focused on security, best practices, and improvements
- Bottom-Up Approach: Starts with leaf directories and works upward, creating a coherent documentation hierarchy
- Intelligent File Handling:
- Creates documentation.md, testplan.md, and review.md files at each directory level
- Skips single-file directories but includes their content in parent outputs
- Supports updating existing files
- Creates fallback files for directories that exceed limits
- Progress Reporting: Provides detailed progress updates to prevent timeouts in long-running operations
- Highly Configurable: Customize file extensions, size limits, models, prompts, and more
- Extensible Architecture: Modular design makes it easy to add more auto-* tools in the future
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Autodocument MCP ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
- Node.js (v16 or newer)
- An OpenRouter API key
npm install
- OPENROUTER_API_KEY: Your OpenRouter API key
- OPENROUTER_MODEL: Model to use (default: anthropic/claude-3-7-sonnet)
- MAX_FILE_SIZE_KB: Maximum file size in KB (default: 100)
- MAX_FILES_PER_DIR: Maximum number of files per directory (default: 20)
1. Clone and build the repository (follow the Installation Steps above)
2. Configure the MCP server:
export OPENROUTER_API_KEY=your-api-key-here
javascriptconst { spawn } = require('child_process');
const path = require('path');
// Path to your project
const projectPath = '/path/to/your/project';
// Your OpenRouter API key
const apiKey = 'your-api-key-here';
// Create a JSON command to simulate an MCP tool call
const toolCallCommand = JSON.stringify({
jsonrpc: '2.0',
method: 'call_tool',
params: {
name: 'generate_documentation',
arguments: {
path: projectPath,
openRouterApiKey: apiKey
}
},
id: 1
});
// Start the server process - use the full path to your cloned repository
const serverProcess = spawn('node', ['/path/to/autodocument/build/index.js'], {
env: {
...process.env,
OPENROUTER_API_KEY: apiKey
}
});
// Send the tool command
serverProcess.stdin.write(toolCallCommand + '\n');
// Handle server output and errors
// ...
```
The architecture is designed to make it easy to add new auto-* tools:
1. Create a new class that extends BaseTool in the src/tools directory
2. Define the prompts in src/prompt-config.ts
3. Register the tool in the ToolRegistry
See the existing tools for examples of how to implement new functionality.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"autodocument mcp server": {
"autodocument": {
"command": "node",
"args": [
"build/index.js",
"/path/to/your/project"
]
}
}
}
}
McpServers
{
"autodocument": {
"command": "node",
"args": [
"build/index.js",
"/path/to/your/project"
]
}
}
An MCP (Model Context Protocol) server that automatically generates documentation for code repositories by analyzing directory structures and code files using OpenRouter API.
Features
- Smart Directory Analysis: Recursively analyzes directories and files in a code repository
- Git Integration: Respects .gitignore patterns to skip ignored files
- AI-Powered Documentation: Uses OpenRouter API (with Claude 3.7 by default) to generate comprehensive documentation
- Test Plan Generation: Automatically creates test plans with suitable test types, edge cases, and mock requirements
- Code Review: Performs senior developer-level code reviews focused on security, best practices, and improvements
- Bottom-Up Approach: Starts with leaf directories and works upward, creating a coherent documentation hierarchy
- Intelligent File Handling:
- Creates documentation.md, testplan.md, and review.md files at each directory level
- Skips single-file directories but includes their content in parent outputs
- Supports updating existing files
- Creates fallback files for directories that exceed limits
- Progress Reporting: Provides detailed progress updates to prevent timeouts in long-running operations
- Highly Configurable: Customize file extensions, size limits, models, prompts, and more
- Extensible Architecture: Modular design makes it easy to add more auto-* tools in the future
Installation
Prerequisites
- Node.js (v16 or newer)
- An OpenRouter API key
Installation Steps
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



