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.

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

讓助手在本機檢視並操作 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 中

  1. 開啟 儀表板中的 StockSharp DesktopDriver,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

StockSharp DesktopDriver

[MCP on NuGet] [CLI on NuGet]

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

  1. 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>.
  2. 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.
  3. 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:

sh
dotnet tool install StockSharp.DesktopDriver.Cli --tool-path toolsdotnet tool install StockSharp.DesktopDriver.Mcp --tool-path tools

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.

PackageWhat it is
StockSharp.DesktopDriver.ContractsThe protocol: requests, answers, states, addresses
StockSharp.DesktopDriver.RuntimeReading, identity, revisions and waiting, independent of any toolkit
StockSharp.DesktopDriver.HostThe endpoint inside the application, and UiAutomationLaunch to read how it was started
StockSharp.DesktopDriver.ClientThe typed client every runner talks through
StockSharp.DesktopDriver.RunnerStarts, finds and reaches applications; the catalogue of what may be started
StockSharp.DesktopDriver.TestingWhat an MSTest suite needs on top of the runner
StockSharp.DesktopDriver.CliThe command line
StockSharp.DesktopDriver.McpThe MCP server, see its README
StockSharp.DesktopDriver.AvaloniaAvalonia: reading, input and pictures of the standard controls
StockSharp.DesktopDriver.Avalonia.ProDataGridAvalonia: the DataGrid from ProDataGrid, read as a table
StockSharp.DesktopDriver.Avalonia.DockAvalonia: a Dock.Avalonia workspace, read as panels and groups
StockSharp.DesktopDriver.Avalonia.HeadlessAvalonia: input for headless tests
StockSharp.DesktopDriver.Bootstrap.AvaloniaAvalonia: one call that makes an application drivable
StockSharp.DesktopDriver.WpfWPF: reading, input and pictures of the standard controls
StockSharp.DesktopDriver.Bootstrap.WpfWPF: one call that makes an application drivable
StockSharp.DesktopDriver.MauiMAUI: reading, input and pictures of the standard controls
StockSharp.DesktopDriver.Bootstrap.MauiMAUI on Windows: one call that makes an application drivable

Make an application drivable

Avalonia, once the main window exists (the sample does the same with the grid module alone):

csharp
public override void OnFrameworkInitializationCompleted(){	if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)	{		desktop.MainWindow = new MainWindow();
		if (UiAutomationLaunch.TryRead(desktop.Args) is { } launch)		{			_automation = AvaloniaAutomationBootstrap.Start(				UiAutomationStartup.For("my.app", version, fixtureId: null, hasLiveOutsideWorld: false, isTestProfile: false),				launch.EndpointFile,				[binder => new DataGridAutomationModule(binder), binder => new DockAutomationModule(binder)]);		}	}
	base.OnFrameworkInitializationCompleted();}

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:

csharp
await using var app = await DrivenApplication.StartAsync(executable, extraArguments: null, TimeSpan.FromSeconds(60), cancellationToken);await using var client = await app.ConnectAsync("my.app", cancellationToken);
var windows = await client.GetSurfacesAsync(cancellationToken);

From a command line, against an application somebody started with --ui-automation:

sh
tools/desktop-driver find --endpoint endpoint.json --kind gridtools/desktop-driver grid-rows --endpoint endpoint.json --node window:MainWindow/Instruments --limit 5

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

Build and test

sh
dotnet build DesktopDriver.slnxdotnet test DesktopDriver.Runtime.Tests --filter "FullyQualifiedName~Revision"

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

sh
dotnet pack DesktopDriver.slnx -c Release -o artifacts/packages

Sources instead of packages

A product checked out beside this repository can reference the projects themselves:

xml
<ProjectReference Include="..\DesktopDriver.Mcp\DesktopDriver.Bootstrap.Avalonia\DesktopDriver.Bootstrap.Avalonia.csproj" />

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Oct 9, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。