Autodocument MCP Server

Autodocument MCP Server

autodocument•bypars-doe

An MCP server that recursively analyzes code repositories using the OpenRouter API to generate documentation, test plans, and code reviews.

License: CC0-1.0•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Generates comprehensive documentation for a code repository, writing documentation.md files at each qualifying directory level.
  • •Generates test plans covering suitable test types, edge cases, and mock requirements.
  • •Performs senior developer-level code reviews focused on security, best practices, and improvements.
  • •Works bottom-up through the directory tree, creating a coherent documentation hierarchy that respects .gitignore rules.

BEST FOR

  • •Developers wanting to auto-generate documentation for a code repository.
  • •Teams needing generated test plans for functions and components.
  • •Users wanting automated senior-level code reviews highlighting security and best-practice issues.

ABOUT AUTODOCUMENT

Autodocument MCP Server is cataloged as an MCP server attributed to pars-doe. An MCP server that recursively analyzes code repositories using the OpenRouter API to generate documentation, test plans, and code reviews. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: CC0-1.0. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Autodocument MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which model does the server use by default?

It uses anthropic/claude-3-7-sonnet by default, configurable via the OPENROUTER_MODEL variable.

Can the prompts used by the tools be customized?

Yes, prompts are managed in src/prompt-config.ts and can be edited without changing tool code.

上游原版 README

在 GitHub 查看同一版本原文

README.md · a94501681081 · 采集于 2026-11-13 10:30:53 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Autodocument MCP Server

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

Installation Steps

# Clone the repository
git clone https://github.com/PARS-DOE/autodocument.git
cd autodocument

# Install dependencies
npm install

# Build the project
npm run build

Configuration

Configure autodocument using environment variables, command-line arguments, or an MCP configuration file:

Environment Variables

  • 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)

Using with Roo or Cline

Roo Code and Cline are AI assistants that support the Model Context Protocol (MCP), which allows them to use external tools like autodocument.

Setup for Roo/Cline

  1. Clone and build the repository (follow the Installation Steps above)

  2. Configure the MCP server:

    For Roo:

    In the MCP Servers menu, Edit the MCP Settings and add the autodocument configuration using the full path to where you cloned the repository:

    Add the autodocument configuration using the full path to where you cloned the repository:

    {
      "mcpServers": {
        "autodocument": {
          "command": "node",
          "args": ["/path/to/autodocument/build/index.js"],
          "env": {
            "OPENROUTER_API_KEY": "your-api-key-here"
          },
          "disabled": false,
          "alwaysAllow": []
        }
      }
    }
    

    For Claude Desktop App:

    Edit the Claude desktop app configuration file at:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json

    Add the autodocument configuration using the full path to where you cloned the repository:

    {
      "mcpServers": {
        "autodocument": {
          "command": "node",
          "args": ["/path/to/autodocument/build/index.js"],
          "env": {
            "OPENROUTER_API_KEY": "your-api-key-here"
          },
          "disabled": false,
          "alwaysAllow": []
        }
      }
    }
    
  3. Important: Make sure to use absolute paths to the build/index.js file in your cloned repository

  4. Restart Roo/Cline or the Claude desktop app

  5. Use the tool: In a conversation with Roo or Claude, you can now ask it to generate documentation or test plans for your code repository:

    Please generate documentation for my project at /path/to/my/project
    

    Or for test plans:

    Please create a test plan for my project at /path/to/my/project
    

    Or for code reviews:

    Please review the code in my project at /path/to/my/project
    

How It Works

The autodocument server works using a bottom-up approach:

  1. Discovery: Scans the target directory recursively, respecting .gitignore rules
  2. Smart Directory Processing:
    • Identifies directories with multiple code files or subdirectories
    • Skips single-file directories but includes their content in parent documentation
  3. File Analysis: Analyzes code files, filtering by extension and size
  4. Documentation Generation: For each qualifying directory:
    • Reads code files
    • Sends code to OpenRouter API with optimized prompts
    • Creates a documentation.md file (or updates existing one)
  5. Aggregation: As it moves up the directory tree:
    • Processes each parent directory
    • Includes documentation from child directories
    • Creates a comprehensive overview at each level

