MCPBridge
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCPBridge
Turn any REST API into an MCP server that AI agents can use — in one command.
Point it at an OpenAPI spec. It exposes every operation as an MCP tool, wraps it in an OAuth 2.1 authorization server (so Claude, ChatGPT, Cursor and friends can connect from their hosted clients), and speaks Streamable HTTP.
npx mcpbridge serve --spec https://petstore3.swagger.io/api/v3/openapi.jsonMCPBridge 0.1.0
spec https://petstore3.swagger.io/api/v3/openapi.json
tools 19
MCP https://your-host.example.com/mcp
consent https://your-host.example.com/authorizeAdd that /mcp URL as a remote MCP server in your client. Done.
Source: https://github.com/neil-lien/mcpbridge. Deploy your own free instance (no card required, Render free tier):
Why this exists
Every API on the internet is about to become a tool call. The gap is that agents speak MCP and APIs speak OpenAPI — different transports, different auth, different shape.
Doing the translation by hand means writing a tool schema per endpoint, an HTTP client per service, and an OAuth server you did not want to build. MCPBridge is that translation layer, prebuilt:
Problem | What MCPBridge does |
OpenAPI → tool schemas | Converts parameters (including |
Per-endpoint HTTP plumbing | Path params, query params (with |
OAuth 2.1 for hosted clients | Dynamic client registration, authorization code + PKCE, refresh tokens, resource metadata (RFC 9728) |
Secrets | The caller's API credential lives in the OAuth grant, never in the tool schema |
Related MCP server: OpenAPI MCP Server
Quickstart
# 1. from an OpenAPI file on disk
npx mcpbridge serve --spec ./openapi.json
# 2. or straight from a URL
npx mcpbridge serve --spec https://api.example.com/openapi.json --upstream-token "$MY_API_KEY"
# 3. preview the generated tools without starting a server
npx mcpbridge tools --spec ./openapi.jsonDefault port is 3000. Set --base-url when the server is behind a proxy so the OAuth
metadata advertises the right public origin:
npx mcpbridge serve --spec ./openapi.json --base-url https://mcp.example.comConnect a client
Hosted clients (Claude.ai, ChatGPT, Cursor web) need a reachable HTTPS URL:
https://mcp.example.com/mcpThe client discovers /.well-known/oauth-protected-resource, registers itself, sends the
user to your consent screen, and comes back with a bearer token. No client secrets, no
manual key exchange.
For a local client that accepts a static header instead, the same URL works with
Authorization: Bearer <token> — see Authentication.
CLI
mcpbridge serve [options] # start the MCP + OAuth server
mcpbridge tools --spec <spec> # print the generated tools as JSONFlag | Default | Meaning |
| required | OpenAPI 3.x document. JSON or YAML. |
|
| Listen port. |
|
| Listen address. |
|
| Public origin used in OAuth metadata. |
| spec | Override the API the tools call. |
| — | Default credential for callers that do not supply one. |
|
| Header the credential is sent in. Supports a template: |
| off | Skip the consent screen (only for single-tenant self-hosting). |
|
| Name shown on the consent screen. |
| — | Contact shown on the consent screen. |
| all | Comma-separated regexes. Keeps only operations whose path, |
|
| Tools per |
| off | Machine-readable log output. |
Authentication
MCPBridge is a complete OAuth 2.1 authorization server:
POST /register— dynamic client registration (RFC 7591)GET /authorize— consent screen, authorization code + PKCE (S256 required)POST /token— code exchange and refresh rotationPOST /revoke— token revocationGET /.well-known/oauth-authorization-server— server metadataGET /.well-known/oauth-protected-resource— resource metadata (RFC 9728)
Tool calls run with the credential attached to the grant. Users paste their API token on
the consent screen, or you preload one with --upstream-token. /mcp rejects any request
without a valid bearer token and returns WWW-Authenticate pointing at the resource
metadata, which is how clients discover the flow.
Tokens are held in memory. Running multiple instances behind a load balancer needs sticky sessions or a shared store — see Limitations.
Deploy
The image is a single Node process with no native dependencies.
docker build -t mcpbridge .
docker run -p 3000:3000 \
-e SPEC_URL=https://petstore3.swagger.io/api/v3/openapi.json \
-e BASE_URL=https://mcp.example.com \
mcpbridgeAny container host works: Fly.io, Railway, Render, Cloud Run, a VPS with Caddy in front.
Free, no credit card: this repo ships a render.yaml blueprint. Push to GitHub,
then Render → New → Blueprint → pick the repo. plan: free and SPEC_URL are already
set, and the app reads RENDER_EXTERNAL_URL to configure its public OAuth issuer, so
BASE_URL needs no manual setup. Hugging Face Spaces (Docker SDK, app_port: 3000)
works the same way — the app detects SPACE_HOST.
Free instances sleep when idle (Render: ~50 s cold start), so wake /healthz before
sharing the link.
Point DNS at it, pass the public origin as BASE_URL, and OAuth discovery just works —
as long as the URL is HTTPS and not a path-less shared subdomain the client refuses.
What gets generated
Given this OpenAPI fragment:
paths:
/forecast:
get:
operationId: get_forecast
summary: Get a weather forecast
parameters:
- name: latitude
in: query
required: true
schema: { type: number }MCPBridge produces:
{
"name": "get_forecast",
"description": "Get a weather forecast",
"inputSchema": {
"type": "object",
"properties": { "latitude": { "type": "number" } },
"required": ["latitude"]
},
"annotations": { "readOnlyHint": true }
}Notable behaviour:
Tool names come from
operationId, sanitised to[a-zA-Z0-9_-]. Collisions get a numeric suffix.GET/HEADoperations arereadOnlyHint: true;DELETEand body-bearing writes aredestructiveHint: true.Operation-level
serversoverride the document-level one, so a spec spread across several hosts stays correct.Deprecated operations are skipped unless explicitly included.
Local
$refs are resolved; circular references degrade to{ "type": "object", "additionalProperties": true }instead of exploding.Responses over 60 KB are truncated, with a marker telling the model to narrow the call. Hangs are cut at 30 s so a slow upstream cannot stall an agent turn.
Real specifications
Against the 12 MB GitHub REST spec (818 paths, OpenAPI 3.0.3):
Parse | 38 ms |
Generate | 205 ms |
Tools | 1196 (38 deprecated skipped) |
| 1.77 MB, ≈ 500k tokens |
Half a million tokens of tool definitions is worse than useless: the agent either refuses the list or burns its context on it. Scope the surface instead of exposing it all:
mcpbridge tools --spec api.github.com.json --include "^repos_get,issues_list" | jq length--include matches the path, the operationId, or the generated tool name — the name
users actually see in tools/list (GitHub writes repos/get; the tool is repos_get).
--page-size paginates tools/list, but the reference TypeScript client's listTools()
does not follow nextCursor, so it defaults to 0 (off). Enabling it is only safe with
clients you know follow cursors.
Limitations
In-memory token store. Restarting the process invalidates every token. Fine for a single box, not for horizontal scaling.
No upstream OAuth. Credentials are API keys or bearer tokens, not three-legged OAuth flows against the upstream API.
OpenAPI 3.0/3.1 only. Swagger 2.0 is rejected with a clear error; convert it first.
No streaming response bodies. Tools return a single JSON payload.
Read-only-by-default is a hint, not a guarantee: a
GETthat mutates state on the server side cannot be detected here.
License
MIT.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceTurns any OpenAPI/Swagger API into MCP tools, enabling AI assistants to call REST API endpoints directly.2MIT
- AlicenseNot gradedqualityDmaintenanceExposes OpenAPI endpoints as MCP tools, enabling LLMs to discover and interact with REST APIs through the MCP protocol.43 npmMIT
- FlicenseNot gradedqualityDmaintenanceExposes any REST API as MCP tools, enabling AI agents to discover and call existing HTTP endpoints without modifying the original API.-
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to call any OpenAPI-defined API by automatically converting its operations into tools, with built-in support for authentication, rate limiting, and response handling.7Apache 2.0