HTTP APIs (OpenAPI)

Point the proxy at any OpenAPI 3.0 spec and it auto-generates MCP tools — one per enabled operation — with typed input schemas, jq response transforms, and config-time dry-run validation.

Configuration

upstreams:
  - name: kraken
    type: http
    tool_prefix: kraken
    base_url: https://api.kraken.com
    openapi:
      source: examples/kraken/spec.yaml   # path or URL
      refresh_interval: 5m                        # re-fetch spec periodically
    overlay:
      source: examples/kraken/overlay.yaml # optional customization

The source field accepts a local file path or a remote URL (https://). Remote specs are fetched with ETag/conditional GET to minimize bandwidth on refresh.

Tool naming

Tool names are derived from the operationId in the spec, slugified and prefixed with the upstream's tool_prefix:

operationIdtool_prefixTool name
getSystemStatuskrakenkraken__get_system_status
getTickerkrakenkraken__get_ticker
listPetspetspets__list_pets

Names can be overridden with x-mcp-tool-name in an overlay. When multiple upstreams would produce the same tool name, a numeric suffix is appended automatically.

Input schema generation

The proxy builds MCP tool input schemas from OpenAPI parameter definitions:

  • Path parameters, query parameters, and request body fields become tool arguments
  • Types, descriptions, enums, formats, and required flags are preserved
  • Synthetic examples are generated from example, default, enum, or format-specific patterns (e.g. date, uuid)

Response transforms

jq expressions transform API responses before they are returned to the MCP client. The default transform is . (passthrough). Set x-mcp-response-transform in an overlay to customize:

# Flatten Kraken's nested result wrapper
x-mcp-response-transform: >
  .result | to_entries[0] | {
    pair: .key,
    ask: .value.a[0],
    bid: .value.b[0],
    lastPrice: .value.c[0]
  }

Request bodies can also be transformed with x-mcp-request-transform. Error responses use x-mcp-error-transform. All transforms are compiled and dry-run validated at startup.

Non-JSON responses

Set x-mcp-response-format to handle binary or media responses:

ValueMCP content type
json (default)TextContent with JSON string
textTextContent
imageImageContent (base64)
audioAudioContent (base64)
binaryResourceContent (base64)
autoDetected from Content-Type

Disabling operations

Set x-mcp-enabled: false on any operation in an overlay to exclude it from tool generation entirely. This does not affect the upstream API — the operation simply won't appear as an MCP tool.

Dry-run validation

At startup the proxy generates a synthetic request for every enabled operation using example values from the spec. If any jq transform or schema mapping fails, the proxy refuses to start and logs the offending operation. This catches misconfigured overlays before they reach production.

x-mcp extensions reference

ExtensionTypeDefaultPurpose
x-mcp-enabledbooltrueInclude operation as a tool
x-mcp-tool-namestringderivedOverride generated tool name
x-mcp-auth-requiredbooltruePer-operation auth bypass
x-mcp-safeboolfalseMark as read-only for group filters
x-mcp-response-formatstringjsonResponse content type
x-mcp-request-transformstringgeneratedjq expression for request body
x-mcp-response-transformstring.jq expression for response
x-mcp-error-transformstringdefaultjq expression for error responses
x-mcp-tierstringArbitrary label for group filters

See also