This commit is contained in:
2025-06-09 03:22:53 +08:00
parent 343e8c3611
commit f66aed6340
3 changed files with 7 additions and 5 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
from fastmcp import FastMCP
from main import application
from fastmcp.server.openapi import RouteMap, MCPType, HTTPRoute
from fastmcp.server.openapi import MCPType, HTTPRoute
from config.main import config
def custom_route_mapper(route: HTTPRoute, mcp_type: MCPType) -> MCPType | None:
"""Advanced route type mapping."""
@@ -14,9 +14,9 @@ def custom_route_mapper(route: HTTPRoute, mcp_type: MCPType) -> MCPType | None:
mcp = FastMCP.from_fastapi(
app=application,
name="My Custom Server",
timeout=5.0, # Custom component names
port=1486,
name="Dcalc_MCP",
timeout=60,
port=config.MCPPORT,
route_map_fn=custom_route_mapper,
)