{"record":{"id":"318bd29a3b08320a","repo":"continuedev/continue","slug":"no-mcp-connection-found-for-mcpid","errorCode":null,"errorMessage":"No MCP connection found for ${mcpId}","messagePattern":"No MCP connection found for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/providers/MCPContextProvider.ts","lineNumber":74,"sourceCode":"  private insertInputToUriTemplate(uri: string, query: string): string {\n    const TEMPLATE_VAR = \"query\";\n    if (uri.includes(`{${TEMPLATE_VAR}}`)) {\n      // Sending an empty string will result in an error, so we instead send \"null\"\n      const queryOrNull = query.trim() === \"\" ? \"null\" : query;\n      return uri.replace(`{${TEMPLATE_VAR}}`, encodeURIComponent(queryOrNull));\n    }\n    return uri;\n  }\n\n  async getContextItems(\n    query: string,\n    extras: ContextProviderExtras,\n  ): Promise<ContextItem[]> {\n    const { mcpId, uri } = MCPContextProvider.decodeMCPResourceId(query);\n\n    const connection = MCPManagerSingleton.getInstance().getConnection(mcpId);\n    if (!connection) {\n      throw new Error(`No MCP connection found for ${mcpId}`);\n    }\n\n    const resourceuri = this.insertInputToUriTemplate(uri, extras.fullInput);\n    const { contents } = await connection.getResource(resourceuri);\n\n    return await Promise.all(\n      contents.map(async (resource) => {\n        if (!(\"text\" in resource) || typeof resource.text !== \"string\") {\n          throw new Error(\n            \"Continue currently only supports text resources from MCP\",\n          );\n        }\n        return {\n          name: resource.uri,\n          description: resource.uri,\n          content: resource.text,\n          uri: {\n            type: \"url\",","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/MCPContextProvider.ts#L56-L92","documentation":"MCPContextProvider.getContextItems decoded an mcpId from the resource query, but MCPManagerSingleton has no live connection registered under that id. The MCP server was never started, failed to start, or was removed from config while the resource id still references it.","triggerScenarios":"Referencing an MCP resource id (@mcpId:resource-uri) whose server is not connected: server crashed at startup, connection closed, or the provider query uses a stale/wrong mcpId.","commonSituations":"MCP server command/path wrong so it never launches; server was disabled or renamed in config but slash-command history still references the old id; server disconnected mid-session.","solutions":["Confirm the MCP server is listed and connected in Continue's MCP settings/logs","Fix the server launch command or package path so it starts successfully","Re-insert the resource from the current MCP list rather than using a stale id"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const conn = MCPManagerSingleton.getInstance().getConnection(mcpId);\nif (!conn) { /* re-establish or skip resource */ }","typeGuard":"function hasMcpConnection(mcpId: string): boolean {\n  return !!MCPManagerSingleton.getInstance().getConnection(mcpId);\n}","tryCatchPattern":null,"preventionTips":["Verify MCP servers show as connected before referencing their resources","Handle server rename/removal by refreshing resource ids"],"tags":["mcp","connection","context-provider"],"backgroundTag":"mcp-server-not-connected","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}