Skip to content

How to Define Access for templateUri Resources #17

@glide-the

Description

@glide-the

Suppose the port is modified as follows:

"serve": "serve -s ./assets -p 8888 --cors"

How does the MCP server access the resource using the ui:// protocol?

The documentation provides the following explanation:
https://developers.openai.com/apps-sdk/build/mcp-server#

1. Register the template – expose a resource whose mimeType is text/html+skybridge and whose body loads your compiled JS/CSS bundle.
The resource URI (for example ui://widget/kanban-board.html) becomes the canonical ID for your component.


I observed in the code that an MCP resource is being requested here:
https://github.com/openai/openai-apps-sdk-examples/blob/main/pizzaz_server_node/src/server.ts#L178

const widget = widgetsByUri.get(request.params.uri);

However, I noticed that the example’s HTML resource ID does not match the MCP resource ID.

Could it be that the HTML content used online is cached?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions