Skip to content

Remove the open_generated_ui MCP tool and generated UI runtime - #667

Merged
kody-bot merged 1 commit into
mainfrom
cursor/remove-generated-ui-tool-6648
Jul 8, 2026
Merged

kody-bot merged 1 commit into
mainfrom
cursor/remove-generated-ui-tool-6648

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Completely eliminates the generated UI / MCP Apps subsystem from the codebase, per request. The MCP tool surface is now just search and execute. Package apps remain and are reached through their hosted package URLs (/@username/packages/:kodyId). Migrations are untouched (additive only).

Removed

  • MCP tool + resource: open_generated_ui tool, generated_ui_app_resource, and the now-empty register-resources.ts
  • Server runtime: /ui-api/* session API (generated-ui-api.ts, generated-ui-app-session.ts), the /dev/generated-ui dev route, the /mcp-apps/* CORS asset-serving branch, the Claude widget origin allowlist, and the runtime HTML entry + claude-widget-domain.ts
  • Client runtime: the entire packages/worker/client/mcp-apps/ directory (kodyWidget runtime, host bridge, contract, styles) and built assets under public/mcp-apps/
  • Shared helpers: generated-ui-utils.ts, generated-ui-documents.ts, generated-ui-asset-paths.ts
  • Build wiring: dev:mcp-apps / build:mcp-apps scripts, the build-mcp-apps Nx target and cache entry, /mcp-apps/* wrangler asset rules, tsconfig includes, .gitignore / .prettierignore entries
  • Orphaned dependencies: @mcp-ui/server and @modelcontextprotocol/ext-apps
  • Docs & guides: docs/guides/generated-ui-oauth.md, the generated_ui_oauth guide catalog entry, and every open_generated_ui / generated-UI reference across docs/use/, docs/guides/, docs/contributing/, primitives.yaml, server instructions, and search tool guidance (reworded to hosted package URLs where package apps are still the subject)
  • Tests: generated-UI unit tests, the /dev/generated-ui security-hardening test, and the inline-UI MCP E2E smoke (the remaining authenticated search smoke still covers the MCP transport + OAuth journey)

Kept

  • All ui_artifacts-related migrations (0006–0042) — additive-only history
  • Package apps: kody.app manifest support, hasApp indexing, hosted app routes, and hostedUrl in search results
System recap — extends existing primitives (medium risk)

Mode: recap · Base: main @ 27b28a4c · Head: a7050629

Classification: extends — removes a tool from the MCP server surface and deletes the generated-UI runtime that backed it; no new primitives. primitives.yaml updated in this PR to drop open_generated_ui from the mcp-server and package-apps summaries.

Primitives touched

Primitive Group Impact
mcp-server surfaces extends — tool surface shrinks to search + execute; resource registration removed
compact-mcp-surface invariant strengthened — one fewer public tool
package-apps assistant composes — hosting unchanged; now opened only via hosted URLs
capability-registry assistant composes — generated_ui_oauth guide entry and values-domain wording removed
secrets assistant composes — doc wording only (host-approval guidance now says "package apps")

System map

flowchart LR
	mcpServer["mcp-server"]:::extended
	genUi["generated-ui runtime (deleted)"]:::added
	packageApps["package-apps"]:::touched
	capabilityRegistry["capability-registry"]:::touched
	appUi["app-ui"]:::untouched
	mcpServer -.->|removed| genUi
	genUi -.->|removed| packageApps
	mcpServer --> capabilityRegistry
	appUi --> packageApps
	classDef touched fill:#1a7f37,color:#fff
	classDef extended fill:#9a6700,color:#fff
	classDef added fill:#cf222e,color:#fff
	classDef untouched fill:#57606a,color:#fff
Loading

Before / after

MCP tools:  search, execute, open_generated_ui   ->  search, execute
Routes:     /ui-api/*, /dev/generated-ui,        ->  (removed; 404)
            /mcp-apps/* asset CORS
Deps:       @mcp-ui/server,                      ->  (removed)
            @modelcontextprotocol/ext-apps

Invariants

compact-mcp-surface: the public MCP tool surface shrinks; server instructions and search guidance updated to match. No per-user-isolation paths changed — only deletions of user-scoped session code.

Verification

  • npm run validate passes in full (format, lint, typecheck, unit, Playwright E2E, MCP E2E)
  • Authenticated MCP E2E client lists exactly ['search', 'execute']
  • Live dev server: /dev/generated-ui, /ui-api/*, and /mcp-apps/* all return 404; /health and /mcp auth gate unaffected
  • Repo-wide sweep: zero remaining references to open_generated_ui, generated-ui, kodyWidget, @kody/ui-utils, mcp-apps, or claudemcpcontent outside migrations
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Search and execute are now the primary MCP tools surfaced to users.
    • Package apps are accessed through hosted package URLs instead of inline open actions.
  • Bug Fixes

    • Simplified app routing and CORS handling for more consistent request behavior.
    • Removed several outdated package-app and OAuth references from user guidance.
  • Documentation

    • Updated guides and policy docs to reflect package-app terminology and the current recommended workflows.

Eliminates the generated UI / MCP Apps subsystem: the open_generated_ui
tool, the generated_ui_app_resource MCP resource, the /ui-api session
API, the /dev/generated-ui dev route, the client kodyWidget runtime
(client/mcp-apps), shared generated-ui helpers, build targets, docs,
guides, and the now-orphaned @mcp-ui/server and
@modelcontextprotocol/ext-apps dependencies. Package apps remain and
are reached through their hosted package URLs. Migrations are left
untouched (additive only).
@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a7d5070e-b316-438f-b42c-07e9e75cb1eb

📥 Commits

Reviewing files that changed from the base of the PR and between c281ac4 and a705062.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (58)
  • .gitignore
  • .prettierignore
  • AGENTS.md
  • docs/contributing/architecture/primitives.yaml
  • docs/contributing/mcp-server-patterns.md
  • docs/contributing/secret-host-approval.md
  • docs/contributing/security.md
  • docs/guides/README.md
  • docs/guides/generated-ui-oauth.md
  • docs/guides/integration-backed-app-happy-path.md
  • docs/guides/integration-bootstrap.md
  • docs/guides/oauth.md
  • docs/guides/secret-backed-integration.md
  • docs/use/execute.md
  • docs/use/first-steps.md
  • docs/use/packages.md
  • nx.json
  • package.json
  • packages/shared/src/generated-ui-asset-paths.ts
  • packages/shared/src/generated-ui-documents.ts
  • packages/shared/src/generated-ui-utils.ts
  • packages/worker/client/mcp-apps/css.d.ts
  • packages/worker/client/mcp-apps/kody-ui-utils-contract.ts
  • packages/worker/client/mcp-apps/kody-ui-utils.css
  • packages/worker/client/mcp-apps/kody-ui-utils.node.test.ts
  • packages/worker/client/mcp-apps/kody-ui-utils.ts
  • packages/worker/client/mcp-apps/kody-widget-runtime.ts
  • packages/worker/client/mcp-apps/widget-host-bridge.node.test.ts
  • packages/worker/client/mcp-apps/widget-host-bridge.ts
  • packages/worker/package.json
  • packages/worker/project.json
  • packages/worker/public/mcp-apps/kody-ui-utils.css
  • packages/worker/src/app/security-headers.ts
  • packages/worker/src/index.ts
  • packages/worker/src/mcp/apps/claude-widget-domain.ts
  • packages/worker/src/mcp/apps/generated-ui-runtime-html-entry.ts
  • packages/worker/src/mcp/capabilities/coding/kody-official-guide.node.test.ts
  • packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts
  • packages/worker/src/mcp/capabilities/values/domain.ts
  • packages/worker/src/mcp/capabilities/values/value-set.ts
  • packages/worker/src/mcp/generated-ui-api.ts
  • packages/worker/src/mcp/generated-ui-app-base-url.node.test.ts
  • packages/worker/src/mcp/generated-ui-app-session.node.test.ts
  • packages/worker/src/mcp/generated-ui-app-session.ts
  • packages/worker/src/mcp/index.ts
  • packages/worker/src/mcp/mcp-server.mcp-e2e.test.ts
  • packages/worker/src/mcp/register-resources.ts
  • packages/worker/src/mcp/register-tools.ts
  • packages/worker/src/mcp/resources/generated-ui-app-resource.ts
  • packages/worker/src/mcp/server-instructions.ts
  • packages/worker/src/mcp/tools/open-generated-ui.node.test.ts
  • packages/worker/src/mcp/tools/open-generated-ui.ts
  • packages/worker/src/mcp/tools/search-format.ts
  • packages/worker/src/mcp/tools/search.ts
  • packages/worker/src/security/security-hardening.workers.test.ts
  • packages/worker/tsconfig-worker.json
  • packages/worker/wrangler.jsonc
  • tsconfig-tools.json
💤 Files with no reviewable changes (37)
  • packages/worker/src/mcp/register-tools.ts
  • packages/worker/src/mcp/generated-ui-app-base-url.node.test.ts
  • packages/worker/public/mcp-apps/kody-ui-utils.css
  • docs/guides/generated-ui-oauth.md
  • packages/worker/client/mcp-apps/widget-host-bridge.ts
  • packages/worker/client/mcp-apps/css.d.ts
  • packages/shared/src/generated-ui-asset-paths.ts
  • tsconfig-tools.json
  • packages/worker/src/mcp/tools/open-generated-ui.node.test.ts
  • packages/worker/src/mcp/register-resources.ts
  • nx.json
  • packages/worker/src/mcp/tools/open-generated-ui.ts
  • packages/worker/src/mcp/generated-ui-app-session.node.test.ts
  • .gitignore
  • .prettierignore
  • packages/worker/client/mcp-apps/widget-host-bridge.node.test.ts
  • packages/worker/src/mcp/apps/generated-ui-runtime-html-entry.ts
  • docs/guides/README.md
  • packages/worker/src/mcp/apps/claude-widget-domain.ts
  • packages/worker/src/mcp/generated-ui-app-session.ts
  • packages/shared/src/generated-ui-utils.ts
  • packages/worker/client/mcp-apps/kody-ui-utils.css
  • packages/worker/client/mcp-apps/kody-widget-runtime.ts
  • packages/worker/package.json
  • packages/shared/src/generated-ui-documents.ts
  • packages/worker/src/security/security-hardening.workers.test.ts
  • packages/worker/src/mcp/index.ts
  • packages/worker/tsconfig-worker.json
  • packages/worker/src/mcp/resources/generated-ui-app-resource.ts
  • packages/worker/client/mcp-apps/kody-ui-utils.ts
  • AGENTS.md
  • packages/worker/src/mcp/generated-ui-api.ts
  • packages/worker/client/mcp-apps/kody-ui-utils-contract.ts
  • packages/worker/client/mcp-apps/kody-ui-utils.node.test.ts
  • packages/worker/wrangler.jsonc
  • packages/worker/src/index.ts
  • packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts

📝 Walkthrough

Walkthrough

This PR removes the entire "generated UI" runtime and MCP feature surface: client bootstrap/runtime modules, the open_generated_ui MCP tool, generated-ui-api/session/resource modules, associated build targets, dependencies, CORS/routing logic, and tests. Documentation and search/capability metadata are updated to reference "package apps" instead.

Changes

Generated UI removal and package app terminology migration

Layer / File(s) Summary
Build, dependency, and config wiring cleanup
nx.json, package.json, packages/worker/package.json, packages/worker/project.json, packages/worker/tsconfig-worker.json, tsconfig-tools.json, packages/worker/wrangler.jsonc, .gitignore
Removes build-mcp-apps targets/scripts, MCP-related dev/build scripts, worker dependencies, tsconfig includes for client/mcp-apps, wrangler run_worker_first mcp-apps patterns (replaced with package/connector routes), and the stale kody-ui-utils.js ignore entry.
Worker entry routing, CORS, and asset serving cleanup
packages/worker/src/index.ts, packages/worker/src/app/security-headers.ts, packages/worker/src/security/security-hardening.workers.test.ts
Removes generated-UI API routing, the Claude widget domain CORS allowlist, the /dev/generated-ui dev endpoint, the special mcp-apps asset CORS block, and the corresponding security-hardening test; updates a security-headers comment.
MCP tool registration and instructions update
packages/worker/src/mcp/register-tools.ts, packages/worker/src/mcp/server-instructions.ts, packages/worker/src/mcp/mcp-server.mcp-e2e.test.ts
Removes registration of the Open Generated UI tool, simplifies base MCP instructions to a two-step search/execute flow, and removes the related authenticated e2e test.
Search tool and result formatting guidance update
packages/worker/src/mcp/tools/search.ts, packages/worker/src/mcp/tools/search-format.ts
Removes openGeneratedUiUsage field and open_generated_ui usage strings, replacing package "open app" guidance with hosted URL links and search-based package detail suggestions.
Capability keyword and description metadata updates
packages/worker/src/mcp/capabilities/coding/kody-official-guide.ts, .../kody-official-guide.node.test.ts, packages/worker/src/mcp/capabilities/values/domain.ts, .../value-set.ts
Removes the generated_ui_oauth guide entry and generated-UI keywords, updates test to use oauth guide, and rewords values capability descriptions to reference package apps.
Documentation terminology migration to package apps
AGENTS.md, docs/contributing/**, docs/guides/**, docs/use/**
Updates architecture, security, guide, and usage documentation to remove generated UI/open_generated_ui references, deletes the generated-ui-oauth guide entry from the index, and describes package app flows and hosted URLs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Worker as appHandler
  participant StaticAssets

  Note over Client,Worker: Before: generated UI widget origins allowlisted
  Client->>Worker: Request with Origin header
  Worker->>Worker: Check exact origin match only
  alt Origin matches url.origin
    Worker-->>Client: Allow CORS response
  else
    Worker-->>Client: Deny CORS
  end
  Worker->>StaticAssets: Serve static asset (safe methods, immutable cache)
  StaticAssets-->>Client: Asset response
Loading

Possibly related PRs

  • kentcdodds/kody#29: Original PR that introduced the open_generated_ui tool and generated UI runtime this PR removes.
  • kentcdodds/kody#162: Adds saved-app backend session/cookie handling into the same open-generated-ui flow and generated-ui API modules removed here.
  • kentcdodds/kody#483: Reworks server-instructions.ts and search.ts guidance to route users away from generated-UI/open-generated-UI flows toward connect/oauth and connect/secret.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing the open_generated_ui tool and the generated UI runtime.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/remove-generated-ui-tool-6648

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kentcdodds
kentcdodds marked this pull request as ready for review July 8, 2026 06:27
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-667.kody-a99.workers.dev

Worker: kody-pr-667
D1: kody-pr-667-db
KV: kody-pr-667-oauth-kv

Mocks:

@kody-bot
kody-bot merged commit 8d7b77b into main Jul 8, 2026
8 checks passed
@kody-bot
kody-bot deleted the cursor/remove-generated-ui-tool-6648 branch July 8, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants