Generate MCP servers from OpenAPI specs
New in version: 2.0.0
FlashMCP can automatically generate an MCP server from an OpenAPI specification. Users only need to provide an OpenAPI specification (3.0 or 3.1) and an API client.
OpenAPI Route | Example | MCP Component | Notes |
---|---|---|---|
GET without path params | GET /stats | Resource | Simple resources for fetching data |
GET with path params | GET /users/{id} | Resource Template | Path parameters become template parameters |
POST , PUT , PATCH , DELETE , etc. | POST /users | Tool | Operations that modify data |
RouteMap
objects to determine the component type. Route maps indicate that a specific HTTP method (or methods) and path pattern should be treated as a specific component type. This is the default set of route maps:
all_routes_as_tools
parameter to automatically map every route to a Tool:
all_routes_as_tools
and route_maps
cannot be used together - if you need more complex mapping rules, use route_maps
instead.
None
values or empty strings (""
) are automatically filtered out of requests. This ensures that API servers don’t receive unnecessary empty parameters that might cause issues.
For example, if you call a tool with these parameters:
category=electronics&min_price=100
.
None
values and checks that all required path parameters are provided. If a required path parameter is missing or None
, an error will be raised.