From 92ade4974e09ac8d4d85e5e21bf3adb22c436f4b Mon Sep 17 00:00:00 2001 From: Edison-A-N Date: Mon, 23 Jun 2025 09:03:50 +0800 Subject: [PATCH] Support skip deprecated api --- fastapi_mcp/openapi/convert.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fastapi_mcp/openapi/convert.py b/fastapi_mcp/openapi/convert.py index 22e5c5e..c2ea416 100644 --- a/fastapi_mcp/openapi/convert.py +++ b/fastapi_mcp/openapi/convert.py @@ -46,6 +46,11 @@ def convert_openapi_to_mcp_tools( logger.warning(f"Skipping non-HTTP method: {method}") continue + is_deprecated = operation.get("deprecated", False) + if is_deprecated: + logger.warning(f"Skipping deprecated operation: {method} {path}") + continue + # Get operation metadata operation_id = operation.get("operationId") if not operation_id: