Skip to content

chore: retire the legacy toolset MCP address - #8248

Open
daviddanialy wants to merge 10 commits into
mainfrom
daviddanialy/aim-670-retire-legacy-alias
Open

daviddanialy wants to merge 10 commits into
mainfrom
daviddanialy/aim-670-retire-legacy-alias

Conversation

@daviddanialy

@daviddanialy daviddanialy commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

AIM-670

Summary

  • Deletes hostedmcp/legacyalias and every call to it. Hosted MCP servers are reached only through their mcp_endpoints rows. A slug that only toolsets.mcp_slug held now returns not found on every surface:
    • /mcp/<slug> POST. GET (SSE) and DELETE answer 405, as for any unknown slug, and nothing is proxied.
    • both .well-known metadata routes
    • the per-endpoint OAuth handlers (register, authorize, token), and the shared authorization server's resource lookup
    • the install page and metadata export
    • cached challenges that name only a toolset (no mcp_server_id)
  • Rejects the old toolset-URN audience. A bearer must carry the server's resource, issuer or issuer-servers audience. Tool selections stored as toolset:<id> keep binding the toolset's server, so existing sessions keep serving, refreshing and redeeming codes.
  • Removes the migration counters mcp.toolset_slug_fallback and mcp.legacy_audience_accepted, their attribution log lines, and their gram.mcp.entry_point / gram.mcp.fallback.* attribute conventions.
  • Endpoints are the only address everywhere else too:
    • Plugin generation drops a hosted server that has no usable endpoint, where it used to emit the toolset-slug URL. Adding a toolset to a plugin needs an endpoint.
    • The slug availability check covers only endpoints. Endpoint writes no longer move a toolset alias.
    • Toolset views take mcp_slug / custom_domain_id from the canonical server's endpoint. The API fields are unchanged.
    • The same goes for telemetry matchers, assistant attachments, admin health, attach impact, mint, external MCP migration candidates and the OpenAPI impact report.
    • The Platform MCP connection settings and plugin views do this too. The connection-settings tool output drops legacy_platform_slug, which reported the custom-domain alias the platform host still served.
    • mcpServers keeps legacy_platform_slug, now deprecated and always absent.
  • mcpEndpoints.checkSlugAvailability: mcp_server_id is deprecated and ignored, so it can no longer fail the call (Goa, OpenAPI, SDK). The dashboard stops sending it.
  • Dashboard: the server address settings drop the row for the older Speakeasy address, which the API no longer reports.
  • No schema change. sqlc_retired_columns.sql and the toolset columns stay; AIM-671 drops them. The legacyalias sqlc package entry is gone.

Motivation

