{"record":{"id":"c8a68dc4095a4df5","repo":"vercel/ai","slug":"no-resources-read-handler-configured","errorCode":null,"errorMessage":"No resources/read handler configured","messagePattern":"No resources/read handler configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react/src/mcp-apps/bridge.ts","lineNumber":375,"sourceCode":"        if (this.handlers.callTool == null) {\n          throw new Error('No tools/call handler configured');\n        }\n        const params = assertToolCallParams(request.params);\n        // Deny-by-default: the (untrusted) MCP App may only invoke tools the\n        // host has explicitly allow-listed. Omitting `allowedTools` exposes no\n        // tools, rather than forwarding every requested tool to `callTool`.\n        if (\n          this.handlers.allowedTools == null ||\n          !this.handlers.allowedTools.includes(params.name)\n        ) {\n          throw new Error(`Tool is not app-visible: ${params.name}`);\n        }\n        return this.handlers.callTool(params);\n      }\n\n      case 'resources/read':\n        if (this.handlers.readResource == null) {\n          throw new Error('No resources/read handler configured');\n        }\n        return this.handlers.readResource(\n          assertResourceReadParams(request.params),\n        );\n\n      case 'resources/list':\n        if (this.handlers.listResources == null) {\n          throw new Error('No resources/list handler configured');\n        }\n        return this.handlers.listResources(request.params);\n\n      case 'ui/open-link':\n        if (this.handlers.openLink == null) {\n          throw new Error('No ui/open-link handler configured');\n        }\n        return this.handlers.openLink(assertOpenLinkParams(request.params));\n\n      case 'ui/message':","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/react/src/mcp-apps/bridge.ts#L357-L393","documentation":"The iframe app sent a `resources/read` request, but the host bridge was constructed without a `readResource` handler. The bridge has no host callback to service the request, so it fails with this error, which is delivered both to the host's `onError` callback and back to the iframe as a JSON-RPC error.","triggerScenarios":"`new MCPAppBridge({ handlers: {...} })` was called without `readResource`, and the app subsequently issued a `resources/read` request for a `ui://` resource.","commonSituations":"Host only wired tool support but the app also reads resources; intentionally read-only host setup while the embedded app still requests resources; handlers object partially copied from another bridge setup.","solutions":["Add a `readResource` handler to the MCPAppBridge handlers if the app should read `ui://` resources.","If resources should be unavailable, update the app to not call resources/read (the host capability `serverResources` is only advertised when the handler exists).","Check for accidental handler omission when constructing the bridge (log `Object.keys(handlers)` at setup).","Serve needed data through an allow-listed tool instead of resources if you do not want to expose resource reading."],"exampleFix":"// before\nhandlers: { callTool: p => client.callTool(p) }\n// after\nhandlers: {\n  callTool: p => client.callTool(p),\n  readResource: ({ uri }) => client.readResource({ uri }),\n}","handlingStrategy":"validation","validationCode":"// host-side, before constructing the bridge:\nif (appReadsResources) {\n  if (typeof handlers.readResource !== 'function') {\n    throw new Error('MCPAppBridge requires a readResource handler when the app reads resources');\n  }\n}","typeGuard":"function hasReadResourceHandler(h: unknown): h is { readResource: (p: { uri: string }) => unknown } {\n  return typeof h === 'object' && h !== null && 'readResource' in h &&\n    typeof (h as any).readResource === 'function';\n}","tryCatchPattern":"try {\n  await appRequest;\n} catch (error) {\n  if (error instanceof Error && error.message === 'No resources/read handler configured') {\n    console.error('Bridge was built without a readResource handler; add one or stop the app from reading resources');\n  }\n}","preventionTips":["Configure readResource when embedding apps that read ui:// resources.","Use handlers.onError during development to surface missing-handler errors immediately.","If resources stay disabled, ensure the embedded app does not issue resources/read calls.","Serve app data via allow-listed tools when you intentionally omit readResource."],"tags":["mcp-apps","configuration","handler","iframe"],"backgroundTag":"missing-handler-configuration","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}