{"record":{"id":"3cd9543c65e2dfad","repo":"continuedev/continue","slug":"no-mcp-authorization-code-found-for-serverurl","errorCode":null,"errorMessage":"No MCP authorization code found for ${serverUrl}","messagePattern":"No MCP authorization code found for (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/mcp/MCPOauth.ts","lineNumber":306,"sourceCode":"    const contexts = Array.from(authenticatingContexts.entries());\n    if (contexts.length === 1) {\n      [serverUrl, context] = contexts[0];\n    }\n  }\n\n  if (!context || !serverUrl) {\n    console.error(\"No matching authenticating context found for state:\", state);\n    return;\n  }\n\n  const { ide, serverId } = context;\n\n  try {\n    if (!serverUrl) {\n      throw new Error(\"No MCP server url found for authentication\");\n    }\n    if (!authorizationCode) {\n      throw new Error(`No MCP authorization code found for ${serverUrl}`);\n    }\n\n    // Close the server before processing auth\n    if (serverInstance) {\n      await new Promise<void>((resolve) => {\n        serverInstance!.close(() => {\n          console.debug(\"Server for MCP Oauth process was closed\");\n          serverInstance = null;\n          resolve();\n        });\n      });\n    }\n\n    const authProvider = new MCPConnectionOauthProvider(serverUrl, ide);\n    await authProvider.ensureRedirectUrl();\n    const authStatus = await auth(authProvider, {\n      serverUrl,\n      authorizationCode,","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/mcp/MCPOauth.ts#L288-L324","documentation":"Non-2xx from the Codestral FIM rawPredict endpoint on Vertex. Unlike the chat paths, only status/statusText are included — no response body — which makes diagnosis harder since Google's detailed error JSON is dropped.","triggerScenarios":"Auth/quota/project issues on the FIM request: expired token, missing aiplatform.user role, model not deployed/enabled, 429 rate limit.","commonSituations":"FIM works then starts failing after token expiry; Codestral not enabled in Model Garden for the project; sustained IDE autocomplete traffic hitting quota.","solutions":["Reproduce the same body with curl using a fresh token to capture the response body Google returns","Check quota and model enablement for codestral in the project/region","Wrap fimStream calls in retry with backoff for 429/5xx","Consider patching the adapter to include await response.text() in the message for better diagnostics"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { for await (const c of api.fimStream(body, signal)) {} } catch (e) { const m = (e as Error).message; if (/429|5\\d\\d/.test(m)) await retryWithBackoff(); else throw e; }","preventionTips":["Since the error omits the body, log request context (model, project, region) when it fires","Reproduce failures with curl to capture Google's detailed error","Throttle FIM request rates (IDE autocomplete is bursty)"],"tags":["vertexai","fim","http-error","codestral"],"backgroundTag":"upstream-api-http-error","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}