{"record":{"id":"75112a158b912779","repo":"continuedev/continue","slug":"no-mcp-server-url-found-for-authentication","errorCode":null,"errorMessage":"No MCP server url found for authentication","messagePattern":"No MCP server url found for authentication","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/mcp/MCPOauth.ts","lineNumber":303,"sourceCode":"    }\n  } else {\n    // Fallback: if no state or single context, use the first one\n    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();","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/mcp/MCPOauth.ts#L285-L321","documentation":"FIM (fill-in-the-middle / code completion) on Vertex is only available through Codestral's rawPredict endpoint, so the adapter hard-rejects any model whose name doesn't contain 'codestral' before making the request.","triggerScenarios":"Calling fimStream with any non-Codestral model: gemini, claude, or a plain mistral model id.","commonSituations":"Generic completion code pointed at the Vertex adapter with the default chat model; migrating FIM workflows from Mistral's direct API where other models were accepted.","solutions":["Use a Codestral model id, e.g. 'codestral-2405' / 'mistral-codestral-*' as deployed in your Vertex endpoint","Route FIM requests for other model families to a provider that supports them (e.g. Mistral direct API)","Guard at the call site: check model.includes('codestral') before calling fimStream"],"exampleFix":"// before\napi.fimStream({ model: 'gemini-1.5-pro', prompt, suffix }, signal);\n\n// after\napi.fimStream({ model: 'codestral-2405', prompt, suffix }, signal);","handlingStrategy":"validation","validationCode":"if (!body.model.includes('codestral')) throw new Error('FIM requires a codestral model');","typeGuard":"const isFimCapable = (m: string): boolean => m.includes('codestral');","tryCatchPattern":"try { for await (const c of api.fimStream(body, signal)) {} } catch (e) { if ((e as Error).message.includes('Codestral')) { /* switch model or provider */ } throw e; }","preventionTips":["Guard autocomplete/FIM call sites with a codestral check","Route non-codestral FIM to Mistral's direct API"],"tags":["vertexai","fim","codestral","model-routing"],"backgroundTag":"feature-unsupported-for-model","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}