Architecture

The project follows a modular architecture:

  • Core Components: Configuration management and server implementation
  • Crawler Module: Directory traversal and file discovery
  • Analyzer Module: Code file analysis and filtering
  • OpenRouter Module: AI integration for LLM-based content generation
  • Documentation Module: Orchestration of the documentation process
  • Tools Module: Extensible system for different auto-* tools (documentation, test plans, etc.)
  • Prompts Configuration: Centralized prompt management for easy customization

Example Usage

Command Line

# Navigate to your cloned repository
cd path/to/cloned/autodocument

# Set your API key (or configure in environment variables)
export OPENROUTER_API_KEY=your-api-key-here

# Run documentation generation on a project
node build/index.js /path/to/your/project

Programmatic Usage

const { 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
// ...

Customizing Prompts

You can easily customize the prompts used by the tools by editing the src/prompt-config.ts file. This allows you to:

  • Adjust the tone and style of generated content
  • Add specific instructions for your project's needs
  • Modify how existing content is updated

The prompt configuration is separated from the tool implementation, making it easy to experiment with different prompts without changing the code.

Available Tools

generate_documentation

Generates comprehensive documentation for a code repository:

{
  "path": "/path/to/your/project",
  "openRouterApiKey": "your-api-key-here", // Optional
  "model": "anthropic/claude-3-7-sonnet", // Optional
  "updateExisting": true // Optional, defaults to true
}

autotestplan

Generates test plans for functions and components in a code repository:

{
  "path": "/path/to/your/project",
  "openRouterApiKey": "your-api-key-here", // Optional
  "model": "anthropic/claude-3-7-sonnet", // Optional
  "updateExisting": true // Optional, defaults to true
}

autoreview

Generates a senior developer-level code review for a repository:

{
  "path": "/path/to/your/project",
  "openRouterApiKey": "your-api-key-here", // Optional
  "model": "anthropic/claude-3-7-sonnet", // Optional
  "updateExisting": true // Optional, defaults to true
}

Output Files

The server creates several types of output files:

documentation.md

Contains comprehensive documentation of the code in a directory, including:

  • Purpose of the code
  • Key functions and classes
  • Relationships between files
  • Integration with child components

testplan.md

Contains detailed test plans for code in a directory, including:

  • Appropriate test types (unit, integration, e2e) for each function
  • Common edge cases to test
  • Dependency mocking requirements
  • Integration testing strategies

review.md

Contains senior developer-level code review feedback, including:

  • Security issues and vulnerabilities
  • Best practice violations
  • Potential bugs or architectural concerns
  • Opportunities for refactoring
  • Practical, constructive feedback (not nitpicking style issues)

Fallback Files

Created when a directory exceeds size or file count limits:

  • undocumented.md - For documentation generation
  • untested.md - For test plan generation
  • review-skipped.md - For code review generation

These files contain:

  • Reason for skipping processing
  • List of files that were analyzed and excluded
  • Instructions on how to fix (increase limits or manually create content)

Troubleshooting

API Key Issues

If you see errors about invalid API key:

  • Ensure you've set the OPENROUTER_API_KEY environment variable
  • Check that your OpenRouter account is active
  • Verify you have sufficient credits for the API calls

Size Limit Errors

If too many directories are skipped due to size limits:

  • Set environment variables to increase limits: MAX_FILE_SIZE_KB and MAX_FILES_PER_DIR
  • Consider documenting very large directories manually

Model Selection

If you're not satisfied with the documentation quality:

  • Try a different model by setting the OPENROUTER_MODEL environment variable

License

CC0-1.0 License - This work is dedicated to the public domain under CC0 by the United States Department of Energy

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Adding New Tools

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.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Autodocument MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/autodocument)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools