feat(ai): serveur MCP Streamable HTTP + confirmations two-step (#79 phase E)
CI / lint (push) Successful in 1m3s
CI / security (push) Successful in 41s
CI / test (push) Successful in 1m20s
CI / build (push) Successful in 1m19s
CI / e2e (push) Successful in 10m56s
Desktop Build / build-windows (push) Canceled after 0s
Desktop Build / build-linux (push) Canceled after 0s

This commit is contained in:
2026-09-11 21:28:05 -04:00
parent 83c412b33d
commit 88eecd7671
9 changed files with 984 additions and 17 deletions
+9
View File
@@ -800,6 +800,7 @@ class SSESafeGZipMiddleware(GZipMiddleware):
"/api/admin/stream",
"/api/ai/bookslm/chat",
"/api/ai/bookslm/agent",
"/mcp",
)
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
@@ -882,6 +883,14 @@ try:
except ImportError as e:
logger.warning(f"Could not load plugins router: {e}")
# MCP server (Streamable HTTP) for external clients (#79 phase E)
try:
from backend.mcp.server import McpMount, mcp_app
app.router.routes.append(McpMount(mcp_app))
logger.info("MCP server mounted at /mcp")
except Exception as e: # pragma: no cover - optional dependency
logger.warning(f"Could not mount MCP server: {e}")
# Resolve frontend path relative to this file
FRONTEND_DIR = Path(__file__).resolve().parent.parent / "frontend"