A Python library to automatically convert any OpenAPI v2/v3 specification into a Model Context Protocol (MCP) server, with integrations for popular frameworks like FastAPI.
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"openapi-to-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# OpenAPI to MCP Converter (Python) A Python library to automatically generate MCP (Model-View-Controller Protocol) servers from OpenAPI specifications. This library allows you to expose any API with an OpenAPI v3 specification as an MCP-compliant server, making it easy to integrate with AI agents and other MCP-enabled tools. ## Features - **Dynamic Conversion**: Generate MCP servers from any public OpenAPI v3 specification URL. - **Path Filtering**: Selectively expose a subset of API endpoints. - **Dynamic Upstream URL**: Forward requests to a different base URL than the one in the OpenAPI spec. - **Authentication Forwarding**: Pass authentication headers to the upstream API. - **`$ref` Resolution**: Automatically resolves JSON references (`$ref`) in the OpenAPI spec for complete schema definitions. - **Security**: Built-in SSRF protection with a configurable domain whitelist. - **Framework Integration**: Plug-and-play integration with FastAPI. ## Installation ```bash pip install openapi-to-mcp ``` ## Quick Start - FastAPI Integration Here's how to add an MCP server to your existing FastAPI application. This example sets a static OpenAPI spec URL and enables security. ```python from fastapi import FastAPI from openapi_to_mcp.fastapi import add_mcp_route app = FastAPI() # Add the MCP route # This will expose an MCP server at /mcp add_mcp_route( app, openapi_url="https://petstore.swagger.io/v2/swagger.json", allowed_domains=["petstore.swagger.io"] # SSRF Protection ) @app.get("/") def read_root(): return {"Hello": "World"} ``` ## Advanced Configuration You can configure the MCP server statically when you initialize it or dynamically using query parameters. ### Static Configuration Pass a configuration object to `add_mcp_route`: - `route_prefix` (optional, default: `/mcp`): The base path for the MCP server. - `openapi_url` (optional): A default OpenAPI specification URL. - `allowed_domains` (optional, default: `[]`): A list of allowe…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.