refactor(api): remove v1 MCP server (relanded on main)

Merged
SA
3mo ago
+14-2744

Relands #6077, which was accidentally merged into its stale base branch (mcp-rework/0g-slack-v1-retire) instead of main — GitHub didn't retarget because that branch was never deleted after #6076's squash-merge. Clean cherry-pick of the same commit onto current main.

Same content as #6077:

  • Deletes packages/mcp (v1, 18 tools), apps/api/src/app/api/agent/ route + 274-line auth-flow.ts, the @superset/mcp dep, and the v1 OAuth audience entry.
  • /api/agent/* returns 410 Gone with a hint pointing at the current MCP URL.
  • Docs/openapi updated: v1 removed, not "still available".

See #6077 for the original review context (traffic analysis, graceful-degradation reasoning for old desktop chat builds).

https://claude.ai/code/session_01Kub4p3Eim9pc1qaRRmGea2


Open in Stage

Summary by cubic

Removed the legacy v1 MCP server and route. v1 URLs now return 410 Gone with a hint to /api/v2/agent/mcp; docs and OpenAPI now describe v2 only.

  • Refactors

    • Deleted packages/mcp (18 tools) and the v1 auth/route (apps/api/src/app/api/agent/[transport]/*).
    • Replaced /api/agent/* handlers with a JSON 410 pointing to ${NEXT_PUBLIC_API_URL}/api/v2/agent/mcp.
    • Dropped @superset/mcp from apps/api/package.json and pruned bun.lock.
    • Removed the v1 OAuth audience from @superset/auth config.
    • Updated OpenAPI and apps/docs/content/docs/mcp-server.mdx to mark v1 removed.
  • Migration

    • Update clients to use ${NEXT_PUBLIC_API_URL}/api/v2/agent/mcp. No other changes needed.
    • Legacy desktop builds degrade gracefully; the 410 also stops long SSE timeouts from v1 clients.

Summary by CodeRabbit

  • Breaking Changes

    • The legacy MCP v1 endpoint has been removed and now returns 410 Gone.
    • Clients must migrate to the MCP v2 endpoint.
    • Legacy MCP tools for devices, workspaces, tasks, sessions, and member management are no longer available.
  • Documentation

    • Updated API and MCP documentation to reflect v1 removal and v2 migration requirements.