1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Add egui_inspection protocol and plugin (#8234)

Introduces live inspection for running egui apps over a small TCP
request/response protocol, plus the `egui::Plugin` that serves it.

This is the minimal surface to get the egui mcp in, we may want to
extend this in the future to add support for the inspection gui.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lucas Meurer
2026-06-18 11:26:18 +02:00
committed by GitHub
parent 172fb54f7f
commit 86fcffb229
16 changed files with 869 additions and 14 deletions

View File

@@ -116,6 +116,12 @@ x11 = [
## This is used to generate images for examples.
__screenshot = []
## Enable the [`egui_inspection`] plugin. When the `EGUI_INSPECTION` (or
## `EGUI_INSPECTION_ADDR`) env var is set, eframe opens a TCP inspection port on startup that
## lets an external tool (e.g. the `egui_mcp` server) read the AccessKit tree, inject input,
## and capture screenshots. Off unless the env var is set; no-op on wasm.
inspection = ["dep:egui_inspection", "accesskit"]
[dependencies]
egui = { workspace = true, default-features = false, features = ["bytemuck"] }
@@ -131,6 +137,7 @@ web-time.workspace = true
# Optional dependencies
egui_glow = { workspace = true, optional = true, default-features = false }
egui_inspection = { workspace = true, optional = true, features = ["plugin"] }
glow = { workspace = true, optional = true }
ron = { workspace = true, optional = true, features = ["integer128"] }
serde = { workspace = true, optional = true }