feat: mcp server

This commit is contained in:
junjun
2025-06-23 14:22:09 +08:00
parent 961b53d5ea
commit 2d7dc6da3d
+6 -2
View File
@@ -43,16 +43,20 @@ app = FastAPI(
lifespan=lifespan
)
# mcp_app = FastAPI()
mcp_app = FastAPI()
mcp_app.add_middleware(TokenMiddleware)
mcp_app.include_router(api_router, prefix=settings.API_V1_STR)
mcp = FastApiMCP(
app,
name="SQLBot MCP Server",
description="SQLBot MCP Server",
describe_all_responses=True,
describe_full_response_schema=True,
include_operations=["get_datasource_list", "get_model_list", "question"]
)
mcp.mount(app)
mcp.mount(mcp_app)
# Set all CORS enabled origins
if settings.all_cors_origins: