
StockSharp DesktopDriver
io.github.StockSharp由 GitHub 账号 StockSharp 发布v1.0.1更新于 Oct 24, 2026
Inspect and drive Avalonia, WPF and MAUI desktop applications through local MCP.
概览
让助手在本地检查和操作 Avalonia、WPF 与 MAUI 桌面应用:读取窗口、表格和树,并执行点击、输入和滚动。
- 可以做什么
- 读取运行中桌面应用的界面:列出已打开的窗口、查看某个窗口的内容,并把表格、树、列表、选择器、工作区、图表、文档和图表控件读成结构化数据。
- 通过工具包自身的输入管线执行点击、键入、按键和滚动,并等待结果发生变化。
- 通过本地命名管道端点启动或附加到已插桩的应用,并在会话握手中校验产品、实例和协议。
- 获取截图和自动化产物,供人查看。
- 适用场景
- 适合让 AI 代理操作或验证基于 Avalonia、WPF 或 MAUI 的桌面应用,例如走查某个窗口、核对表格内容或复现界面流程,而不依赖屏幕像素。
- 运行要求
- 作为本地进程在用户机器上运行,需用 .NET 10 SDK 安装(通过 dotnet tool install 安装 MCP 包)。目标应用必须引用对应工具包的 bootstrap 包,并以 --ui-automation 启动,从而开启本地命名管道端点。需要两个环境变量:STOCKSHARP_UI_ARTIFACTS 用于截图和自动化产物,STOCKSHARP_UI_CATALOGUE 指向允许启动的应用的 JSON 目录。仅限桌面环境;未声明身份验证。
安装
在 SourceWeft 中
- 打开 控制台中的 StockSharp DesktopDriver,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
StockSharp DesktopDriver
Drive desktop applications built on Avalonia, WPF or MAUI from tests, from a command line, or from an AI agent over MCP.
DesktopDriver reads the interface, not the screen. A table answers with its columns and rows, a tree with its items, a workspace with its panels - in words that do not change with a theme, a font or a language. Input goes through the toolkit's own pipeline, and only into a run that cannot reach anything real. Pictures are there for a person to look at; tests check what the controls say.
How it works
- An application that can be driven references the bootstrap of its toolkit. Started the ordinary way it
opens nothing. Started with
--ui-automation, it opens a local named-pipe endpoint restricted to the current OS user, and writes where the endpoint is to the file named by--ui-automation-endpoint=<path>. - A runner - a test, the command line, the MCP server - starts the application that way (or attaches to one somebody else started), checks the product, instance and protocol in the session handshake and asks: which windows are open, what is in this one, what does this table show. It can then click, type, press keys and scroll, and wait for the answer to change.
- Adapters turn controls into what the protocol knows: grids, trees, lists, pickers, workspaces, charts, documents, diagrams. An application registers adapters for its own controls through the same interface the standard ones use.
NuGet packages
Install the CLI or MCP server with the .NET 10 SDK:
The commands are tools/desktop-driver and tools/desktop-driver-mcp. To add automation to an
application, reference the bootstrap package for its toolkit. To drive it from code, use the client,
runner and testing packages.
For MCP Registry publication and Claude Desktop extensions, see MCP distribution.
Make an application drivable
Avalonia, once the main window exists (the sample does the same with the grid module alone):
Dispose the returned runtime when the application exits. WpfAutomationBootstrap and
MauiAutomationBootstrap take the same arguments.
The sample applications show startup and shutdown for all three toolkits. The WPF and MAUI Windows samples also have tests that start their executables, connect over the local pipe, read their controls, send input and retrieve screenshots.
UiAutomationStartup.For decides whether input is allowed. An application that talks to nothing outside
its own process is always safe to click through. One that connects to something real - a broker, a
store, a service - is safe only when it was started on a test profile that replaces it; otherwise the
endpoint still reads, but every input is refused.
Many applications ship two builds: an ordinary one with no driver in it, and one made to be driven. The driver is only referenced by the second, so the first has nothing listening by construction.
Drive it
From a test:
From a command line, against an application somebody started with --ui-automation:
desktop-driver with no arguments prints every operation.
From an agent: register the MCP server, see DesktopDriver.Mcp.
Its MCP name is StockSharp.DesktopDriver, and its display title is StockSharp DesktopDriver.
Documents
- How the driver is built
- The protocol
- What answers for which control, and how to add an adapter
- The command line
- The MCP server
- Builds, test suites and releases
- Sample applications and Windows integration tests
Build and test
The MAUI projects need the MAUI Windows workload. MCP application tests, WPF screenshot tests and
DesktopDriver.Windows.Tests need an interactive Windows desktop session. Run the filtered suites
with hang and session timeouts using ./.github/scripts/Test.ps1 -Suite Headless or -Suite Desktop
after a Release build.
Packages from source
Sources instead of packages
A product checked out beside this repository can reference the projects themselves:
A product that builds a second, drivable copy of itself by passing a property on the command line adds
GlobalPropertiesToRemove="<that property>" to the reference: the driver has no build of its own for it, and
would otherwise be built twice into the same folder.
License
See LICENSE.
来源:README.md,提交 a5e10d1
工具
0版本历史
1- v1.0.1最新Oct 9, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。