Declarative.Avalonia.AgentTools
12.1.0
See the version list below for details.
dotnet add package Declarative.Avalonia.AgentTools --version 12.1.0
NuGet\Install-Package Declarative.Avalonia.AgentTools -Version 12.1.0
<PackageReference Include="Declarative.Avalonia.AgentTools" Version="12.1.0" />
<PackageVersion Include="Declarative.Avalonia.AgentTools" Version="12.1.0" />
<PackageReference Include="Declarative.Avalonia.AgentTools" />
paket add Declarative.Avalonia.AgentTools --version 12.1.0
#r "nuget: Declarative.Avalonia.AgentTools, 12.1.0"
#:package Declarative.Avalonia.AgentTools@12.1.0
#addin nuget:?package=Declarative.Avalonia.AgentTools&version=12.1.0
#tool nuget:?package=Declarative.Avalonia.AgentTools&version=12.1.0
Declarative.Avalonia.AgentTools
In-process MCP (Model Context Protocol) inspector for AI agents that build UI with
Avalonia.Markup.Declarative.
In a debug build it exposes the running app to an agent over loopback so the agent can close the feedback loop while iterating on a view:
get_app_info— windows, focus, popups, theme, versions, hot-reload/interaction state (call first)get_visual_tree— text visual tree with names, local bounds and absoluteabs=/center=client-DIP coords (the frameclick_at/tap/drag/hit_testshare);maxDepth/filterto trim; open popups includedget_layout— detailed layout for one control: bounds, window-relative position, requested vs actual size, alignment, margin/padding, visibility, off-screen/clipped flags, and the ancestor chainget_properties— effective state + every locally-set styled propertyget_property_sources— where each value came from (local / style / template / animation / inherited)get_data_context— the control's view-model rendered as text (debug bindings)get_source— theViewBasecomponent that built a control (which class to edit); optionalfile:linefind_text/hit_test— locate controls by visible text or by pixel coordinate (hit_testalso reports how the control can be driven: automation-invokable / focusable / raw-pointer-only)layout_audit— automated layout lint (zero-size, off-screen, overlap, out-of-parent, text-clipped)list_components— active declarative viewsscreenshot_window(withannotate) /screenshot_control— PNG screenshots (image content blocks)compare_screenshots/list_screenshots— before/after pixel diff (red diff image + % changed)highlight— draw a frame around a control (or all of a type) and screenshot it;action='clear'clearswait_for/wait_idle— sync after an interaction or hot reloadget_errors— recent build / binding / converter / runtime errors (incl. exceptions in handlers)tap,drag,pointer_press/pointer_move/pointer_release— (optional, off by default) real synthesized pointer input through Avalonia's input pipeline: works on custom controls with hand-written pointer handlers and no automation peer (scrub a Border slider, move a thumb, draw)invoke,set_window_size,set_theme,click_at,open_popup,list_bindable,set_view_model,invoke_command— (optional, off by default) remote control: invoke / select / select_item / toggle / set / expand / collapse / focus / scroll / scroll_by / context_menu / key / type (key/typesend real input), plus resize, theme switch, pointer-first click-by-coordinate, open a closed popup, list a DataContext's bindable surface, and an escape hatch to set a view-model property or run anICommand/method directly (structured, actionable errors; reach awkward states without restarting)
Usage
var appBuilder = AppBuilder.Configure<App>()
.UsePlatformDetect()
#if DEBUG
.UseAgentInspector() // loopback MCP server on 127.0.0.1:5599
#endif
.SetupWithLifetime(lifetime);
Enable the MCP in your agent
The server speaks streamable HTTP on loopback, so any MCP client points at the same endpoint —
http://127.0.0.1:5599. Run the app under dotnet watch so the agent's edits hot-reload into the
live process it is inspecting.
Claude Code — one command (or a project-scoped .mcp.json):
claude mcp add --transport http avalonia-agent-inspector http://127.0.0.1:5599
// .mcp.json (project root)
{
"mcpServers": {
"avalonia-agent-inspector": {
"type": "http",
"url": "http://127.0.0.1:5599"
}
}
}
opencode — add it under mcp in opencode.json with type: "remote":
// opencode.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"avalonia-agent-inspector": {
"type": "remote",
"url": "http://127.0.0.1:5599",
"enabled": true
}
}
}
Codex — add an [mcp_servers.*] table to ~/.codex/config.toml (or the project's .codex/config.toml):
# ~/.codex/config.toml
[mcp_servers.avalonia-agent-inspector]
url = "http://127.0.0.1:5599"
# First time you use a streamable-HTTP MCP with Codex, enable the RMCP client once:
[features]
experimental_use_rmcp_client = true
Show a live "agent connected" status in your UI (like Chrome DevTools) by subscribing to
AgentConnectionMonitor — events are raised on the UI thread:
#if DEBUG
AgentConnectionMonitor.StatusChanged += (_, e) =>
window.Title = e.IsConnected ? "🟢 Agent connected — My App" : "My App";
#endif
Dev only. Keep the call under
#if DEBUG. This package pulls in the ASP.NET Core web stack and a remote-control surface; it must not ship in Release. The server binds to loopback only, and the tier-2 tools (invoke,set_window_size,set_theme,click_at,set_view_model,invoke_command) stay disabled unless you setEnableInteraction = true.
See the repository's docs/agent-tools.md for the full guide.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Avalonia.Markup.Declarative (>= 12.1.0)
- ModelContextProtocol.AspNetCore (>= 1.4.0)
-
net8.0
- Avalonia.Markup.Declarative (>= 12.1.0)
- ModelContextProtocol.AspNetCore (>= 1.4.0)
-
net9.0
- Avalonia.Markup.Declarative (>= 12.1.0)
- ModelContextProtocol.AspNetCore (>= 1.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 12.1.2-fix-agent.1 | 80 | 8/3/2026 |
| 12.1.1 | 496 | 8/2/2026 |
| 12.1.0 | 122 | 7/18/2026 |
| 12.0.6-preview2 | 115 | 7/8/2026 |
| 12.0.6-preview1 | 103 | 7/7/2026 |
| 12.0.5 | 130 | 7/3/2026 |
| 12.0.5-preview1 | 112 | 6/20/2026 |