Skip to content

Commit 2d7dc6d

Browse files
committed
feat: mcp server
1 parent 961b53d commit 2d7dc6d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

backend/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,20 @@ def custom_generate_unique_id(route: APIRoute) -> str:
4343
lifespan=lifespan
4444
)
4545

46-
# mcp_app = FastAPI()
46+
mcp_app = FastAPI()
47+
mcp_app.add_middleware(TokenMiddleware)
48+
mcp_app.include_router(api_router, prefix=settings.API_V1_STR)
4749

4850
mcp = FastApiMCP(
4951
app,
5052
name="SQLBot MCP Server",
5153
description="SQLBot MCP Server",
54+
describe_all_responses=True,
55+
describe_full_response_schema=True,
5256
include_operations=["get_datasource_list", "get_model_list", "question"]
5357
)
5458

55-
mcp.mount(app)
59+
mcp.mount(mcp_app)
5660

5761
# Set all CORS enabled origins
5862
if settings.all_cors_origins:

0 commit comments

Comments
 (0)