refactor(api): remove dead legacy unscoped /mcp/* route mounts#3665
Draft
viktormarinho wants to merge 1 commit into
Draft
refactor(api): remove dead legacy unscoped /mcp/* route mounts#3665viktormarinho wants to merge 1 commit into
viktormarinho wants to merge 1 commit into
Conversation
Remove the legacy /mcp/:connectionId, /mcp/self, /mcp/gateway and /mcp/virtual-mcp mounts plus their now-dead mcpAuth registrations and orphaned imports. All MCP traffic goes through the org-scoped /api/:org/mcp/* routes in createOrgScopedApi; inbound traffic to the legacy paths has drained to ~0. Migrate the access-control, proxy and oauth-proxy integration suites to the scoped paths (seeding org membership so resolveOrgFromPath admits the principal), since they exercised RBAC / cross-org behavior through the now-removed unscoped surface. DO NOT MERGE until the legacy-URL emitters (@deco/runtime bindings, @deco/mesh-sdk constants + mcp-oauth fallback, decopilot dispatch, typegen) are migrated to scoped paths and older published-package versions drain. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the legacy unscoped MCP route mounts from
app.ts:/mcp/:connectionId(legacyProxy)/mcp/self(legacySelf)/mcp/gateway/:virtualMcpId+/mcp/virtual-mcp/:virtualMcpId(legacyVirtualMcp)app.use("/mcp/...", mcpAuth)registrations + 3 orphaned importsAll MCP traffic already flows through the org-scoped
/api/:org/mcp/*routes increateOrgScopedApi(which frontresolveOrgFromPath+mcpAuth). These factories (createProxyRoutes,createSelfRoutes,createVirtualMcpRoutes) are unchanged and still mounted there.Why now
Production inbound traffic (HyperDX,
service:mesh,span.kind:internal, 7d) to the unscoped/mcp/self,/mcp/:connectionId,/mcp/gateway,/mcp/virtual-mcppaths has drained to ~0 — all live MCP traffic is on/api/:org/mcp/*.Test migration
The
access-control,proxy, andoauth-proxyintegration suites drove their assertions through the removed unscoped surface (and, due to loosenot.toBe(403)/[403,404]assertions, were passing vacuously on 404). Migrated them to/api/:org/mcp/*, seedingmemberrows soresolveOrgFromPathadmits the principal. They now exercise the real surviving route + RBAC again.tsc --noEmit,oxlint,knipall cleanSeveral live code paths (incl. published packages) still construct these legacy URLs:
@deco/runtimebindings.ts→${meshUrl}/mcp/${connectionId}@deco/mesh-sdkconstants.ts(self connection_url) +mcp-oauth.ts(no-orgSlugfallback)decopilot/dispatch-run.ts→/mcp/virtual-mcp/${agentId}typegenCLI →/mcp/virtual-mcp/${mcpId}These must be migrated to scoped paths (separate PR) and older published-package versions must drain before this can merge. Re-confirm via the
deprecated routesignal (note: that log currently can't fire —console.logisn't bridged to OTLP inobservability/index.ts; fix that first).🤖 Generated with Claude Code
Summary by cubic
Removed the legacy unscoped MCP routes and guards, consolidating all MCP traffic under
/api/:org/mcp/*. Updated integration tests to use the scoped paths so they exercise real org resolution and RBAC.Refactors
/mcp/:connectionId,/mcp/self,/mcp/gateway/:virtualMcpId,/mcp/virtual-mcp/:virtualMcpIdmounts and theirmcpAuthregistrations.createProxyRoutes,createSelfRoutes, andcreateVirtualMcpRoutescontinue to run under the org-scoped API; handlers unchanged.Migration
@deco/runtime(bindings),@deco/mesh-sdk(constants and OAuth fallback), meshdecopilot/dispatch-run.ts, andtypegenCLI.console.logto OTLP inobservability/index.ts.Written for commit cbe5f23. Summary will update on new commits.