XamlMcp — Claude Code MCP server: what it does, how to install
MCP server to inspect and control live XAML applications. Gives AI agents access to visual trees, runtime styles, and simulated input.
Open on GitHubWhat XamlMcp does
This tool connects coding assistants to active desktop programs running on Avalonia, WPF, WinUI 3, or .NET MAUI. Through a local connection, the model navigates visual hierarchies and inspects layout properties. It can also simulate user input.
The architecture uses two parts. You install an in-process agent package like XamlMcp.Wpf or XamlMcp.Avalonia into your application, then hook it up using AttachXamlMcp(). The companion XamlMcp.Server tool communicates with AI clients over stdio.
Running the xamlmcp tool requires the .NET 10 SDK, even if your target app targets .NET 8. Avalonia projects must run on at least version 11.3.18 to prevent package downgrade issues. Platforms like iOS and Mac Catalyst are unsupported.
What it helps with
- inspect visual and logical component trees in running desktop apps
- read UI element properties and active style resources dynamically
- capture application screenshots directly from the client session
- simulate keystrokes and pointer clicks to test user flows
Example prompts for the agent
- Inspect the visual tree of the main window and find all text input elements.
- Capture a screenshot of the active view and check if the error badge is visible.
- Click the submit button and report any updated property values on the status label.
How to install XamlMcp
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about XamlMcp
How to install XamlMcp in Claude Code?
Install the server globally using dotnet tool install --global XamlMcp.Server --version 1.0.0-preview.3. Then add the agent package to your app project, such as dotnet add package XamlMcp.Avalonia --version 1.0.0-preview.3.
What does XamlMcp do?
It gives AI assistants direct access to inspect and drive a running .NET application. The model can inspect visual trees, check properties, take screenshots, and trigger UI events.
What prerequisites does XamlMcp require?
The xamlmcp server tool needs the .NET 10 SDK to run, while the inspected app can target .NET 8 or higher. Avalonia applications require version 11.3.18 or newer.