Expand description
Library to embed in egui apps for MCP integration
This crate provides client-side integration for egui applications to support MCP automation features that require direct application access:
- Screenshots
- Coordinate-based input (clicks, drags)
- Keyboard input
- Scroll events
Note: UI tree access and element-based interactions are handled via AT-SPI on the server side and don’t require this client library.
§Usage in raw_input_hook
ⓘ
impl eframe::App for MyApp {
fn raw_input_hook(&mut self, ctx: &egui::Context, raw_input: &mut egui::RawInput) {
let inputs = self.runtime.block_on(self.mcp_client.take_pending_inputs());
egui_mcp_client::inject_inputs(ctx, raw_input, inputs);
}
}Re-exports§
pub use egui;
Structs§
- Frame
Stats - Frame statistics for performance monitoring
- Highlight
- A visual highlight to be drawn over an element
- IpcServer
- IPC server that listens for MCP requests
- LogEntry
- Log entry captured from the application
- McpClient
- Shared state for the MCP client
- McpLog
Layer - A tracing Layer that captures log entries for MCP access
- Perf
Report - Performance report from a recording session
Enums§
- Mouse
Button - Mouse button for click operations
- Pending
Input - Pending input event to be processed by the egui application
- Request
- Request types for IPC communication
- Response
- Response types for IPC communication
Constants§
- DEFAULT_
MAX_ MESSAGE_ LENGTH - Default maximum message length (8KB)
Functions§
- draw_
highlights - Draw active highlights on the egui context.
- inject_
inputs - Inject pending MCP inputs into egui’s RawInput.
- level_
to_ priority - Helper functions for filtering logs by level
Type Aliases§
- LogBuffer
- Shared log buffer type