Since hosted servers own their endpoints (#8021), the alias was only a fallback for slugs no endpoint holds. #8132 fenced every remaining read of it into one package so it could be removed in one step. This PR removes it, so AIM-671 can drop the columns.

Customer impact: an address that exists only as a toolset's old mcp_slug stops serving. Old toolset-audience tokens are refused, so those clients sign in again. Making the address an endpoint on the server keeps it working.

Rollout

  • During the deploy, an old pod can answer 409 to an endpoint write whose new slug equals a stale toolset alias, since old pods still count aliases as taken. Retrying on a new pod succeeds.
  • A rollback revives every stale alias. Endpoint renames made while this PR was live did not move the aliases, so a revived alias can point at a slug the server no longer uses.

Merge gate

Do not merge until all hold:

  • AIM-821 (explicit endpoints for every address a legacy alias still serves) is applied on dev and prod, so no stored URL depends on the alias and no alias slug becomes claimable.
  • Datadog monitor 337099195 (legacy slug fallback, excluding install-page crawlers) reads OK after the backfill. It evaluates a 2-day window.
  • 2026-11-07 or later: 720h after the legacy toolset audience was last accepted, so no access token carrying it can still be valid. Endpoint routes already re-mint with the issuer audience.

🤖 Generated with Claude Code


Summary by cubic

Retires the legacy toolset /mcp/<slug> address and every fallback that resolved through toolsets.mcp_slug. Hosted MCP servers are now reached only through their mcp_endpoints rows, so a slug only a toolset still holds returns not found on every surface: the /mcp/<slug> routes, both .well-known metadata routes, the per-endpoint OAuth handlers, the shared authorization server resource lookup, the install page, and cached challenges without a server ID.

Also rejects the legacy toolset-URN bearer audience. Access tokens must name the server; clients holding toolset-audience tokens sign in again. Tool selections already stored as toolset:<id> keep binding, so existing sessions keep serving, refreshing, and redeeming codes. legacy_platform_slug is now deprecated and always absent, checkSlugAvailability ignores mcp_server_id, and the dashboard drops the older Speakeasy address. The migration counters and their attribution conventions are gone, and plugin generation drops hosted servers with no usable endpoint.

Migration

  • To keep an address working, add it as an endpoint on the server.
  • During deploy, an endpoint write whose new slug matches a stale alias can 409 from an old pod; retry on a new pod.
  • Do not merge until AIM-821 is applied on dev and prod, Datadog monitor 337099195 reads OK, and 2026-11-07 has passed (720h after the legacy audience was last accepted).

Written for commit 41cfcc9. Summary will update on new commits.

View guided diff Turn on auto-fix


🚀 Preview Environment (PR #8248)

Preview URL: https://pr-8248.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Existing database reused 2026-10-30 23:43:05.
✅ Images Available Container images ready 2026-10-30 23:45:02.

Gram Preview Bot

daviddanialy and others added 3 commits October 28, 2026 14:48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… seed docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@daviddanialy
daviddanialy requested review from a team as code owners October 28, 2026 21:49
@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

AIM-670

@changeset-bot

changeset-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 41cfcc9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
dashboard Patch
server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@daviddanialy

Copy link
Copy Markdown
Contributor Author

E2E on 88a563eb20 (rebased since; later commits are comment/doc only), local lane; merge-base binaries swapped onto the same DB.

  • Endpoint-backed servers: public and private (full user-session sign-in) initialize/tools/list/tools/call, well-known, install, export identical on both binaries. PASS
  • Custom-domain serving: NOT RUN, the local env skips the custom-domain middleware; plugin/export custom-domain URLs match.
  • Alias-only slugs (platform, loose custom-domain, endpoint-deleted): served on merge-base; 404 on branch for /mcp POST, both well-known routes, register, authorize, token, install, export. GET/DELETE return 405 on both, same as an unknown slug. PASS
  • Sessions across the upgrade: stored toolset:<id> selection still serves and refreshes; legacy toolset-audience bearer rejected. PASS
  • Plugins: republished endpoint-backed entries identical for claude, cursor, codex, opencode; endpointless server drops out. PASS
  • Slug availability and endpoint create/rename/delete on hosted servers: PASS (merge-base 409s on a stale-alias slug, documented under Rollout).
  • Dashboard address section and server pages: PASS. External MCP migration dry run: PASS. Rollback to merge-base: PASS.

@github-actions github-actions Bot added the preview Spawn a preview environment label Oct 28, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread server/internal/plugins/queries.sql Resolved
Comment thread server/internal/mcpmetadata/impl.go Resolved
Comment thread overlays/goa-common.yaml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 164 files

Requires human review: Auto-approval blocked because this review re-detected 5 unresolved issues already reported by Cubic.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread server/internal/mcp/wellknown_test.go Resolved
Comment thread server/internal/mcpendpoints/resolve.go Resolved
Comment thread server/design/mcpservers/design.go Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 19 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@blacksmith-sh

This comment has been minimized.

daviddanialy and others added 4 commits October 28, 2026 16:43
…retire-legacy-alias

# Conflicts:
#	server/internal/attr/conventions.go
…retire-legacy-alias

# Conflicts:
#	seed/demo/PAGES.md
#	server/database/sqlc_retired_columns.sql
#	server/internal/mcp/serveendpoint.go
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant