fix(api): fix MCP OAuth connection through reverse proxy

Merged
SA
9mo ago
+0-2

Summary

  • Remove hardcoded resourceUrl from protectedResourceHandler in both .well-known/oauth-protected-resource routes so mcp-handler auto-derives it from X-Forwarded-Host/X-Forwarded-Proto headers — fixes URL mismatch when connecting through Caddy (https://localhost:3050 vs http://localhost:3041)
  • Add sessionIdGenerator to createMcpHandler config to fix @modelcontextprotocol/sdk v1.26.0 breaking change where stateless transports can no longer be reused across requests

Test plan

  • Verified MCP OAuth connection works through Caddy in local dev (/mcp → "Authentication successful. Reconnected to superset")
  • Tested all MCP tools: list_tasks, list_members, list_task_statuses, create_task, delete_task, list_devices, list_projects, list_workspaces, create_workspace, navigate_to_workspace, start_claude_session, delete_workspace
  • Lint, typecheck, and tests all pass

Summary by CodeRabbit

  • Chores
    • Simplified OAuth protected resource endpoint configuration by removing an unused parameter.