Hello
I’m building an MCP server with a widget and need help with the punch-out button.
The Problem
When my tool generates content, it creates a unique URL with a parameter (e.g., https:/example.com/item?id=ABC123). I want the punch-out button to open this specific URL, but it only opens the static base domain (https:/example.com) that I set in the resource’s _meta.
What I’ve Tried
I’ve tried setting openai/widgetDomain in:
- The resource definition (in resources/read response)
- The tool response
_meta - The widget resource’s
_metainside the tool response
None of these approaches make the punch-out button use the dynamic URL.
The Question
How do I make the punch-out button open a different URL for each tool invocation?
I know Canva does this - when you generate a design, the punch-out button opens that specific design’s editor, How is this achieved?
Any guidance would be appreciated! Thanks!