Avalonia DevTools MCP
Use this skill when the task involves validating or debugging runtime UI behavior in a running Avalonia app, especially when visual inspection, tree traversal, property/style inspection, or screenshots are needed.
When to use
- "Show me the visual tree"
- "Find this control in the running app"
- "What styles/properties are applied at runtime?"
- "Take a screenshot of this panel/window"
- "Simulate click/text input and verify result"
Preconditions
- DevTools MCP server configured in user MCP config (for VS Code in this environment):
~/Library/Application Support/Code/User/mcp.json
- Tool installed:
dotnet tool install --global AvaloniaUI.DeveloperTools
- App instrumentation in target app:
AvaloniaUI.DiagnosticsSupportpackage.WithDeveloperTools()orthis.AttachDeveloperTools()at startup- Keep this instrumentation development-only (Debug), since MCP enables live inspection, mutation, and input simulation.
Standard workflow
attach-to-appwith noid- If multiple/any clients returned, select one and call
attach-to-appwith thatid - Inspect with:
tree(roots/subtree)search(type/x:Name)props,styles,resourcesscreenshot
- Interact with:
input,action,set-prop,pseudo-class
detachwhen done
Important pitfalls
- Do not tell users to press F12 for MCP connectivity. F12 opens standalone tools and does not establish MCP attach by itself.
attach-to-appcommonly returns an app list first; a second call with selectedidis expected.- Node IDs are ephemeral; reacquire via
tree/searchafter UI changes.
License/auth caveat observed in this repo
In this environment, forcing AVALONIA_TOOLS_LICENSE_KEY through MCP server env could produce:
Authenticated session does not have access to required product: avalonia-developer-tools-console
Working behavior was restored by removing explicit MCP env override and relying on an already-authenticated DevTools session.
If license/product errors appear:
- Ensure
AvaloniaUI.DeveloperToolsis current:dotnet tool update --global AvaloniaUI.DeveloperTools- If not installed yet:
dotnet tool install --global AvaloniaUI.DeveloperTools
- Verify license key and entitlement for DevTools MCP.
- For the exact observed error above (and when a cached authenticated session is available), try removing explicit MCP
envoverride forAVALONIA_TOOLS_LICENSE_KEY, then retry attach. - If a portal sign-in dialog appears, ask the user to complete it (do not enter credentials from the agent).