From c5165e159b2b700796658c7b5ad3ab99699f2b95 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Fri, 23 May 2025 21:37:28 -0400 Subject: [PATCH] Update openapi.mdx --- docs/servers/openapi.mdx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/servers/openapi.mdx b/docs/servers/openapi.mdx index 6ef6a942d..580502a49 100644 --- a/docs/servers/openapi.mdx +++ b/docs/servers/openapi.mdx @@ -51,13 +51,7 @@ FastMCP analyzes your API specification and automatically creates MCP components | `GET` without path params | `GET /stats` | **Resource** | | `POST`, `PUT`, `PATCH`, `DELETE`, etc. | `POST /users` | **Tool** | - - -### Custom Route Maps - - - -FastMCP uses an ordered list of `RouteMap` objects to determine how to map OpenAPI routes to various MCP component types. +Interally, FastMCP uses an ordered list of `RouteMap` objects to determine how to map OpenAPI routes to various MCP component types. Each `RouteMap` specifies a combination of methods, patterns, and tags, as well as a corresponding MCP component type. Each OpenAPI route is checked against each `RouteMap` in order, and the first one that matches every criteria is used to determine its converted MCP type. A special type, `EXCLUDE`, can be used to exclude routes from the MCP server entirely. @@ -66,7 +60,7 @@ Each `RouteMap` specifies a combination of methods, patterns, and tags, as well - **Tags**: A set of OpenAPI tags that must all be present. An empty set (`{}`) means no tag filtering, so the route matches regardless of its tags. - **MCP type**: What MCP component type to create (`TOOL`, `RESOURCE`, `RESOURCE_TEMPLATE`, or `EXCLUDE`) -To illustrate this in practice, here are FastMCP's default route mappings as a list of `RouteMap` objects: +To illustrate this in practice, here are FastMCP's default rules as a list of `RouteMap` objects: ```python from fastmcp.server.openapi import RouteMap, MCPType