Showing the changes to apps/cloud (3 of 26 files). Show all
Unified · Split
| @@ -69,6 +69,8 @@ declare global { · 68 unmodified lines | |||
| 69 | MCP_PAUSED_SESSION_IDLE_TIMEOUT_MS?: string; | 69 | MCP_PAUSED_SESSION_IDLE_TIMEOUT_MS?: string; |
| 70 | /** HMAC key for MCP 2026-07-28 continuation state (32+ byte secret). */ | 70 | /** HMAC key for MCP 2026-07-28 continuation state (32+ byte secret). */ |
| 71 | MCP_REQUEST_STATE_KEY?: string; | 71 | MCP_REQUEST_STATE_KEY?: string; |
| 72 | /** Emergency rollback for inbound MCP 2026-07-28 traffic only. */ | ||
| 73 | MCP_2026_07_28_ENABLED?: string; | ||
| 72 | NODE_ENV?: string; | 74 | NODE_ENV?: string; |
| 73 | 75 | ||
| 74 | // Shared with frontend | 76 | // Shared with frontend |
| @@ -4,6 +4,7 @@ import { Effect, Predicate } from "effect"; · 3 unmodified lines | |||
| 4 | import { | 4 | import { |
| 5 | McpAuthProvider, | 5 | McpAuthProvider, |
| 6 | jsonRpcErrorBody, | 6 | jsonRpcErrorBody, |
| 7 | mcpModernDisabledResponse, | ||
| 7 | defaultMcpResource, | 8 | defaultMcpResource, |
| 8 | UNAVAILABLE_RETRY_AFTER_SECONDS, | 9 | UNAVAILABLE_RETRY_AFTER_SECONDS, |
| 9 | type AuthOutcome, | 10 | type AuthOutcome, |
| @@ -174,6 +175,9 @@ export const makeCloudMcpAgentHandler = () => { · 164 unmodified lines | |||
| 174 | const parsedBody = await Effect.runPromise(requestBodyFromRequest(request)); | 175 | const parsedBody = await Effect.runPromise(requestBodyFromRequest(request)); |
| 175 | const era = await classifyMcpProtocolEra(request, parsedBody); | 176 | const era = await classifyMcpProtocolEra(request, parsedBody); |
| 176 | if (era === "modern") { | 177 | if (era === "modern") { |
| 178 | if (env.MCP_2026_07_28_ENABLED === "false") { | ||
| 179 | return mcpModernDisabledResponse(); | ||
| 180 | } | ||
| 177 | const resource = resourceFromPath(request); | 181 | const resource = resourceFromPath(request); |
| 178 | const props = await runTraced( | 182 | const props = await runTraced( |
| 179 | request, | 183 | request, |
| @@ -101,6 +101,9 @@ · 100 unmodified lines | |||
| 101 | // secret for both with `wrangler secret put MCP_REQUEST_STATE_KEY`. | 101 | // secret for both with `wrangler secret put MCP_REQUEST_STATE_KEY`. |
| 102 | // It must never be placed in `vars` or generated independently per isolate. | 102 | // It must never be placed in `vars` or generated independently per isolate. |
| 103 | "vars": { | 103 | "vars": { |
| 104 | // MCP_2026_07_28_ENABLED is intentionally absent: unset enables modern | ||
| 105 | // inbound serving. Set the Worker var to "false" for emergency rollback; | ||
| 106 | // legacy serving remains available. | ||
| 104 | "VITE_PUBLIC_SITE_URL": "https://executor.sh", | 107 | "VITE_PUBLIC_SITE_URL": "https://executor.sh", |
| 105 | "VITE_PUBLIC_POSTHOG_KEY": "phc_nNLrNMALpRsfrEkZovUkfMxYbcJvHnsJHeoSPavprgLL", | 108 | "VITE_PUBLIC_POSTHOG_KEY": "phc_nNLrNMALpRsfrEkZovUkfMxYbcJvHnsJHeoSPavprgLL", |
| 106 | // Browser OTLP spans → same-origin, forwarded to Axiom by the worker | 109 | // Browser OTLP spans → same-origin, forwarded to Axiom by the worker |