graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
MCP Apps in Codegraff
This page describes the desktop app that used to live in this repository. The desktop app is now Harness, which drives graff over ACP. Harness does not render MCP Apps views yet; the tool result text and images still reach the transcript.
Call a connected MCP tool that declares an MCP Apps UI. In the native GUI, its tool result includes an Interactive MCP result view. Close/reopen controls dispose and restore the view. Text and image output stays available in the transcript.
In the REPL, run /mcp apps after the tool completes to open its latest saved view in the default browser. The link in the tool result also identifies the standalone HTML file. This works with the existing MCP server configuration and consent process; it does not install or authorize additional servers.
Views can display results, scroll, resize, and offer source links. Clicking a source exposes an Open source link in trusted host chrome for a user click. Image-copy features depend on browser permissions; the isolated view may need the app's copy-link or manual-selection fallback. The framed app can send ui/initialize over postMessage (MCP Apps 2026-01-26). The host answers with the protocol version. App-initiated tools/call for mcp__ tools is forwarded through ACP (session/mcp_call) on the live chat; native engine tools stay refused (#1018).
Snapshots are stored in the user's .graff/mcp-apps directory with private file permissions and opaque ids. They include the tool result and its view metadata, remain available across transcript reloads, and can be deleted when no longer needed. The REPL shortcut tracks the latest view in its current session; old snapshots remain openable by their saved links.
Development and regression checks
Build the engine and run its offline integration fixtures:
zig build
zig build test --summary all
python3 scripts/test-mcp-apps.py
The Python fixtures start local MCP and scripted-model servers. They verify text and base64 resources, saved results, exclusion of private UI metadata from model requests, private snapshot permissions, and invalid-resource fallback. The scripted model uses its established local test port; no provider API is called.
See the architecture decision for the isolation and capability boundary.