Commit 0d8276d
feat: Migrate widget metadata to MCP Apps standard (#532)
* feat: Migrate widget metadata to MCP Apps standard
Add MCP Apps standard `_meta.ui.*` metadata alongside legacy `openai/*` keys:
- Add `ui.resourceUri`, `ui.visibility`, `ui.csp`, `ui.domain`, `ui.prefersBorder`
- MIME type: `text/html+skybridge` → `RESOURCE_MIME_TYPE` from `@modelcontextprotocol/ext-apps`
- CSP: ship both snake_case (legacy, MCP Jam compat) and camelCase (MCP Apps spec)
- CSP: add missing `fonts.googleapis.com` and `fonts.gstatic.com` origins
- `stripOpenAiMeta` now also strips `ui` key in non-openai mode
- Add `TODO-mcp-apps-migration.md` tracking remaining migration work
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* move TODO-mcp-apps-migration.md to res directory
* refactor: widget metadata cleanup + MCP Apps capability negotiation (#536)
* refactor: rename stripOpenAiMeta → stripWidgetMeta and filterOpenAiMeta → filterWidgetMeta
The function strips both openai/* and ui keys (not just openai/*), so the
name should reflect it strips all widget-specific metadata. Also updates
comment references in 6 tool files and renames test helpers accordingly.
Closes #533
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add MCP Apps capability negotiation via oninitialized handler
Detect whether the connected client supports MCP Apps UI by checking for
the `io.modelcontextprotocol/ui` extension with `text/html;profile=mcp-app`
MIME type in client capabilities. The `clientSupportsUi` flag is informational
for now — mode gating remains the primary control. Future PRs can use this
flag to conditionally serve widget resources and UI tools.
Closes #534
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: Migrate widget client code to MCP Apps SDK (#537)
* refactor: replace OpenAI hooks with MCP Apps context
- Completely removed `useOpenAiGlobal` hook and replaced all references with the new `useMcpApp`.
- Introduced `McpAppContext` for managing app state using MCP Apps API, providing host context, tool output, and connection status.
- Updated widget hooks (`use-widget-props`, `use-max-height`, `use-display-mode`, etc.) to use MCP Apps context.
- Migrated widget state to React state due to lack of MCP state persistence.
- Updated `ActorSearchDetail` and related display mode calls to use MCP Apps APIs.
- Finalized outstanding TODO-mcp-apps-migration tasks.
* feat: update theme handling and widget metadata to MCP Apps standards
* feat: theme synchronization by applying host styles and fonts
* feat: implement legacy OpenAI globals fallback and enhance CSP compatibility
* feat: enhance ActorRun component to support stable runId retrieval and improve run data initialization
* feat: remove long-running task support from OpenAI call-actor and update related tests
* feat: add ChatGPT compatibility alias for widget output template
* feat: fix MCP App init in chatgpt
* feat: update widget metadata for ChatGPT UX hints and remove outputTemplate
* feat: update widget metadata for ChatGPT UX hints and remove outputTemplate
* feat: Remove unused useDisplayMode
* refactor: remove unused Theme and DisplayMode types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* nit: extract WIDGET_DOMAIN constant to avoid repeating 'https://apify.com'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: replace setWidgetState with app.updateModelContext() on run completion
When an Actor run reaches a terminal status, notify the model via
ui/update-model-context so it can follow up with the results.
Removes the now-unused useWidgetState hook.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "feat: replace setWidgetState with app.updateModelContext() on run completion"
This reverts commit 017108c.
* feat: replace setWidgetState with app.updateModelContext() on run completion
When an Actor run reaches a terminal status, notify the model via
ui/update-model-context so it can follow up with the results.
Removes the now-unused useWidgetState hook.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: Remove any and remove script safety replacement
* fix: Simplify window.openai checks and remove any
* fix: Remove app guard and simplify
* fix: remove hostContext and runId
* fix: update mock window.openai setup for local development
* fix: add AppBridge for mocks
* feat: Remove mock data from prod build (#542)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: Update-ui-parameter (#543)
* fix: Update UI mode parameter from 'openai' to 'true' in documentation and code
* fix: Add integration test for ui=true URL parameter (#544)
* Initial plan
* test: add integration test for ui=true URL parameter
Co-authored-by: jirispilka <19406805+jirispilka@users.noreply.github.com>
* fix: Update uiMode type to string and improve related comments
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jirispilka <19406805+jirispilka@users.noreply.github.com>
Co-authored-by: Jiri Spilka <jirka.spilka@gmail.com>
---------
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>1 parent fb8252e commit 0d8276d
43 files changed
Lines changed: 2525 additions & 936 deletions
File tree
- res
- src
- mcp
- resources
- tools
- core
- default
- openai
- utils
- web
- src
- context
- hooks
- pages
- ActorRun
- ActorSearch
- utils
- widgets
- tests
- integration
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments