Skip to main content

Overview

Generating MCP servers from OpenAPI specs is in beta.
Most APIs you want an agent to use have an OpenAPI (or Swagger) document but no MCP server. Choose Generate from an OpenAPI spec as the server source (connection_type: "openapi" in the API and config.json) and Bifrost builds the MCP server for you: paste the document, pick the operations, and each one Bifrost can call becomes a tool (operations it cannot express as tool arguments, such as multipart uploads, are listed as unsupported with the reason). Tool calls are sent to the API as ordinary HTTP requests, with the credentials you configure. The result is a regular MCP client in Bifrost. Everything that applies to other servers applies here too: tool filtering and auto-execute, pricing, virtual-key access, code mode, the hosted /mcp/<slug> endpoint, and tool sync.
Supported documents: Swagger 2.0, OpenAPI 3.0, 3.1 and 3.2, as JSON or YAML, up to 5 MiB. Newer 3.x minor versions are parsed as 3.2 with a warning.

How operations become tools

Schemas are normalized to the dialect model providers accept: 3.1 type: [..., "null"] becomes nullable, allOf of objects is merged, readOnly properties are dropped from inputs, and keywords such as xml, externalDocs, discriminator and examples are removed.

What is not exposed

These operations are listed in the preview with a reason instead of becoming tools:
  • multipart/form-data, application/octet-stream and other binary request bodies (file uploads).
  • Streaming request bodies (OpenAPI 3.2 itemSchema: text/event-stream, application/jsonl, application/json-seq).
  • Operations that reference schemas in other files (external $ref).
  • Deprecated operations, unless include_deprecated is set.
Security schemes of type oauth2, openIdConnect and mutualTLS cannot be satisfied from the gateway; operations that only accept them are still exposed and are called with the static headers you configure.

Base URL

The upstream defaults to the first servers entry of the document (server variables take their default value; relative URLs are resolved against the document’s URL or 3.2 $self). Pick another server or type a custom base URL in the preview. A document with no absolute top-level server needs one, unless every operation (or its path) declares an absolute server of its own; each call then goes to its operation’s server.

Authentication

Two layers reach the API on every call:
  1. Security schemes from the document. The preview lists every securitySchemes entry. For apiKey (header, query or cookie) and http bearer schemes you enter one value; for http basic a username and password. Values accept env.VAR and vault.path references. Stored credentials are encrypted only when encryption_key (or BIFROST_ENCRYPTION_KEY) is configured; without a key they are stored in plain text. The first security requirement of an operation whose schemes all have a credential is applied.
  2. The server’s own auth type. none, headers (static headers sent with every request) and per_user_headers (each caller supplies their own values) work as for any other server. OAuth and token exchange do not apply: there is no MCP server to run that handshake against. For the same reason a caller’s per-user headers are saved once every required key has a value, with no verification handshake; the upstream API sees them on the first tool call.

Per-user credentials for security schemes

With Auth Scope: Per-user, each security scheme sent in a header takes a header name instead of a stored value, and each caller supplies that header: The header is forwarded to the API under that name, unchanged, and is added to the server’s per_user_header_keys (Required Headers) for you. Rename it only if the API also accepts the credential under another header; clear it to keep a stored value for that scheme instead. apiKey schemes sent in the query or a cookie cannot come from a header, so they keep a stored value. When an operation requires a header scheme and a query or cookie scheme together, the caller’s header counts for its scheme and the stored value of the other is still sent. Over the API, list the header in per_user_header_keys and leave that scheme out of security_credentials.

Configuration

  1. Navigate to MCP Gateway and click Add MCP Server.
  2. Under Server source, choose Generate from an OpenAPI spec (marked BETA). The connection type and connection URL fields give way to the document source.
  3. Supply the document: Paste it or Upload a file and it is parsed as soon as you stop typing, or give its URL and click Fetch spec. Parse errors show under the editor, with Parse again to retry.
OpenAPI document source in the New MCP Server sheet
  1. Review the preview: the document’s title and version, the Base URL, credential inputs for its security schemes, and the operations. Untick anything the server should not expose. Unsupported operations are shown disabled with the reason.
Parsed operations, base URL and credentials
  1. Set the server’s name, auth type, static headers and the other options as for any server, then click Create.
To swap the document later, open the server, and on the General tab click Replace spec. Each operation is matched by method and path, so a selected operation stays selected, and its auto-execute setting and tool price follow it, even if its tool name changes. Settings of operations the new document drops are removed. The server is rebuilt from the new document when you save.
Stored document summary and Replace spec on the edit sheet

Go SDK

The parser lives in framework/openapimcp; core only knows the hook. Register the factory once and declare clients with connection_type: "openapi":
Without a factory, an openapi client fails to connect with an error naming the missing hook.

Limitations

  • One tool per operation; very large documents produce many tools. Above 128 tools the preview warns: restrict tools_to_execute to limit what the model sees. Above 1000 tools the document is rejected before any allow-list applies; reduce the document to at most 1000 supported operations.
  • File uploads, binary and streaming bodies, OAuth-only APIs and externally referenced schemas are not supported (see above).
  • The gateway exposes tools as <server>-<tool> within 64 characters, so long operationIds are shortened. A server name that leaves fewer than 16 characters for the tool (longer than 47 characters) is rejected for OpenAPI servers.
  • A redirect to another host, or from https to plain http, is not followed when the call carries credentials, custom headers or query parameters; the model receives the redirect response instead, so credentials never reach a host the document did not name or travel unencrypted.
  • Tool names depend on the document’s operationIds. With a partial selection, renamed and newly added tools stay unselected until you tick them. If all previous tools were selected, every supported tool in the replacement document is selected, renamed and newly added ones included.

Next Steps