
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 分
請在儲存庫或註冊中心條目中宣告授權條款。