Adds XAMLTest MCP server and UI tools#362
Merged
Merged
Conversation
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.
The XAMLTest.Mcp project is intended as a self-contained MCP server and not for distribution as a .NET Global Tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Mcpproject which provides:Updates target frameworks to .NET 10.0 and removes the
System.Drawing.Commondependency.