Skip to content

Adds XAMLTest MCP server and UI tools#362

Merged
Keboo merged 7 commits into
masterfrom
keboo/unified-input-tool
May 22, 2026
Merged

Adds XAMLTest MCP server and UI tools#362
Keboo merged 7 commits into
masterfrom
keboo/unified-input-tool

Conversation

@Keboo

@Keboo Keboo commented May 22, 2026

Copy link
Copy Markdown
Owner

Introduces a Model Context Protocol (MCP) server for XAMLTest, enabling AI and intelligent agents to interact with WPF applications programmatically.

This change set adds a new XAMLTest.Mcp project which provides:

  • Tools to start and manage WPF application instances.
  • Functionality to query and manipulate visual elements, including getting/setting properties and retrieving the visual tree.
  • A unified tool for executing complex sequences of mouse and keyboard inputs via a structured JSON payload.
  • Enhanced screenshot capture capabilities, providing inline BMP image content and optional file saving.

Updates target frameworks to .NET 10.0 and removes the System.Drawing.Common dependency.

Keboo and others added 6 commits May 21, 2026 22:47
Adds a new XAMLTest.Mcp project to implement a Model Context Protocol server providing tools to manage XAMLTest applications, updates the C# language version to 14.0, includes new NuGet packages for ModelContextProtocol and Microsoft.Extensions.Hosting, introduces a `ProcessId` property to the `IApp` interface, and updates the Visual Studio version in the solution file.
- Introduces `StartApp` MCP server tool for flexible WPF application initialization.
- Corrects `StartAppWithXamlSnippet` tool description for clarity.
- Removes the `ProcessId` property from `IApp` and its implementations.
- Removes unused `System.Text.Json.Nodes` using statement.
- Drops support for .NET 9.0 across projects, targeting .NET 10.0 exclusively.
- Removes the `System.Drawing.Common` NuGet package and its associated project references.
- Adds `GetVisualTree`, `GetElementProperty`, and `SetElementProperty` tools to the MCP server for WPF interaction.
- Implements a gRPC endpoint and host service to traverse and serialize the WPF visual tree.
- Introduces a query syntax for finding elements by name, type, or property values.
- Updates `IWindow` and internal `VisualElement` logic to support remote tree inspection.
- Fixes base64 encoding for screenshot blobs in `AppTools`.
- Adds Interact tool to VisualElementTools that accepts an ordered JSON
  action list for executing mixed mouse/keyboard flows against a target
  element or main window.
- Supported action types: focus, delay, mouse_move_to_element,
  mouse_move_relative, mouse_move_absolute, mouse_button_down,
  mouse_button_up, mouse_click, keyboard_text, keyboard_keys.
- Adds InputActionsJsonDescription to SharedStrings with schema docs
  and an example payload.
- Validates all actions with per-index error messages for bad payloads.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- The `SaveScreenshot` MCP tool now returns the captured image as inline BMP content, improving direct usability for callers.
- Adds an optional `filePath` parameter to allow saving the screenshot to a specified location on disk.
- Marks `AppServiceManager` as `sealed` to prevent unintended inheritance.
- Adopts C# 12 collection expressions for empty arrays.
@Keboo Keboo enabled auto-merge (squash) May 22, 2026 05:54
The XAMLTest.Mcp project is intended as a self-contained MCP server and not for distribution as a .NET Global Tool.
@Keboo Keboo merged commit 87be14a into master May 22, 2026
3 checks passed
@Keboo Keboo deleted the keboo/unified-input-tool branch May 22, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant