Files
OmniRoute/docs/frameworks
diegosouzapw fd030b408d fix(cli): add POST /api/mcp/restart and mcp enable/disable subcommands (#13012)
`bin/cli/commands/mcp.mjs::runMcpRestartCommand` POSTs to /api/mcp/restart,
but that route never existed under src/app/api/mcp/ — every `omniroute mcp
restart` call 404d. There was also no CLI/env path to flip the mcpEnabled
setting on: it was dashboard-only (/dashboard/mcp -> PATCH /api/settings),
stranding headless/portable installs (Windows portable Node, no browser
session) with no way to reach the MCP server's 110 tools.

Adds the missing route (auth-gated via requireManagementAuth, 409 when
disabled, 501 for stdio since HTTP/SSE sessions are the only in-process
handle shutdownMcpHttp() can tear down) plus `omniroute mcp enable
[--transport stdio|sse|streamable-http]` / `mcp disable`, which PATCH
/api/settings the same way the dashboard toggle does. `mcp status` now
hints at `mcp enable` when it reports the server stopped because it is
disabled.

Regression tests: tests/unit/mcp-restart-route-13012.test.ts (route
behavior across disabled/stdio/http-family states + LOCAL_ONLY
classification) and tests/unit/cli-mcp-enable-disable-13012.test.ts
(PATCH body shape).
2026-09-15 19:55:49 -03:00
..
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00