Skip to content

Commit 37f2e74

Browse files
committed
fix: compatibility with the fastmcp v2.14.x
1 parent 1d91e0f commit 37f2e74

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

smartapi_mcp/awslabs_server.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from awslabs.openapi_mcp_server.utils.openapi import load_openapi_spec
4141
from awslabs.openapi_mcp_server.utils.openapi_validator import validate_openapi_spec
4242
from fastmcp import FastMCP
43-
from fastmcp.server.openapi import FastMCPOpenAPI, RouteMap, RouteType
43+
from fastmcp.server.openapi import FastMCPOpenAPI, MCPType, RouteMap
4444

4545

4646
async def create_mcp_server(config: Config) -> FastMCP:
@@ -67,11 +67,6 @@ async def create_mcp_server(config: Config) -> FastMCP:
6767
server = FastMCP(
6868
"awslabs.openapi-mcp-server",
6969
instructions="This server acts as a bridge between OpenAPI specifications and LLMs, allowing models to have a better understanding of available API capabilities without requiring manual tool definitions.",
70-
dependencies=[
71-
"pydantic",
72-
"loguru",
73-
"httpx",
74-
],
7570
)
7671

7772
try:
@@ -205,7 +200,7 @@ def handle_auth_error(auth_type, error_message):
205200
RouteMap(
206201
methods=["GET"],
207202
pattern=f"^{re.escape(path)}$",
208-
route_type=RouteType.TOOL,
203+
mcp_type=MCPType.TOOL,
209204
)
210205
)
211206

@@ -237,8 +232,8 @@ def handle_auth_error(auth_type, error_message):
237232
for i, route in enumerate(routes):
238233
path = getattr(route, "path", "unknown")
239234
method = getattr(route, "method", "unknown")
240-
route_type = getattr(route, "route_type", "unknown")
241-
logger.debug(f"Route {i}: {method} {path} - Type: {route_type}")
235+
mcp_type = getattr(route, "mcp_type", "unknown")
236+
logger.debug(f"Route {i}: {method} {path} - Type: {mcp_type}")
242237

243238
logger.info(f"Successfully configured API: {config.api_name}")
244239

0 commit comments

Comments
 (0)