Skip to content

Show a moved org's v2 MCP URL - #2282

Draft
RhysSullivan wants to merge 3 commits into
mainfrom
v2-moved-mcp-url
Draft

RhysSullivan wants to merge 3 commits into
mainfrom
v2-moved-mcp-url

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

When an org has moved to v2, tell its users and agents where its MCP server is now, and which organization to choose when signing in.

  • GET /api/auth/v2-import returns moved.v2McpUrl (<V2_MCP_ORIGIN>/mcp, for example https://mcp.executor.sh/mcp). This is a new var, set to https://mcp.executor.sh in wrangler.jsonc. If the var is unset, the field is omitted and nothing is shown. It is only in the moved answer, so it only appears for moved orgs.
  • Why /mcp and not /org/<slug>/mcp: an OAuth client hitting the org path without sign-in gets a 401 pointing at v2's protected resource, which is <origin>/mcp. The MCP SDK refuses that resource mismatch, and v2 only grants OAuth for /mcp; the organization is chosen on the consent screen. The org path only works with personal access tokens. So every surface names the v2 org (v2Slug) to choose at sign-in.
  • The moved notice shows the URL with a copy button: "Connect your agents to v2 instead, and choose when you sign in:"
  • The Connect card and /setup-mcp show the v2 URL and npx add-mcp command first, with "Choose when you sign in." below them. The v1 URL stays below, labelled "Old v1 URL" with the note "Won't receive changes made in Executor v2." The shared card reads the move from a context that the cloud shell provides.
  • For a moved org, MCP sessions send initialize instructions: "This organization moved to Executor v2 on . Its MCP server is now ; ask the user to reconnect their agent there and choose the organization when signing in. Changes made through this server won't reach v2." The read happens once per session build, runs in parallel with the stack build, and is capped at 1s. If the read fails, the session gets no instructions. Tools don't change.
  • Instructions only travel in initialize, so a session whose client initialized without the current notice (it connected before the move) is ended on its next request: the session DO's owner check answers terminated, the worker returns HTTP 404, and the Streamable HTTP client starts a new session, whose initialize carries the notice. The notice a client got is recorded when its live initialize arrives (setInitializeRequest, which a cold restore never calls). A restored session reuses the read its rebuild makes; a resident one re-reads WorkOS at most once every 5 minutes, never per request. A session holding a paused execution (an open approval or elicitation) or a running request is kept until that work settles. Tool results and descriptions don't change.
  • The org-to-choose text wraps anywhere, so a 45-character unbroken v2 slug stays inside the notice and the Connect card on a 320px screen.

Tests are in the PR above.

Moved notice with the v2 MCP URL

Moved notice with a long org name

Connect card for a moved org

MCP setup page for a moved org

Notice with a 45-character slug at 320px

Connect card with a 45-character slug at 320px

@RhysSullivan
RhysSullivan added this pull request to stack #2284 October 12, 2026 22:17
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 0ff77f9 Oct 12 2026, 11:30 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 0ff77f9 Commit Preview URL

Branch Preview URL
Oct 12 2026, 11:27 PM

@RhysSullivan RhysSullivan changed the title Show a moved org's v2 MCP URL and tell its MCP sessions Show a moved org's v2 MCP URL Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Cloudflare preview

Console https://executor-preview-pr-2282.executor-e2e.workers.dev
MCP https://executor-preview-pr-2282.executor-e2e.workers.dev/mcp
Deployed commit 0ff77f9

Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes.

@pkg-pr-new

pkg-pr-new Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@2282

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@2282

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@2282

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@2282

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@2282

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@2282

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@2282

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@2282

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@2282

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@2282

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@2282

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@2282

executor

npm i https://pkg.pr.new/executor@2282

commit: 0ff77f9

…slugs

A session's initialize result is the only place it gets the move notice, so a
session initialized without it is ended (404) on its next request once the org
has moved, unless it holds a paused execution or a running request. The
session's client then starts a new one and gets the notice.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant