MCP Shipyard
← Rules catalog

MCP app widget resource cannot be read: resources/read fails for the ui:// template

A widget tool points at a resource the server cannot return. Register the exact URI from _meta.ui.resourceUri so resources/read returns the HTML.

blockerapps.template-missingChatGPT, Claude

Register the resource at the exact URI named in the tool's _meta.ui.resourceUri (or openai/outputTemplate) so that resources/read returns the HTML. The rule apps.template-missing is a blocker for ChatGPT and Claude.

What you see

  • A scan reports apps.template-missing with the URI and the failure: "resources/read failed (<reason>)".
  • In a client, the tool may run but no widget appears. The exact client behaviour is not verified here.

Why it happens

The scan lists tools, collects every template URI that a tool references (plus any ui:// resource in resources/list), then calls resources/read on each. The read fails when:

  1. The URI in the tool metadata differs from the registered one by a character, version suffix or trailing slash.
  2. The server does not serve resources/read at all (no resource handler registered). Whether a missing resources capability alone causes this is not verified here.
  3. The resource handler throws, for example because a build artefact is not bundled into the deployed function.
  4. Authentication blocks resources/read while tools/list works.

OpenAI's UI guide treats the template URI as a cache key: to ship a new version you publish a new URI and update every tool that references it. A rename on one side but not the other produces this error.

Check it yourself

curl -s -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"ui://widget/orders.html"}}' | jq '.result.contents[0] | {uri, mimeType, bytes: (.text | length)}'

Use the URI from the tool's _meta. An error or an empty body confirms the problem. Compare it with tools/list: jq '.result.tools[] | {name, ui: ._meta.ui}'.

Fix

  • Copy the URI from the tool metadata into the resource registration, or the reverse. They must be identical.
  • Register a resource handler, and declare the resources capability so clients that check it will look.
  • Make sure the HTML is included in the deployment bundle and read at request time from that location.
  • Serve resources/read with the same authentication as tools/list.

Verify

The curl call returns HTML and mimeType text/html;profile=mcp-app. Re-scan. Then check apps.mime-type and apps.csp-missing.

Which clients care

ChatGPT and Claude, per the rule.

Source

OpenAI UI guide: https://developers.openai.com/plugins/build/chatgpt-ui

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server