showcase/integrations/langgraph-python/qa/mcp-apps.md
/demos/mcp-apps on the dashboard hostOPENAI_API_KEY is set on Railway; LANGGRAPH_DEPLOYMENT_URL points at a LangGraph deployment exposing the mcp_apps graph (registered as agent name mcp-apps — see src/app/api/copilotkit-mcp-apps/route.ts)https://mcp.excalidraw.com (override via MCP_SERVER_URL). Pinned serverId: "excalidraw" so URL changes don't silently break persisted activitiesdata-testid attributes and registers no custom activity renderer — CopilotKit's built-in MCPAppsActivityRenderer handles the sandboxed iframe automatically. Checks below rely on verbatim visible text, network traffic, and the iframe DOM/demos/mcp-apps; verify the page renders within 3s and a single CopilotChat pane is centered (max-width ~896px, rounded-2xl, full-height)runtimeUrl="/api/copilotkit-mcp-apps" and agent="mcp-apps" (DevTools → Network: sending a message hits that endpoint)mcpApps.servers)/api/copilotkit-mcp-apps succeeds (status 200) and the server-side runtime resolves tools from https://mcp.excalidraw.com (watch the server logs for the MCP Apps middleware attaching the Excalidraw tool set — notably create_view)create_view)create_view MCP tool exactly ONCE (per SYSTEM_PROMPT in src/agents/mcp_apps_agent.py: "Call create_view ONCE with 3-5 elements total") — confirm via DevTools → Network stream or backend logsid, and ends with ONE cameraUpdate sized 600x450 or 800x600MCPAppsActivityRenderer)<iframe> renders inline in the chat transcript (activity-message slot) pointed at the Excalidraw MCP UI resourcesandbox attribute (CopilotKit's built-in renderer always sandboxes MCP UI resources)serverId: "excalidraw" in the runtime config)"Use Excalidraw to draw exactly 2 rectangles labelled 'A' and 'B' connected by one arrow from A to B."create_view is called ONCE with exactly 3 elements (2 rectangles + 1 arrow) plus the trailing cameraUpdate; (2) an iframe renders showing two labelled rectangles with a connecting arrow; (3) the assistant reply is one short sentence; (4) no duplicate create_view invocations or retries appear in network / logscreate_view (no iframe, no MCP activity in the stream)mcp.excalidraw.com, and no "sandbox" / iframe-permission warningscreate_view call)https://mcp.excalidraw.com succeeds and the Excalidraw tool set (including create_view) is advertised to the agent at request timecreate_view tool call → activity event → sandboxed iframe painting the requested diagramMCPAppsActivityRenderer is used (no app-side useRenderActivityMessage / renderActivityMessages registration exists in page.tsx — per the @region[no-frontend-renderer-needed] contract)create_view invocations within a single prompt turn