Skip to main content
Glama
Documentation MCP Server

Documentation MCP Server

by ThaLoc0one

πŸ“š Documentation MCP Server

A Model Context Protocol (MCP) Server for generating professional documentation with support for multiple frameworks.

✨ Features

  • πŸ” Deep Code Analysis - AST-based Multi-Language Analysis

    • TypeScript/JavaScript: TypeScript Compiler API

    • Python: Native Python AST module

    • Go: Go parser & AST

    • PHP: Regex-based analysis + PHP 8+ Features

    • Extracts classes, functions, interfaces, methods, properties

    • PHP 8+: Enums, Traits, Attributes

    • Captures JSDoc/Docstrings/Go Doc/PHPDoc and calculates documentation coverage

    • Analyzes imports/exports and module dependencies

  • 🌍 Multi-Language Projects - Automatic detection and parallel analysis of multiple languages

  • πŸ“Š Project Analysis - Automatic code analysis for TypeScript, JavaScript, Python, Go, PHP

  • πŸ—οΈ Structure Generation - Creates complete documentation scaffolds

  • ✍️ Page Editor - Creates and edits individual documentation pages

  • πŸ“– API Documentation - Generates API docs from code comments

  • 🌐 Static Site Builder - Builds static websites for hosting

  • πŸ“„ PDF Export - Converts documentation to PDF

  • πŸ‘€ Live Preview - Local development server

πŸ› οΈ Supported Frameworks

  • Docusaurus (React-based, modern, various templates)

  • MkDocs (Python-based, Markdown-focused, simple)

  • Sphinx (Python, very powerful, for complex projects)

πŸš€ Quick Start

  1. Install globally:

    npm install -g documentation-mcp-server
  2. Configure in Claude Desktop (see SETUP.md):

    {
      "mcpServers": {
        "docs": {
          "command": "npx",
          "args": ["-y", "documentation-mcp-server"]
        }
      }
    }
  3. Start using the documentation tools in Claude!

πŸ“¦ Tools

docs_analyze_project

Analyzes project structure and performs deep code analysis.

Parameters:

  • projectPath (string, required) - Path to project

  • language (enum, optional) - Programming language (typescript, javascript, python, go, rust, java, csharp)

  • deep (boolean, optional, default: true) - Enables deep code analysis

Deep Analysis Features:

  • πŸ“¦ Extracts Classes/Structs, Interfaces, Functions, Enums, Type Aliases

  • πŸ” Captures Methods, Properties, Constructors with complete details

  • πŸ“ Analyzes JSDoc/Docstrings/Go Doc and calculates documentation coverage

  • πŸ”— Tracks Imports/Exports and Module Dependencies

  • πŸ“Š Generates summary statistics

  • 🎯 Multi-Language Support:

    • βœ… TypeScript/JavaScript (TypeScript Compiler API)

    • βœ… Python (Native Python AST)

    • βœ… Go (go/parser & go/ast)

    • βœ… PHP v2 (nikic/php-parser AST) - New! 100% accurate

      • Namespaces & Use-Statements

      • Union/Intersection/Nullable Types

      • Enums, Traits, Attributes (PHP 8+)

      • Framework Detection:

        • CodeIgniter 3/4 (Controller, Model)

        • Laravel (Illuminate*)

        • Symfony (Symfony*)

        • MVC Pattern Recognition

      • Route Detection: πŸš€

        • Convention-based: /controller/method/{param}

        • Attribute-based: #[Get('/')], #[Post('/')]

        • HTTP Methods: GET, POST, PUT, PATCH, DELETE

        • Parameter Types & Required/Optional Status

      • Middleware Detection: πŸ”’

        • Laravel: #[Middleware('auth')]

        • Symfony: #[IsGranted('ROLE_ADMIN')]

        • CodeIgniter 4: #[Filter('auth')]

        • CodeIgniter 3: @middleware (Docblocks)

        • Class-Level & Method-Level

        • Middleware Parameters

      • OpenAPI 3.0 Export: πŸ“‹

        • Auto-generates Swagger/OpenAPI specs

        • Routes β†’ Paths conversion

        • Middleware β†’ Security Schemes

        • JSON & YAML format support

    • βœ… PHP v1 (Regex-based) - Fallback

    • 🌍 Automatic Multi-Language Detection

    • πŸ”œ Rust, Java, C# (planned)

