🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

mcp-api-doc-generator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-api-doc-generator

MCP server for generating API documentation — OpenAPI 3.1 specs, endpoint docs, TypeScript SDKs, validation, and test suites

latest
Source
npmnpm
Version
1.1.4
Version published
Maintainers
1
Created
Source

API Doc Generator MCP Server

Dev tools MCP server for generating API documentation. Produces OpenAPI 3.1 specs, endpoint docs with code examples, TypeScript SDKs, API validation reports, and test suites -- all from simple endpoint definitions.

Pricing

PlanPriceIncludes
Basic$10/mogenerate_openapi, document_endpoint, validate_api — Buy →
Pro$20/moAll tools: generate_openapi, document_endpoint, generate_sdk, validate_api, generate_tests — Buy →

Free trial: 3 calls total (shared across all tools), no credit card. License keys are emailed instantly after checkout. More info: aivp-mcp.vercel.app

Tools

generate_openapi

Generate an OpenAPI 3.1 specification from endpoint definitions. Outputs YAML or JSON with:

  • Paths, parameters, and operations
  • $ref schemas in components/schemas for reusable models
  • Security schemes (Bearer JWT, API Key, Basic)
  • Server URLs, tags, and grouping

document_endpoint

Generate detailed Markdown documentation for a single endpoint:

  • Parameter tables with types and descriptions
  • Request/response examples with realistic data
  • Error response documentation (400, 401, 403, 404, 500)
  • cURL command example
  • JavaScript (fetch) code example
  • Python (requests) code example

generate_sdk

Generate a TypeScript SDK client from endpoint definitions:

  • Typed interfaces for all request/response models
  • Client class with a method per endpoint
  • ApiError class with status helpers (isNotFound(), isUnauthorized(), etc.)
  • withRetry() helper for exponential backoff on 5xx/429
  • Authentication wrappers: BearerAuth, ApiKeyAuth, BasicAuth
  • Timeout and abort signal support

validate_api

Validate an OpenAPI spec (YAML or JSON):

  • Schema correctness (required fields, valid methods)
  • Missing descriptions and documentation
  • Inconsistent naming conventions (kebab-case vs snake_case vs camelCase)
  • Missing error responses
  • Security scheme completeness
  • Returns issues categorized as errors/warnings/suggestions with specific fix suggestions

generate_tests

Generate test suites from endpoint definitions:

  • Happy path tests
  • Validation tests (missing required fields)
  • Edge case tests (empty strings, null values, extra fields)
  • Authentication tests (401 without auth)
  • HTTP method tests (wrong method rejection)
  • Response structure checks
  • Mock data generator functions
  • Output as Jest or Vitest test files

Installation

Note: the npm package is mcp-api-doc-generator (not the bare name api-doc-generator).

No install step needed — run straight from npm:

npx -y mcp-api-doc-generator

Or install globally:

npm install -g mcp-api-doc-generator

Free trial: 3 calls total (shared across all tools), no credit card. Buy a license at the links in Pricing — your key is emailed instantly. Activate it with the LICENSE_KEY environment variable.

Usage

Stdio (default)

npx -y mcp-api-doc-generator

SSE

npx -y mcp-api-doc-generator --sse
# Listens on http://127.0.0.1:3000 by default
# Set PORT env var to change

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "api-doc-generator": {
      "command": "npx",
      "args": ["-y", "mcp-api-doc-generator"],
      "env": { "LICENSE_KEY": "<your license key — omit for free trial>" }
    }
  }
}

Examples

Generate OpenAPI spec

{
  "tool": "generate_openapi",
  "arguments": {
    "endpoints": [
      {
        "method": "GET",
        "path": "/users",
        "description": "List all users",
        "parameters": [
          { "name": "page", "in": "query", "type": "integer", "description": "Page number" },
          { "name": "limit", "in": "query", "type": "integer", "description": "Items per page" }
        ],
        "response": {
          "status": 200,
          "type": "object",
          "properties": {
            "users": { "type": "array", "description": "List of users" },
            "total": { "type": "integer", "description": "Total count" }
          }
        }
      },
      {
        "method": "POST",
        "path": "/users",
        "description": "Create a new user",
        "request_body": {
          "type": "object",
          "properties": {
            "name": { "type": "string", "description": "User name" },
            "email": { "type": "string", "description": "User email" }
          },
          "required": ["name", "email"]
        },
        "response": {
          "status": 201,
          "type": "object",
          "properties": {
            "id": { "type": "string", "description": "User ID" },
            "name": { "type": "string", "description": "User name" },
            "email": { "type": "string", "description": "User email" }
          }
        },
        "auth_type": "bearer"
      }
    ],
    "info": {
      "title": "User Service API",
      "version": "1.0.0",
      "description": "API for managing users"
    }
  }
}

Generate TypeScript SDK

{
  "tool": "generate_sdk",
  "arguments": {
    "endpoints": [
      {
        "method": "GET",
        "path": "/users/{id}",
        "name": "getUser",
        "description": "Get a user by ID",
        "parameters": [
          { "name": "id", "in": "path", "type": "string", "required": true, "description": "User ID" }
        ],
        "response": {
          "status": 200,
          "type": "object",
          "properties": {
            "id": { "type": "string" },
            "name": { "type": "string" },
            "email": { "type": "string" }
          }
        },
        "auth_type": "bearer"
      }
    ],
    "base_url": "https://api.myapp.com"
  }
}

Validate an OpenAPI spec

{
  "tool": "validate_api",
  "arguments": {
    "spec": "{ \"openapi\": \"3.1.0\", \"info\": { \"title\": \"My API\", \"version\": \"1.0.0\" }, \"paths\": { \"/users/{id}\": { \"get\": { \"summary\": \"Get user\", \"responses\": { \"200\": { \"description\": \"OK\" } } } } } }"
  }
}

Development

npm run dev  # Watch mode

License

MIT

Keywords

mcp

FAQs

Package last updated on 04 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts