AWS Labs MCP server for OpenAPI specs
## OpenAPI MCP Server: API Specification and Documentation The **OpenAPI MCP Server** integrates OpenAPI specification management into Google Antigravity, enabling AI-assisted API design, documentation generation, and client SDK creation from OpenAPI/Swagger definitions. ### Why OpenAPI MCP? - **Spec-First Design**: Design APIs using OpenAPI specifications before implementation - **Documentation Generation**: Auto-generate interactive API documentation from specs - **Client Generation**: Generate type-safe client SDKs in multiple programming languages - **Validation**: Validate API implementations against specifications for compliance - **Mock Servers**: Create mock servers from specs for frontend development ### Key Features #### 1. Spec Management ```python from anthropic import Anthropic client = Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Parse the OpenAPI spec and list all endpoints with their request/response schemas" }] ) ``` #### 2. Documentation ```python # Generate docs response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Generate interactive API documentation from the OpenAPI specification" }] ) ``` #### 3. Client Generation ```python # Create SDK response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Generate TypeScript client SDK from the OpenAPI spec with full type definitions" }] ) ``` #### 4. Spec Validation ```python # Validate spec response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Validate OpenAPI spec for errors and suggest improvements for best practices" }] ) ``` ### Configuration ```json { "mcpServers": { "openapi": { "command": "npx", "args": ["-y", "@anthropic/mcp-server-openapi"], "env": { "OPENAPI_SPEC_PATH": "./openapi.yaml", "OPENAPI_OUTPUT_DIR": "./generated" } } } } ``` ### Use Cases **API Design**: Design APIs collaboratively using OpenAPI specifications as the source of truth. **Documentation**: Maintain up-to-date API documentation automatically from specs. **SDK Generation**: Provide type-safe client libraries to API consumers. **Contract Testing**: Validate API implementations match documented specifications. The OpenAPI MCP Server brings specification-driven API development to your workflow, ensuring consistency between design, documentation, and implementation.
{
"mcpServers": {
"openapi": {
"mcpServers": {
"openapi": {
"args": [
"-y",
"@awslabs/openapi-mcp-server",
"--spec",
"/path/to/openapi.json"
],
"command": "npx"
}
}
}
}
}