gpui-mcp
Semantic inspection and Model Context Protocol (MCP) automation for GPUI applications.
The package contains both sides of the inspection seam:
- A small app-side library for publishing semantic state and receiving bounded UI actions.
- A
gpui-mcpstdio server that exposes that state to MCP clients.
It intentionally does not depend on GPUI itself. Your application is the adapter: it publishes framework-neutral nodes and executes requested actions on GPUI's foreground executor.
Application integration
Start the inspection endpoint only in explicit development or test builds.
Publish exactly one node with the application role and logical bounds; resize
and screenshot operations use that node as the semantic root.
use ;
The server binds only to IPv4 loopback, creates a fresh authentication token for every run, limits request sizes and action timeouts, and uses a bounded action channel. Treat its address and token as ephemeral credentials.
MCP client configuration
Once installed with cargo install gpui-mcp, configure an MCP client to launch:
Call attach with the address and token from the running application. The
server then provides semantic tree/query/wait operations, click and focus,
keyboard and text input, scrolling and dragging, resize settlement, and
logical-coordinate screenshots.
Prefer stable semantic IDs and exact selectors over screen coordinates. Verify semantic state after every action; screenshots are diagnostic evidence, not the functional assertion.
License
Licensed under either Apache License 2.0 or the MIT license, at your option.