generate_openapi
Builds an OpenAPI 3.1 specification in YAML or JSON from endpoint definitions, including paths, parameters, reusable schemas, server URLs, tags, error responses, and supported authentication schemes.
Developer tools / MCP server
mcp-api-doc-generator gives an agent five focused tools for producing
OpenAPI 3.1 specs, Markdown endpoint documentation, a TypeScript client SDK,
validation reports, and Jest or Vitest test source.
$ npx -y mcp-api-doc-generator
API Doc Generator MCP server running on stdio
What it does
generate_openapiBuilds an OpenAPI 3.1 specification in YAML or JSON from endpoint definitions, including paths, parameters, reusable schemas, server URLs, tags, error responses, and supported authentication schemes.
document_endpointProduces Markdown for one endpoint with parameter and schema tables, request and response examples, standard error documentation, and cURL, JavaScript fetch, and Python requests examples.
generate_sdk Pro
Generates TypeScript interfaces and an API client with endpoint methods, timeout
handling, ApiError, retry support, and Bearer, API Key, and Basic
authentication wrappers.
validate_apiChecks supplied OpenAPI JSON or basic YAML and returns errors, warnings, and suggestions with rule names, document paths, and concrete fixes.
generate_tests ProGenerates Jest or Vitest source covering successful responses, required fields, edge values, authentication, wrong methods, response shape, and mock data helpers.
Agent use cases
The agent supplies explicit endpoint definitions or spec text. The server returns generated text to the MCP client.
After defining a new endpoint, ask the agent to produce a versioned OpenAPI 3.1 YAML document with reusable request and response schemas.
Shipped tool: generate_openapi
{
"tool": "generate_openapi",
"arguments": {
"endpoints": [
{
"method": "POST",
"path": "/widgets",
"name": "createWidget",
"description": "Create a widget",
"request_body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Widget name"
}
},
"required": ["name"]
},
"response": {
"status": 201,
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" }
}
},
"auth_type": "bearer",
"tags": ["widgets"]
}
],
"info": {
"title": "Widgets API",
"version": "1.0.0",
"description": "API for widgets",
"base_url": "https://api.example.com"
},
"format": "yaml"
}
}
Give the agent endpoint shapes and a base URL, then receive TypeScript source with typed path parameters, response models, a client method, and authentication support.
Shipped tool: generate_sdk
{
"tool": "generate_sdk",
"arguments": {
"endpoints": [
{
"method": "GET",
"path": "/widgets/{id}",
"name": "getWidget",
"description": "Get a widget by ID",
"parameters": [
{
"name": "id",
"in": "path",
"type": "string",
"required": true,
"description": "Widget ID"
}
],
"response": {
"status": 200,
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" }
}
},
"auth_type": "api_key"
}
],
"base_url": "https://api.example.com"
}
}
Pass OpenAPI text to the agent and get a categorized report. Errors determine the validity result; warnings and suggestions identify documentation and consistency gaps.
Shipped tool: validate_api
{
"tool": "validate_api",
"arguments": {
"spec": "{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Widgets API\",\"version\":\"1.0.0\"},\"paths\":{}}"
}
}
Install & connect
~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json. In the app: Settings → Developer → Edit Config.
~/.cursor/mcp.json
Or .cursor/mcp.json inside a single project.
~/.codeium/windsurf/mcp_config.json
Cascade panel → MCP icon → edit the raw config.
All three clients accept the same object. If the file already has an mcpServers block, add just the "api-doc-generator" entry inside it.
{
"mcpServers": {
"api-doc-generator": {
"command": "npx",
"args": ["-y", "mcp-api-doc-generator"]
}
}
}
No env block is needed to start: the first 3 tool calls total across this server's tools run without a license.
$ claude mcp add --transport stdio api-doc-generator -- npx -y mcp-api-doc-generator
Check it registered with claude mcp list. Add a key later with --env LICENSE_KEY=your-key placed before --transport.
claude mcp list and look for ✔ Connected.Running npx -y mcp-api-doc-generator in a terminal looks frozen — that is correct. It is a stdio server: it waits silently for an MCP client on stdin and never returns a prompt. Press Ctrl+C to exit. Use the config above rather than the bare command; your client starts the process for you.
A key arrives on screen right after checkout. Add it as an environment variable in the same entry:
{
"mcpServers": {
"api-doc-generator": {
"command": "npx",
"args": ["-y", "mcp-api-doc-generator"],
"env": {
"LICENSE_KEY": "paste-your-key-here"
}
}
}
}
Keys are verified offline against a public key compiled into the package — no account, no network check, no usage reporting. Lost the key? Recover it here. More detail on the FAQ.
Free behavior & plans
Without a license key, the package allows 3 calls total, shared across all
tools—not three per tool, and not three per day. It is a one-off trial with
no credit card. It normally records the usage count in
~/.aivp-mcp/usage.json, so restarting the process does not reset the trial.
If that file cannot be used, counting falls back to memory for the process.
A purchased key removes the trial counter and unlocks unlimited, ungated calls to the tools in your plan. It is verified fully offline against a public key compiled into the package—no account, no network check, no usage reporting—and stays valid for 365 days.
Basic · $10/month
Unlimited, licensed access to generate_openapi,
document_endpoint, and validate_api. The Pro-only tools
generate_sdk and generate_tests are not included in
Basic.
Pro · $20/month
Adds unlimited use of the Pro-only tools generate_sdk and
generate_tests to every Basic tool.
Scope
It does not inspect a repository or parse Express, FastAPI, Hono, or other framework source. Generation starts from endpoint definitions supplied in the tool call.
It does not call a target API, host documentation, publish a specification, or run the SDK and test source it generates.
OpenAPI output is YAML or JSON. Endpoint documentation is Markdown, the SDK is TypeScript, and test output is Jest or Vitest TypeScript source.
Tool handlers return text through MCP; they do not write endpoint definitions, supplied specs, or generated material to project files. Local storage is limited to free-trial usage accounting.
Start with explicit inputs