添加mcp配置

This commit is contained in:
2026-01-15 17:34:22 +08:00
parent 0e4a85551f
commit d3bf64ae61
21 changed files with 1601 additions and 275 deletions

View File

@@ -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"[生命周期] 应用关闭 🔧✅")