mcp-api-doc-generator
v1.1.4
Published
MCP server for generating API documentation — OpenAPI 3.1 specs, endpoint docs, TypeScript SDKs, validation, and test suites
Downloads
139
Maintainers
Readme
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
| Plan | Price | Includes | |------|-------|----------| | Basic | $10/mo | generate_openapi, document_endpoint, validate_api — Buy → | | Pro | $20/mo | All 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
$refschemas incomponents/schemasfor 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
ApiErrorclass 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 nameapi-doc-generator).
No install step needed — run straight from npm:
npx -y mcp-api-doc-generatorOr install globally:
npm install -g mcp-api-doc-generatorFree 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-generatorSSE
npx -y mcp-api-doc-generator --sse
# Listens on http://127.0.0.1:3000 by default
# Set PORT env var to changeClaude 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 modeLicense
MIT
