Specbridge: OpenAPI to MCP Server Tools
Convert OpenAPI specs into ready-to-run MCP server tools with Specbridge, automating endpoints, validation, and deployment in minutes.
Overview
Specbridge converts OpenAPI documents into ready-to-run Model Context Protocol (MCP) server tools. Given a single OpenAPI v3 (or v2) specification, Specbridge generates endpoint handlers, request/response validation, mock responses, and deployment artifacts so you can run an MCP-compatible tool in minutes. The goal is to turn an API contract into a reproducible, validated runtime that can be used for rapid prototyping, testing, or production integration with minimal manual wiring.
By automating the translation from OpenAPI to MCP, Specbridge enforces consistent validation logic, schema-driven documentation, and predictable tooling. This reduces the boilerplate of building adapters and lets teams focus on the model and workflow logic that interacts with the API rather than on plumbing and repeatable validation code.
Features
- Generate MCP-compatible server tools directly from OpenAPI specs
- Schema-driven request/response validation (JSON Schema / OpenAPI)
- Auto-generated mock responses and example-based stubs
- Optionally generate authentication and header injection code
- CLI and Docker-friendly workflows for CI/CD
- Output includes Dockerfile, Kubernetes manifests, and simple deployment scripts
- Customizable templates and plugin hooks for platform-specific behavior
- Lightweight runtime with metrics and basic logging to fit MCP environments
Installation / Configuration
Clone and run from source (recommended when experimenting):
# run the CLI from source
Run using npm (if distributed via npm):
# install globally
# convert OpenAPI to MCP tool
Docker-based execution:
# build an image that contains the CLI (optional)
# run the converter in a container, mounting input and output
A minimal config file (specbridge.config.json) to control generation:
CLI usage summary:
Available Resources
Specbridge produces a small set of well-structured artifacts suitable for immediate deployment or customization:
| File / Directory | Purpose |
|---|---|
| out/handlers/* | Generated request handlers wired to MCP input/output format |
| out/validators/* | Request/response validators derived from OpenAPI schemas |
| out/mocks/* | Example mock responses from OpenAPI examples |
| out/Dockerfile | Container image recipe for the generated tool |
| out/k8s/* | Optional Kubernetes manifests (Deployment, Service) |
| out/specbridge-manifest.json | Metadata describing the generated MCP tool |
| out/bin/run.sh | Small startup script to launch the MCP server |
Additionally, Specbridge exposes hooks for providing custom templates and post-generation scripts so teams can integrate company-specific middleware (auth, tracing, metrics).
Use Cases
- Rapid frontend-backend integration
- Generate a mock MCP tool from the API spec to unblock frontend development while backend services are under development. The generated mocks follow the contract and can be swapped for real implementations later.
- Contract-driven CI testing
- Use generated validators in your CI to assert that service responses conform to the OpenAPI contract. Run the MCP tool in CI as a contract gate.
- Microservice prototyping
- Quickly scaffold a lightweight MCP server that implements all declared endpoints; implement only the business logic and reuse generated validation and deployment artifacts.
- API gateway adapters
- Create an MCP-compatible adapter that translates between internal model context messages and external REST endpoints, with automatic header mapping and input sanitization.
- Compliance and auditing
- Ensure requests/responses adhere to schema constraints and generate logs/metrics for audit trails with minimal hand coding.
Quick Example — Generated Handler Snippet
A generated JavaScript handler (simplified) might look like:
module.exports = ;
This handler is wrapped by the generated MCP server that performs validation, error mapping, and lifecycle management.
Next Steps
- Prepare a focused OpenAPI spec: ensure examples are set for better mocks.
- Try generating a tool locally and inspect the validators and mocks.
- Customize templates to match your runtime conventions (auth, tracing).
- Integrate the generated Dockerfile into your CI/CD pipeline for automated deployment.