Showing the changes to apps/cloud/src (2 of 26 files). Show all
Unified · Split
| @@ -69,6 +69,8 @@ declare global { · 68 unmodified lines | ||
| 69 | 69 | MCP_PAUSED_SESSION_IDLE_TIMEOUT_MS?: string; |
| 70 | 70 | /** HMAC key for MCP 2026-07-28 continuation state (32+ byte secret). */ |
| 71 | 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 | 74 | NODE_ENV?: string; |
| 73 | 75 | |
| 74 | 76 | // Shared with frontend |
| @@ -4,6 +4,7 @@ import { Effect, Predicate } from "effect"; · 3 unmodified lines | ||
| 4 | 4 | import { |
| 5 | 5 | McpAuthProvider, |
| 6 | 6 | jsonRpcErrorBody, |
| 7 | + mcpModernDisabledResponse, | |
| 7 | 8 | defaultMcpResource, |
| 8 | 9 | UNAVAILABLE_RETRY_AFTER_SECONDS, |
| 9 | 10 | type AuthOutcome, |
| @@ -174,6 +175,9 @@ export const makeCloudMcpAgentHandler = () => { · 164 unmodified lines | ||
| 174 | 175 | const parsedBody = await Effect.runPromise(requestBodyFromRequest(request)); |
| 175 | 176 | const era = await classifyMcpProtocolEra(request, parsedBody); |
| 176 | 177 | if (era === "modern") { |
| 178 | + if (env.MCP_2026_07_28_ENABLED === "false") { | |
| 179 | + return mcpModernDisabledResponse(); | |
| 180 | + } | |
| 177 | 181 | const resource = resourceFromPath(request); |
| 178 | 182 | const props = await runTraced( |
| 179 | 183 | request, |