{"record":{"id":"08258b28d521a7e5","repo":"continuedev/continue","slug":"continue-currently-only-supports-text-resources-fr","errorCode":null,"errorMessage":"Continue currently only supports text resources from MCP","messagePattern":"Continue currently only supports text resources from MCP","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"core/context/providers/MCPContextProvider.ts","lineNumber":83,"sourceCode":"\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\",\n            value: resource.uri,\n          },\n        };\n      }),\n    );\n  }\n\n  async loadSubmenuItems(\n    args: LoadSubmenuItemsArgs,","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/MCPContextProvider.ts#L65-L101","documentation":"While converting MCP resource contents to ContextItems, a returned resource lacks a string `text` field. The MCP resource protocol allows binary/blob resources, but this provider only supports text resources, so it throws on the first non-text content.","triggerScenarios":"connection.getResource(uri) returns a resource whose content is a Blob or has no text field (e.g. an image or binary file exposed via an MCP server), and the provider tries to map it.","commonSituations":"An MCP server exposes files generically and the URI points at a PDF/image; server returns contents in an older/newer MCP SDK shape without a text property.","solutions":["Point the resource URI at a text file rather than a binary one","Update the MCP server to return text contents for that resource","Catch this error in the caller and skip non-text resources gracefully"],"exampleFix":"// before\nif (!(\"text\" in resource) || typeof resource.text !== \"string\") {\n  throw new Error(\"Continue currently only supports text resources from MCP\");\n}\n// after\nif (!(\"text\" in resource) || typeof resource.text !== \"string\") {\n  console.warn(`Skipping non-text MCP resource: ${resource.uri}`);\n  return null;\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isTextResource(r: unknown): r is { uri: string; text: string } {\n  return typeof r === 'object' && r !== null && 'text' in r && typeof (r as any).text === 'string';\n}","tryCatchPattern":"const items = (await Promise.all(contents.map(async r => isTextResource(r) ? toContextItem(r) : null))).filter(Boolean);","preventionTips":["Filter non-text MCP resources instead of throwing","Prefer text-based resource URIs when configuring MCP servers"],"tags":["mcp","resource","binary","type-mismatch"],"backgroundTag":"mcp-unsupported-resource-type","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}