添加mcp配置
This commit is contained in:
@@ -29,7 +29,11 @@ def import_router(app: FastAPI):
|
||||
app.include_router(router)
|
||||
logger.info(f"[导入路由] 路由导入完成 ✅")
|
||||
|
||||
|
||||
async def import_mcp_server(app: FastAPI):
|
||||
logger.info(f"[导入MCP] 开始导入MCP 🛣️")
|
||||
from mcps import create_mcp_app
|
||||
app.mount("/app" , await create_mcp_app())
|
||||
logger.info(f"[导入MCP] MCP导入完成 ✅")
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
@@ -38,5 +42,6 @@ async def lifespan(app: FastAPI):
|
||||
init_database()
|
||||
import_router(app)
|
||||
init_scheduler(app)
|
||||
await import_mcp_server(app)
|
||||
yield
|
||||
logger.info(f"[生命周期] 应用关闭 🔧✅")
|
||||
|
||||
Reference in New Issue
Block a user