OpenGenerativeUI icon indicating copy to clipboard operation
OpenGenerativeUI copied to clipboard

feat: integrate excalidraw-mcp as first-class diagramming feature

Open jerelvelarde opened this issue 8 months ago • 1 comments

Summary

Closes #11 — makes Excalidraw MCP a showcase feature of this template.

  • MCPAppsMiddleware: Moved MCP config from CopilotRuntime.mcpApps to MCPAppsMiddleware on the LangGraph agent (the correct AG-UI pattern), fixing blank canvas when create_view runs
  • Progressive iframe streaming: First render uses srcdoc; subsequent streaming updates use postMessage to 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 wiring
  • apps/app/src/components/generative-ui/widget-renderer.tsx — streaming + fullscreen
  • apps/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

jerelvelarde avatar Mar 19 '26 14:03 jerelvelarde

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

image

jerelvelarde avatar Mar 20 '26 08:03 jerelvelarde