SpecBridge MCP
Provides tools for exposing OpenAPI/Huma contract intelligence to AI agents, including loading OpenAPI specs, listing endpoints, retrieving endpoint contracts with schemas and validation facts, and generating TypeScript DTO declarations.
Generates TypeScript DTO declarations from OpenAPI/Huma component schemas and provides endpoint-scoped TypeScript declarations as part of deterministic contract bundles for AI agents.
Supports loading and processing OpenAPI/Huma specifications in YAML format, providing deterministic endpoint metadata, schemas, and validation facts from YAML-based API contracts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SpecBridge MCPshow me the endpoints for the pet store API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SpecBridge MCP
SpecBridge MCP is a clone-and-own MCP starter for exposing OpenAPI/Huma contract intelligence to AI agents. It turns OpenAPI/Huma specs into deterministic endpoint metadata, schemas, validation facts, referenced DTOs, and TypeScript declarations that agents can use before changing frontend or client code.
This project is intentionally repository-first rather than npm-published: clone it, adapt the backend registry to your private or public specs, and register the local MCP server with your agent host. The implementation keeps the core unopinionated by avoiding downstream file mutation, using a neutral public demo backend, supporting multiple injected backends, and treating inferred helpers as best-effort rather than guarantees.
Status: experimental. The tool surface is useful for local automation, but the repository is meant to be owned and adapted by each team.
Brief history
SpecBridge MCP started as a personal internal tool at SesameLab to improve the development cycle around backend API contracts. In practice, giving AI agents structured OpenAPI/Huma contract data through MCP reduced hallucinations compared with asking them to read API documentation pages directly.
What it provides
Configurable backend registry for one or many OpenAPI/Huma-compatible specs
Zero-config demo backend using a real public OpenAPI URL
Spec loading and refresh with JSON/YAML support
Endpoint listing and filtering
Endpoint contract bundles with deterministic facts:
operation metadata
parameters
request and response schemas
referenced component schemas
endpoint-scoped TypeScript DTO declarations
validation facts such as
required,nullable,enum,format, arrays, maps, and composition
TypeScript DTO declaration generation from component schemas
Best-effort proposal helpers that are explicitly secondary to deterministic spec facts
Non-goals
Publishing this project to npm for v1
Providing a generic installable CLI abstraction
Mutating downstream frontend/client repositories
Becoming a framework-specific client or SDK generator
Hosting specs or storing team API data remotely
Requirements
Node.js 18+
pnpm 10+
Install
git clone <your-fork-or-copy-url> specbridge-mcp
cd specbridge-mcp
pnpm install
pnpm buildConfigure backends
SpecBridge ships with openapi.backends.json pointing at a public demo API so the tools work immediately.
To use your own APIs, edit openapi.backends.json or point OPENAPI_BACKENDS_FILE at another JSON file.
[
{
"id": "public-demo",
"name": "Public Demo API",
"specUrl": "https://petstore3.swagger.io/api/v3/openapi.json",
"description": "Public OpenAPI demo backend",
"domainHints": ["/pet", "/store", "/user"]
},
{
"id": "local-service",
"name": "Local Service API",
"specUrl": "http://localhost:8080/openapi.json",
"fallbackSpecUrls": ["http://localhost:8080/openapi.yaml"],
"description": "Your local service contract"
}
]Configuration precedence
For a tool call, an explicit specUrl override is tried first for that call.
Backend registry sources are merged in this order, with later sources overriding earlier ones by id:
Built-in public demo backend
Repository-local
openapi.backends.json, when presentOPENAPI_BACKENDS_FILE, when setOPENAPI_BACKENDS, when set
DEFAULT_BACKEND_ID selects the default backend. If unset, SpecBridge uses swagger-petstore.
Environment variables
MCP_TRANSPORT:stdioorhttpMCP_HTTP_HOST: HTTP bind hostMCP_HTTP_PORT: HTTP portMCP_HTTP_PATH: MCP endpoint path, such as/mcpMCP_HTTP_STATELESS: set totruefor stateless HTTP modeDEFAULT_BACKEND_ID: default backend IDOPENAPI_BACKENDS: JSON array of backend configsOPENAPI_BACKENDS_FILE: path to a backend config JSON fileOPENAPI_FETCH_TIMEOUT_MS: fetch timeout for spec loadingOPENAPI_CACHE_TTL_MS: in-memory spec cache TTLOPENAPI_ENABLE_SWAGGER_UI_SCRIPT_EXTRACTION: opt in to strict JSON object extraction from static Swagger UI scripts; fetched JavaScript is never executed
Run
stdio mode
pnpm mcp
# or
./mcp-server.shHTTP mode
pnpm mcp:httpStateless HTTP mode:
pnpm mcp:http:statelessMCP host setup
Command-based stdio configuration
{
"mcpServers": {
"specbridge-mcp": {
"command": "/absolute/path/to/specbridge-mcp/mcp-server.sh"
}
}
}Codex config.toml example
[mcp_servers.specbridge-mcp]
args = ["/absolute/path/to/specbridge-mcp/mcp-server.sh"]
command = "bash"HTTP URL
Start the server:
./mcp-server.sh --transport http --host 127.0.0.1 --port 3000 --path /mcpThen connect your host to:
http://127.0.0.1:3000/mcp
If your host has trouble with session state, retry with --stateless.
Tools
Recommended flow:
list_backendsload_openapi_speclist_api_endpointsget_endpoint_contractgenerate_typescript_dto
list_backends
Lists configured backend targets, the default backend ID, and optional domain hints.
load_openapi_spec
Loads or refreshes an OpenAPI/Huma-compatible spec for a backend. Supports direct specUrl overrides.
list_api_endpoints
Lists endpoints from a loaded spec with optional tag, method, path substring, and limit filters.
get_endpoint_contract
Returns a deterministic endpoint contract bundle: operation metadata, parameters, request body, responses, referenced schemas, endpoint-scoped TypeScript DTO declarations, validation facts, and best-effort hints.
generate_typescript_dto
Generates TypeScript DTO declarations from a component schema name and includes referenced nested DTO types.
propose_new_endpoint
Returns a best-effort endpoint and DTO proposal aligned with patterns found in the current spec. Treat this as an agent aid, not a deterministic guarantee.
Development
pnpm install
pnpm check
pnpm build
pnpm testUseful scripts:
pnpm check: Biome checkpnpm format: apply Biome formattingpnpm lint: Biome lint onlypnpm build: clean TypeScript buildpnpm test: build and run all testspnpm test:e2e: build and run MCP smoke tests
Clone-and-own guidance
SpecBridge is intentionally repository-first. Keep the core small, adapt backend configuration locally, and let downstream agents decide how to edit your client code. If your team needs custom auth, internal naming rules, or additional contract facts, add them in your clone rather than fighting a global package abstraction.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/heecheon92/specbridge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server