egui_mcp
An MCP server that lets an AI agent (Claude, Codex, …) drive a live egui app.
egui-mcp connects to a running app over the
egui_inspection protocol and exposes it as MCP
tools: read the AccessKit widget tree (widget_tree / get_widget), click / type / scroll /
drag / press keys, take a screenshot, resize the window, and wait_for async UI to
settle.
1. Enable inspection in your app
Enable eframe's inspection feature and launch the app with the EGUI_INSPECTION env var set:
EGUI_INSPECTION=1
When the variable is unset or falsy (0 / false), inspection is completely off. See egui_inspection for details,
including how to expose it across the network.
2. Install the mcp
This installs the egui-mcp binary onto your PATH.
3. Configure your agent
Claude Code — register the server with one command:
or add it to your MCP config (~/.claude.json or .mcp.json) manually:
Codex — add it to ~/.codex/config.toml:
[]
= "egui-mcp"
= []
Using it
With the app running and the agent configured, ask the agent to attach, then
drive the app. You could ask it to e.g. reproduce a bug, verify a new feature or just randomly use,
test and explore your app.
Screenshots need a visible window. Reading the tree and injecting input work even while the app is in the background, but capturing a screenshot requires a rendered frame — which the OS won't produce for a fully-occluded or minimized window (notably on macOS). Bring the window to the foreground to capture it.
Developing egui_mcp
This repo has a .mcp.json that claude will pick up. cargo build -p egui_mcp to compile the mcp server.
Then run /mcp and choose reconnect on egui-mcp, to restart the server.
Run (cd ../egui && EGUI_INSPECTION=1 cargo run -p egui_demo_app) to test the mcp.