The generation pipeline
MCP Blacksmith converts an OpenAPI specification into a fully functional MCP server through a multi-stage pipeline:- Parse & Validate — Verify structural and syntactical specification correctness
- Filter & Enhance (optional) — AI-curate operations and parameters
- Generate Code — Produce a complete Python project with dependencies
- Package Server — Bundle into a downloadable ZIP archive
1. Parse and validate
Your OpenAPI specification is parsed and validated for structural correctness. MCP Blacksmith supports:- OpenAPI 2.0 (Swagger)
- OpenAPI 3.0.x
- OpenAPI 3.1.x
- OpenAPI 3.2.x
2. Extract and enrich operations
Operations and their request/response schemas are extracted from the specification. Each API operation (e.g.,GET /users, POST /orders) is mapped to an MCP tool with its parameters, request body, response schemas, and authentication requirements.
Optionally, request schemas can be filtered and enhanced using enhancement passes. Read-only and server-generated fields are removed, meanwhile authentication-related fields are abstracted from AI agents. Parameter descriptions, examples, and constraints are optimized for LLM readability, and schemas are rewritten for token efficiency. This curation step is what separates a raw API wrapper from a production-quality MCP server — it ensures AI agents see only the parameters they should control, with descriptions, examples, and constraints they can understand.
3. Generate code
The generator produces a complete Python project:| File | Purpose |
|---|---|
server.py | MCP server with tool definitions for every operation |
_models.py | Pydantic models for request/response validation |
_validators.py | 50+ format validators (full OAS Format Registry coverage) |
_auth.py | Authentication handlers for each security scheme |
.env | Environment variables for credentials and configuration |
requirements.txt | Python dependencies |
LICENSE | MIT license for generated code |
Dockerfile | Production Docker build |
.mcp.json | MCP client configuration template |
README.md | Setup and usage instructions |
4. Package and download
The complete server is packaged as a ZIP file. Extract it, install dependencies, configure credentials, and run — no additional code generation or compilation needed.What the generated server does at runtime
When an MCP client (like Claude) calls a tool:- Validate — Parameters are validated against Pydantic models. If types, formats, or constraints don’t match, the agent receives immediate, context-rich feedback describing exactly what failed — before any request is sent to the API
- Authenticate — Correct credentials are injected based on the operation’s authentication requirements
- Execute — HTTP request is sent to the target API with retry logic and circuit breaking
- Validate response — Response is optionally validated against the API’s response schema
- Return — Structured data is returned to the MCP client. API errors are normalized into a consistent, LLM-readable format regardless of the upstream API’s error structure
Deployment considerations
Generated servers are designed for self-hosted, single-tenant deployment. Each server instance serves one user or application with its own credentials.
- Do not commit
.envto version control — it may contain sensitive API credentials - The server requires its dependencies installed (via
requirements.txt, either in a virtual environment or globally) - For multi-tenant deployment with shared infrastructure, visit MCP Armory