Expand description
Lets AI agents see and drive a running iced application.
The bridge wraps your program the way iced’s own tester and devtools do:
it adds a loopback socket, a widget wrapped around every window’s view,
and a log of your messages. The iced-mcp-server binary speaks MCP to the
agent and this protocol to the app, so an agent can read the widget tree,
click and type by text or id, scroll, drag, take screenshots and read what
the app did in response — without the OS accessibility APIs or pixel
guessing.
fn main() -> iced::Result {
let app = iced::application(App::default, App::update, App::view);
// Attached only when `ICED_MCP=1`; otherwise exactly `app.run()`.
iced_mcp::run(app)
}Only build it into development binaries (behind a cargo feature): anyone
who can reach the port can drive the app. It binds 127.0.0.1 only, and
ICED_MCP_TOKEN makes connections present a token first.
Re-exports§
pub use iced_mcp_protocol as protocol;
Structs§
- Attach
- A
Programwith the bridge attached. - Config
- Where and how the bridge listens.
- Message
- The program’s messages, with the bridge’s beside them.
- State
- The program’s state, with the bridge’s beside it.
Functions§
- attach
- Wraps any iced
Program— usually anApplication— with the bridge. - enabled
- Whether
ICED_MCPasks for the bridge (set, and not0/false). - run
- Runs
application, with the bridge attached whenenabled— the one line most apps need. - run_
with_ state run, also sharing the app’s state with thestatetool (seeAttach::state).