npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gc-mcp/intelidoc

v1.0.0

Published

Intelligent Documentation Generator MCP Server - Automatically generates and maintains documentation based on code changes

Readme

Intelligent Documentation Generator MCP Server

An intelligent MCP server that automatically generates and maintains documentation based on code changes, keeping documentation in sync with code while maintaining high quality and comprehensive coverage.

Features

  • Intelligent Code Analysis: Automatically analyzes codebases to extract APIs, architecture, configurations, and business logic
  • Automatic Documentation Generation: Generates comprehensive documentation based on code changes
  • Gap Detection: Identifies missing, outdated, incomplete, or inaccurate documentation
  • Quality Assessment: Evaluates documentation quality and provides improvement recommendations
  • Smart Updates: Automatically updates documentation when code changes
  • Multiple Formats: Supports various documentation formats (Markdown, OpenAPI, Swagger, HTML)

Installation

npm install @gc-mcp/intelligent-documentation-generator

Usage

As MCP Server

npx mcp-doc-generator

Programmatic Usage

import { CodeAnalysisEngine } from "@gc-mcp/intelligent-documentation-generator";

const engine = new CodeAnalysisEngine();
const analysis = await engine.analyzeCode(codeBase);

MCP Tools

1. generate_documentation_intelligence

Intelligently generate documentation based on code changes.

Parameters:

  • code_base: Code base information
  • changes: List of code changes
  • documentation_type: Type of documentation to generate (api, architecture, deployment, configuration, troubleshooting, user_guide)
  • target_audience: Target audience (developers, devops, users, stakeholders)
  • generation_depth: Depth of generation (basic, detailed, comprehensive)

2. update_documentation_automatically

Automatically update documentation based on code changes.

Parameters:

  • changes: List of code changes
  • documentation_path: Path to documentation files
  • update_strategy: Update strategy (conservative, aggressive, selective)
  • review_required: Whether updates require review

3. detect_documentation_gaps

Detect gaps between code and documentation.

Parameters:

  • code_base: Code base information
  • documentation: Current documentation
  • gap_types: Types of gaps to detect (missing, outdated, incomplete, inaccurate)
  • coverage_threshold: Minimum coverage threshold

4. suggest_documentation_improvements

Suggest improvements to existing documentation.

Parameters:

  • documentation: Current documentation to improve
  • improvement_goals: Goals for improvement (clarity, completeness, accuracy, usability, consistency)
  • target_audience: Target audience for the documentation
  • improvement_scope: Scope of improvements (content, structure, format, all)

5. maintain_api_documentation

Maintain API documentation in sync with code.

Parameters:

  • api_changes: List of API changes
  • current_documentation: Current API documentation
  • documentation_format: Format for API documentation (openapi, swagger, markdown, html)
  • include_examples: Include code examples

Configuration

Set the following environment variables:

# Documentation Configuration
DOCUMENTATION_FORMAT=markdown
TEMPLATE_PATH=./templates
OUTPUT_PATH=./docs

# Quality Configuration
QUALITY_THRESHOLD=0.8
AUTO_UPDATE_ENABLED=true
REVIEW_REQUIRED=true

# Analysis Configuration
ANALYSIS_DEPTH=detailed
INCLUDE_EXAMPLES=true
GENERATE_DIAGRAMS=true

Architecture

Core Components

  1. Code Analysis Engine: Analyzes codebases to extract structured information
  2. Documentation Generator: Generates documentation based on code analysis
  3. Gap Detector: Identifies documentation gaps and inconsistencies
  4. Quality Assessor: Evaluates documentation quality and provides recommendations
  5. Documentation Updater: Automatically updates documentation when code changes

Supported Documentation Types

  • API Documentation: REST, gRPC, GraphQL APIs
  • Architecture Documentation: Components, relationships, patterns, principles
  • Configuration Documentation: Settings, properties, examples
  • Deployment Documentation: Installation, configuration, running instructions
  • Troubleshooting Documentation: Common issues and solutions
  • User Guides: End-user documentation

Quality Metrics

The server assesses documentation quality across multiple dimensions:

  • Completeness: Percentage of complete documentation sections
  • Accuracy: Average confidence score of documentation sections
  • Clarity: Writing clarity and structure assessment
  • Consistency: Consistency across documentation sections
  • Usability: Navigation, searchability, and user experience

Examples

Generate API Documentation

const result = await mcpServer.callTool("generate_documentation_intelligence", {
  code_base: {
    controllers: [
      {
        name: "UserController",
        methods: [
          {
            path: "/users",
            method: "GET",
            description: "Get all users",
          },
        ],
      },
    ],
  },
  changes: [
    {
      type: "api",
      file: "src/controllers/user.ts",
      description: "Added new user endpoints",
      impact: "medium",
      affectedComponents: ["UserController"],
      breakingChange: false,
    },
  ],
  documentation_type: "api",
  target_audience: "developers",
  generation_depth: "detailed",
});

Detect Documentation Gaps

const result = await mcpServer.callTool("detect_documentation_gaps", {
  code_base: {
    apis: [{ name: "UserAPI", sourceFiles: ["src/api/user.ts"] }],
  },
  documentation: {
    sections: [
      {
        type: "api",
        title: "UserAPI Documentation",
        content: "API documentation content",
      },
    ],
  },
  gap_types: ["missing", "outdated"],
  coverage_threshold: 0.8,
});

Development

Setup

git clone <repository>
cd packages/intelligent-documentation-generator
npm install

Build

npm run build

Test

npm test

Lint

npm run lint

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Support

For issues and questions, please open an issue on the repository.