Example Response:

{
  "deepAnalysis": {
    "summary": {
      "totalFiles": 11,
      "totalClasses": 2,
      "totalInterfaces": 23,
      "totalFunctions": 16,
      "overallDocCoverage": 3.17
    }
  }
}

docs_generate_structure

Generates documentation scaffold.

Parameters:

  • projectPath (string, required) - Path to project

  • framework (enum, required) - docusaurus | mkdocs | sphinx

  • template (string, optional) - Template name

  • outputPath (string, optional) - Output path (default: ./docs)

docs_create_page

Creates or edits documentation page.

Parameters:

  • docsPath (string, required) - Path to docs

  • pagePath (string, required) - Relative path to page

  • title (string, required) - Page title

  • content (string, required) - Markdown content

docs_generate_api

Generates API documentation from code.

Parameters:

  • projectPath (string, required) - Path to source code

  • outputPath (string, required) - Output path

  • language (enum, required) - Programming language

docs_build_static

Builds static website.

Parameters:

  • docsPath (string, required) - Path to docs

  • framework (enum, required) - Framework

  • outputPath (string, optional) - Output path (default: ./build)

docs_export_pdf

Exports documentation as PDF.

Parameters:

  • docsPath (string, required) - Path to docs

  • outputPath (string, required) - PDF output path

  • includePages (array, optional) - Specific pages

docs_preview

Starts local dev server.

Parameters:

  • docsPath (string, required) - Path to docs

  • framework (enum, required) - Framework

  • port (number, optional) - Port (default: 3000/8000)

docs_generate_openapi

Generates OpenAPI 3.0 specification from PHP code.

Parameters:

  • projectPath (string, required) - PHP project path

  • outputPath (string, optional) - Output path (default: ./openapi.json)

  • format (enum, optional) - json | yaml (default: json)

  • title (string, optional) - API title

  • version (string, optional) - API version

  • serverUrl (string, optional) - API server URL

docs_generate_sales_docs 🎯 NEW!

Generates professional, sales-ready documentation for CodeCanyon, ThemeForest, etc.

Parameters:

  • projectPath (string, required) - PHP project path

  • outputDir (string, optional) - Output directory (default: ./sales-docs)

  • productName (string, required) - Product name

  • productVersion (string, optional) - Version (default: 1.0.0)

  • author (string, required) - Author/Company

  • description (string, required) - Product description

  • price (string, optional) - Price (e.g., "$49")

  • demoUrl (string, optional) - Live demo URL

  • supportEmail (string, optional) - Support email

  • features (array, optional) - List of key features

Generated Files:

  1. README.md (2.5 KB) - Product overview with features, statistics, requirements

  2. INSTALLATION.md (3.2 KB) - Step-by-step setup guide

  3. API_REFERENCE.md (24.2 KB) - Complete API documentation

  4. CONFIGURATION.md (2.1 KB) - Environment variables, security

  5. EXAMPLES.md (4.0 KB) - Code examples (JS, PHP, Python)

  6. FAQ.md (2.2 KB) - Frequently asked questions

  7. CHANGELOG.md (0.9 KB) - Version history

  8. COMPLETE_DOCUMENTATION.md (39.0 KB) - All-in-one for PDF

Total: ~78 KB professional documentation!

πŸ—οΈ Architecture

