Slim the generative_ui_agents example READMEs to user-facing content, removing generic boilerplate (Troubleshooting, Contributing, License sections) and deep internal dev/ops notes that belong in app dev docs. - ai-mcp-app-builder: drop Scripts reference tables, E2B template build, Agent-and-UI internals, React-keys RCA, Render walkthrough, and the lockfile note (144 -> 68 lines) - generative-ui-starter-project: drop boilerplate sections; collapse the repeated npm/pnpm/yarn/bun blocks to a single example (208 -> 162) - ai-financial-coach-agent: drop boilerplate sections; collapse package- manager blocks; rename duplicate "Documentation" heading to "Customization" (137 -> 80) - ai-dashboard-canvas-agent: drop Troubleshooting/Contributing/License (91 -> 69) - mcp-apps-generative-ui-showcase, ai-shadcn-component-generator: drop License section (short demo/deploy sections kept) Short deploy/demo sections retained; no broken references introduced.
AI MCP App Builder
Describe an MCP app in chat and get a live, sandboxed instance back. Built with CopilotKit, AG-UI, Mastra, and E2B sandboxes.
Gen UI concept — agent-generated apps. Most generative UI picks from a fixed catalogue of components. This goes a step further: the agent authors a brand-new MCP app at runtime, the builder provisions an E2B sandbox to host it, and the app renders inline with full bidirectional tool access. The "component" the agent emits is a whole app.
This monorepo wires up the MCP App builder web UI (apps/web) to a Mastra agent (/api/mastra-agent) that provisions E2B sandboxes running the mcp-use-server template (apps/mcp-use-server). An optional local sample is the Three.js MCP example in apps/threejs-server (used for sidebar defaults when running everything locally).
https://github.com/user-attachments/assets/4bb35806-5e42-43c0-a8fe-01c0d1e5b8b3
Prerequisites
- Node.js 20+
- pnpm (required for the workspace)
- OpenAI API key (
OPENAI_API_KEY); optionalOPENAI_MODELfor/api/mastra-agent(defaultgpt-5.5)
Getting started
From the project root (generative_ui_agents/ai-mcp-app-builder):
pnpm i
Copy-Item .env.example .env
# Edit .env: set OPENAI_API_KEY=sk-proj-... at minimum; add E2B_* for sandbox provisioning (see below)
pnpm dev
pnpm dev runs Turbo and starts workspace dev tasks (the Next.js app and other configured apps — see root package.json / turbo.json).
Run pieces individually
| Goal | Command |
|---|---|
| Web app only | pnpm --filter web dev (from repo root) or cd apps/web && pnpm dev |
| Three.js MCP sample (local sidebar default) | cd apps/threejs-server && pnpm dev |
mcp-use-server (local MCP, not the E2B image) |
cd apps/mcp-use-server && pnpm dev |
Open the URL shown by Next (usually http://localhost:3000).
Dynamic MCP UI (sidebar)
- MCP servers: add/remove by URL (+ optional
serverId); list is sent asx-mcp-servers. Built-in default: Excalidraw (https://mcp.excalidraw.com). Override viaNEXT_PUBLIC_DEFAULT_MCP_SERVERS/DEFAULT_MCP_SERVERS. - Tools: compact list; open a tool for detail + preview in a modal (not a third mobile tab).
- Chat: CopilotKit v2 chat with suggestions.
Mobile layout
- Tabs: Chat and Tools (servers + tool list). Tool preview / detail opens in a modal.
- Desktop: sidebar + chat column (
md+). - Chat UX: spacing and bottom padding so the composer does not cover the latest messages.
Environment variables (E2B)
| Variable | Description |
|---|---|
E2B_API_KEY |
From e2b.dev/dashboard |
E2B_TEMPLATE |
templateId from Template.build output after build.dev.ts / build.prod.ts |
E2B_REPO_URL |
Used when E2B_TEMPLATE is empty — clones repo into sandbox (slower cold start). Default in code: mcp-use-server-template GitHub URL |
Documentation
UI entry: apps/web/app/page.tsx (theme, layout, CopilotKit wiring).
External