MCP Integration

openapi.city exposes a Model Context Protocol server so AI coding assistants can search and query OpenAPI specs natively — no custom HTTP calls needed.

What is MCP?

MCP is a standard protocol for connecting AI tools to external data sources. AI assistants like Cursor, Claude Desktop, and Windsurf use MCP servers to access real-time information during conversations.

Configuration

Add openapi.city to your MCP client configuration:

Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "openapi-city": {
      "url": "https://openapi.city/mcp",
      "headers": {
        "Authorization": "Bearer oac_live_YOUR_KEY"
      }
    }
  }
}

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "openapi-city": {
      "url": "https://openapi.city/mcp",
      "headers": {
        "Authorization": "Bearer oac_live_YOUR_KEY"
      }
    }
  }
}

Windsurf

Edit ~/.windsurf/mcp.json:

{
  "mcpServers": {
    "openapi-city": {
      "url": "https://openapi.city/mcp",
      "headers": {
        "Authorization": "Bearer oac_live_YOUR_KEY"
      }
    }
  }
}

OpenCode

Edit ~/.config/opencode/opencode.json (global) or opencode.json in your project root. See OpenCode config docs for details.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "openapi-city": {
      "type": "remote",
      "url": "https://openapi.city/mcp",
      "headers": {
        "Authorization": "Bearer oac_live_YOUR_KEY"
      }
    }
  }
}

Discovery

The MCP server metadata is available without authentication:

GET https://openapi.city/.well-known/mcp

Available tools

search_apis

Search for API providers by name or keyword.

{
  "query": "payment",
  "category": "fintech"
}

list_endpoints

List all endpoints for a provider.

{
  "provider": "stripe",
  "method": "GET"
}

get_endpoints

Get full details for one or more endpoints.

{
  "provider": "stripe",
  "endpoints": "POST /v1/charges"
}

get_schemas

Get schema definitions.

{
  "provider": "stripe",
  "names": "Charge"
}

get_spec_summary

Get an AI-generated summary of a provider’s spec.

{
  "provider": "stripe"
}

get_auth_requirements

Get authentication schemes required by a provider.

{
  "provider": "stripe"
}

resolve_spec

Submit a new OpenAPI spec URL for ingestion.

{
  "url": "https://petstore3.swagger.io/api/v3/openapi.json"
}

Available prompts

integrate_api

Generate an integration guide for a specific API:

{
  "provider": "stripe",
  "use_case": "accept payments on a checkout page"
}

compare_apis

Compare two APIs for a specific use case:

{
  "provider_a": "stripe",
  "provider_b": "paypal",
  "use_case": "recurring subscriptions"
}

All tools that query a specific provider accept an optional version parameter to target a historical spec version instead of the current one:

{
  "provider": "stripe",
  "version": "2024-01-01",
  "method": "GET"
}

Applies to: list_endpoints, get_endpoints, get_schemas, get_spec_summary, get_auth_requirements.

Resource templates

The server exposes resources via openapi:// URI templates:

Template Description
openapi://providers/{slug} Provider metadata
openapi://providers/{slug}/spec Full OpenAPI spec (current)
openapi://providers/{slug}/endpoints Endpoint index (current)
openapi://providers/{slug}/tags/{tag} Tag-grouped endpoints (current)
openapi://providers/{slug}/versions/{version}/spec Spec for a specific version
openapi://providers/{slug}/versions/{version}/endpoints Endpoints for a specific version

Usage example

Once configured, ask your AI assistant:

“Find me a payments API and show me how to create a charge”

The assistant will use search_apis, get_endpoints, and get_schemas tools to find Stripe, retrieve the charge endpoint, and show you the schema — all through MCP.

Next: Billing →