src/
β”œβ”€β”€ index.ts                    # MCP Server main file
β”œβ”€β”€ core/                       # Core modules for deep analysis
β”‚   β”œβ”€β”€ types.ts               # Type definitions for all languages
β”‚   └── analyzer.ts            # Abstract base class & factory
β”œβ”€β”€ analyzers/                  # Language-specific analyzers
β”‚   β”œβ”€β”€ typescript.ts          # TypeScript/JavaScript (TS Compiler API)
β”‚   β”œβ”€β”€ python.ts              # Python wrapper (subprocess)
β”‚   β”œβ”€β”€ go.ts                  # Go wrapper (subprocess)
β”‚   └── helpers/               # Native language parsers
β”‚       β”œβ”€β”€ python_analyzer.py # Python AST parser
β”‚       └── go_analyzer.go     # Go AST parser
└── tools/                      # MCP tool implementations
    β”œβ”€β”€ analyzeProject.ts      # Deep analysis integration
    β”œβ”€β”€ generateStructure.ts
    β”œβ”€β”€ createPage.ts
    β”œβ”€β”€ generateApi.ts
    β”œβ”€β”€ buildStatic.ts
    β”œβ”€β”€ exportPdf.ts
    └── preview.ts

πŸ”¬ Deep Analysis Pipeline

  1. File Scanning - Scans project directory

  2. Language Detection - Detects dominant programming language

  3. Analyzer Selection - Selects appropriate AST parser (Factory Pattern)

  4. AST Parsing - Parses code files with language-specific parser

    • TypeScript: TS Compiler API (in-process)

    • Python: Python AST module (subprocess)

    • Go: go/parser & go/ast (subprocess)

  5. Symbol Extraction - Extracts all code symbols (Classes, Functions, etc.)

  6. Documentation Analysis - Captures documentation comments

  7. Summary Generation - Calculates statistics and coverage

πŸ“ License

MIT

Available Tools

9 tools
docs_analyze_projectA

Analyze project structure and perform deep code analysis to understand the project for documentation generation. Supports TypeScript, JavaScript, Python, Go, and more. Deep analysis extracts classes, functions, interfaces, documentation coverage, and more.

Inputs: projectPath (required), language, deep.

docs_build_staticA

Build static website for online hosting (ready for GitHub Pages, Netlify, Vercel, etc.)

Inputs: docsPath (required), framework (required), outputPath.

docs_create_pageB

Create or edit individual documentation pages with Markdown content

Inputs: docsPath (required), pagePath (required), title (required), content (required).

docs_export_pdfB

Generate PDF from documentation using Puppeteer/Playwright

Inputs: docsPath (required), outputPath (required), includePages.

docs_generate_apiC

Generate API documentation from code (JSDoc, Docstrings, etc.)

Inputs: projectPath (required), outputPath (required), language (required).

docs_generate_openapiA

Generate OpenAPI 3.0 specification from analyzed PHP routes with middleware, parameters, and security schemes. Automatically converts controller routes to API documentation.

Inputs: projectPath (required), outputPath, format, title, +2 more.

docs_generate_sales_docsB

Generate professional sales-ready documentation for CodeCanyon, ThemeForest, and other marketplaces. Creates comprehensive Markdown documentation (README, Installation, API Reference, Configuration, Examples, FAQ, Changelog) with optional PDF export.

Inputs: projectPath (required), productName (required), author (required), description (required), +6 more.

docs_generate_structureB

Generate documentation scaffold/structure based on project analysis. Creates initial directory structure and configuration files.

Inputs: projectPath (required), framework (required), template, outputPath.

docs_previewB

Start local development server to preview documentation

Inputs: docsPath (required), framework (required), port.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 9 tools

    Disambiguation4/5

    Tools have distinct purposes, though docs_generate_api and docs_generate_openapi could be confused as both generate API documentation, but from different sources (code vs routes). The descriptions clarify the difference.

    Naming Consistency5/5

    All tools follow a consistent 'docs_verb_noun' pattern (e.g., docs_analyze_project, docs_build_static, docs_create_page). No mixed naming conventions.

    Tool Count5/5

    9 tools is well-scoped for a documentation server, covering analysis, generation, editing, building, exporting, and previewing without unnecessary bloat or deficiency.

    Completeness5/5

    The toolset provides a complete lifecycle: analyze project, generate structure, create/edit pages, generate API/OpenAPI/sales docs, build static site, export PDF, and preview. No obvious gaps.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors