OpenGenerativeUI
OpenGenerativeUI copied to clipboard
feat: integrate excalidraw-mcp as first-class diagramming feature
Summary
Closes #11 — makes Excalidraw MCP a showcase feature of this template.
- MCPAppsMiddleware: Moved MCP config from
CopilotRuntime.mcpAppstoMCPAppsMiddlewareon the LangGraph agent (the correct AG-UI pattern), fixing blank canvas whencreate_viewruns - Progressive iframe streaming: First render uses
srcdoc; subsequent streaming updates usepostMessageto patch#content.innerHTML— preserves JS state (Three.js scenes, step counters) across updates - Fullscreen modal: 75% focused modal overlay with backdrop blur, Escape/click-outside to close, same iframe stays mounted (no reload)
- Excalidraw diagram skill: Agent skill with camera reveal patterns, color grammar, typography rules, and element reference snippets
https://github.com/user-attachments/assets/7199e4e2-484a-4d5b-817f-d53136c1c531
Files changed
apps/app/src/app/api/copilotkit/route.ts— MCPAppsMiddleware wiringapps/app/src/components/generative-ui/widget-renderer.tsx— streaming + fullscreenapps/agent/skills/excalidraw-diagram-skill.txt— agent diagram skill
Test plan
- [ ] Ask "use excalidraw to draw how an MCP interacts with an app" — diagram renders inline
- [ ] During streaming, widget updates without flashing/reloading
- [ ] Click "⤢ Expand" — 75% modal overlay appears
- [ ] Press Escape or click backdrop — modal closes without iframe reload
- [ ] Verify agent picks up excalidraw skill in system prompt (restart agent)
🤖 Generated with Claude Code
Found the issue that got me stuck last night, it's a known issue directly with Excalidraw's MCP app 🤦https://github.com/excalidraw/excalidraw-mcp/issues/22