gpui-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gpui-mcptake a screenshot of the current app window"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gpui-mcp
Give MCP agents eyes and hands inside a GPUI app.
Agents can inspect the live UI, click, type, focus, hover, drag, scroll, take screenshots, and record video. The bridge works on Windows 11, macOS, and Linux; exact-window capture on Linux currently requires X11.
Windows screenshots take a short ordered burst of compositor samples and return the newest, because Windows Graphics Capture can hand back an older composited frame first. The one-second deadline on that burst bounds how long the capture waits for the compositor, not how long the readbacks themselves take: the cost of a readback scales with the window's pixel count and with whether the server was built optimized, so it is measured on the first sample and credited back to the budget, up to a bound. A 5120x1440 window captures from a debug build, and an ordinary window keeps the one-second wait.
Setup
Install the MCP server:
cargo install --git https://github.com/themixednuts/gpui-mcp --locked gpui-mcp-serverAdd it to your MCP client:
{
"mcpServers": {
"gpui": {
"command": "gpui-mcp"
}
}
}Add the bridge and its GPUI build to your app:
[dependencies]
gpui = "=0.2.2"
gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "82878540b5410b288a2c92cb9ee5675533e4d807", features = ["font-kit", "wayland", "x11"] }
gpui-mcp = { git = "https://github.com/themixednuts/gpui-mcp", branch = "main" }
[patch.crates-io]
gpui = { git = "https://github.com/themixednuts/gpui-mcp", branch = "main" }
[patch."https://github.com/zed-industries/zed"]
gpui = { git = "https://github.com/themixednuts/gpui-mcp", branch = "main" }Install the bridge when you create a window and keep the returned handle in your root view:
use gpui_mcp::{AppId, BridgeConfig, BridgeHandle};
let app_id = AppId::new("my-app")?;
let bridge = BridgeHandle::install(
window,
cx,
BridgeConfig::new(app_id, "My App"),
)?;That is the whole integration. The MCP client discovers running apps automatically.
Related MCP server: Electron MCP Server
Building your UI
Write ordinary GPUI elements with stable IDs and normal event handlers:
div()
.id("save")
.on_click(cx.listener(|this, _, _, cx| this.save(cx)))
.child("Save")gpui-mcp discovers the rendered hierarchy, text, bounds, state, and available
interactions automatically. Use GPUI's standard accessibility methods when a
control's meaning cannot be inferred, such as .role(Role::Tab) or
.aria_label("Settings") on an icon button.
A control that refuses input must say so with .aria_disabled(true). The tree's
enabled is read from AccessKit's disabled flag and from nothing else, so a
widget that merely withholds its click handler and paints itself grey still
reports enabled: true — the field then asserts a falsehood rather than
admitting it does not know, and a consumer cannot tell a disabled control from
one that is wrongly unreachable.
The two Cargo patches keep your app, gpui_platform, and the bridge on one GPUI
type universe. They can go away once the small additions in the
vendor patch inventory land upstream.
See the demo for a complete window. For live HTML/CSS interfaces, see the visual builder guide.
Only enable automation in development, testing, or another explicitly trusted environment. See SECURITY.md.
Apache-2.0.
This server cannot be deployed
Maintenance
Related MCP Connectors
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol (MCP) server for Selise Blocks Cloud integration
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseCqualityDmaintenanceA bridge between iOS simulators and the Model Context Protocol, enabling programmatic control of iOS simulators through standardized communication interfaces.1244TypeScriptMIT
- AlicenseBqualityBmaintenanceA Model Context Protocol server that provides comprehensive Electron application automation, debugging, and observability capabilities through Chrome DevTools Protocol integration.4264 npm71MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to automate and test Tauri desktop applications through the Model Context Protocol. It provides tools for app management, UI interaction, and state inspection across multiple platforms without requiring CDP dependencies.14927 npm1MIT
- FlicenseNot gradedqualityDmaintenanceA local testing tool for APIs, web browsers, and phone UI using the Model Context Protocol.-