How tiefeiyu/qt-commander works
qt-commander is an MCP server for introspecting and automating running Qt applications. An agent calls the Python server, which manages sessions and launches an injector; the injected library exposes UI operations over authenticated, framed TCP RPC. The graph also preserves the documented build/environment, process discovery, snapshot/pruning, lookup, capture, and input capabilities. Some tool implementations and native dispatch details were not sampled, so those links follow explicit README architecture or are omitted where ownership is uncertain.
Main entry points: rpc_server.cpp RPC dispatcher · server.py MCP tools · session.py Session manager · rpc_client.py Injector client
Components 20
MCP interface
- MCP tools
qt_commander/server.py - Snapshot pruning
qt_commander/occlusion.py
Discovery and sessions
- Kit detection
qt_commander/environment_detector.py - On-demand build
qt_commander/builder.py - Qt processes
qt_commander/process_detector.py - Session manager
qt_commander/session.py - Injector client
qt_commander/rpc_client.py
Process injection
- Injector CLI
src/injector/main.cpp - Platform injection
src/injector/injector.h
In-process UI engine
- Injected library
src/library/entry_win.cpp - UI scanner
src/library/core/ui_scanner.cpp - Element map
src/library/core/element_map.cpp - Element lookup
src/library/selector/selector.cpp - Screenshot capture
src/library/core/screenshot.cpp - Input injection
src/library/core/event_injector.cpp
RPC transport
- RPC dispatcher
src/library/rpc/rpc_server.cpp - Frame protocol
src/common/framing.h
Other components
- AI agent
- Running Qt app
- Session files
Connections 23
- AI agent → MCP tools: calls tools
- MCP tools → Kit detection: detects kits
- MCP tools → On-demand build: builds runtime
- MCP tools → Qt processes: lists processes
- MCP tools → Session manager: manages sessions
- Session manager → Injector client: connects via
- Injector client → Injector CLI: launches
- Injector CLI → Platform injection: injects or ejects
- Platform injection → Running Qt app: loads library
- Running Qt app → Injected library: runs in process
- Injected library → RPC dispatcher: starts server
- Injector client → Frame protocol: frames requests
- RPC dispatcher → Frame protocol: decodes frames
- RPC dispatcher → UI scanner: scans UI
- RPC dispatcher → Element map: refreshes map
- RPC dispatcher → Element lookup: finds elements
- RPC dispatcher → Screenshot capture: captures UI
- RPC dispatcher → Input injection: dispatches input
- MCP tools → Snapshot pruning: prunes snapshots
- MCP tools → Session files: stores snapshots
- Session manager → Session files: persists metadata
- Qt processes → Running Qt app: discovers
- RPC dispatcher → Running Qt app: serves UI operations