
Precision Desktop
io.github.ikoskela由 GitHub 帳號 ikoskela 發布v0.1.1更新於 Oct 24, 2026
Fixes DPI coordinate scaling for Windows desktop automation MCP servers.
概覽
一個僅限 Windows 的配套 MCP 伺服器,用於校正 DPI 縮放並轉換座標,讓桌面自動化點擊落在正確位置。
- 可以做什麼
- Precision Desktop 會依參考點量測 Windows 機器上的 DPI 縮放比例,並在實體座標與邏輯座標之間轉換。它也會透過 Windows UI Automation 依名稱尋找 UI 元素並回傳可直接點擊的實體座標,列出視窗中具名的可互動元素,依標題尋找視窗控制代碼,並對校正時效、UI Automation 可用性與配套 MCP 狀態執行健康檢查。此外,它會回報已對配套桌面自動化伺服器套用哪些 DPI 感知修補意圖。
- 適用情境
- 當 Windows 桌面自動化 MCP 伺服器因顯示縮放高於 100% 而點擊、輸入或懸停位置錯誤時使用。它設計上與 windows-mcp 等點擊/輸入伺服器搭配運作,適合螢幕截圖與元素座標不一致,或視覺模型依縮放後截圖估算位置的情況。
- 執行需求
- Windows 10 或 11、Python 3.10 或更新版本、PowerShell,以及 MCP SDK(mcp >= 1.0.0)。它透過 stdio 在本機執行。需要 MPos 等座標讀取工具來蒐集校正參考點。選用環境變數 WINDOWS_MCP_PATH 可指向非標準位置的 windows-mcp 安裝;未設定時會自動偵測。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Precision Desktop,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
precision-desktop
mcp-name: io.github.ikoskela/precision-desktop
A companion MCP server that fixes DPI coordinate scaling for Windows desktop automation.
Windows DPI scaling silently breaks every MCP tool that clicks, types, or hovers on the desktop. precision-desktop detects and corrects the coordinate mismatch so your AI agent's clicks actually land where they should.
The Problem
Windows has two coordinate systems and doesn't tell you which one you're using.
When Windows DPI scaling is set above 100% (which it is on most modern laptops and monitors), different Windows APIs return coordinates in different systems:
* UI Automation returns physical on DPI-aware processes, logical on others — yet another inconsistency.
The ratio between them is your DPI scale factor (e.g., 1.25x, 1.5x, 1.75x, 2.0x).
The problem isn't just "some APIs return logical." It's that different APIs return different coordinate systems with no indication of which one you're getting. There's no flag, no header, no type annotation — just numbers that look identical but mean completely different things.
Three ways this breaks AI agents
1. API mismatch — Click tools accept physical coordinates, but common Windows APIs return logical:
2. Screenshot mismatch — Screen captures are taken at logical resolution, but click tools expect physical coordinates. On a 3840x2400 display at 175% scaling, screenshots are 2194x1371 pixels. When a vision model (GPT-4o, Claude, CogAgent) looks at a screenshot and estimates "the button is at pixel (500, 300)," that's a logical coordinate. Clicking there in physical space misses by hundreds of pixels:
3. Mixed sources within the same tool — Even a single tool can return both systems. For example, windows-mcp's State-Tool reports element coordinates in physical space (correct for clicking), but its screenshots are captured at logical resolution. An agent combining both — reading element positions from the accessibility tree and estimating positions from screenshots — will silently mix coordinate systems.
This isn't an edge case
- ~1 billion active Windows devices worldwide
- ~30-50% have DPI scaling above 100% — that's 300-500 million machines
- Windows auto-enables scaling >100% on most modern laptops (13-16" screens at 1080p+ get 125-150% by default)
- 47% of PC users now run resolutions above 1080p (Steam Hardware Survey) — 21% at 1440p, 5% at 2560x1600, 4.2% at 4K — and climbing
- The MCP ecosystem has 5,800+ servers and 97M+ monthly SDK downloads — every Windows desktop automation server will hit this
If you've ever watched an AI agent click confidently at exactly the wrong spot, DPI scaling is probably why.
The Solution
precision-desktop is a companion MCP server that sits alongside your desktop automation MCP (like windows-mcp) and provides:
- Calibration — Measure the actual DPI scale factor on this specific machine using known screen landmarks
- Coordinate conversion — Convert between physical and logical systems on demand
- UI element finding — Locate elements by name via Windows UI Automation, returning physical coordinates ready for clicking
- Health checks — Detect stale calibration, verify UI Automation availability, check companion MCP status
- Patch awareness — Track which DPI-aware patches have been applied to the companion MCP
Tools
Quick Start
1. Install
Clone this repo and install dependencies:
2. Configure MCP
Add to your Claude Code MCP configuration (.mcp.json or settings):
Or if using Claude Desktop, add to claude_desktop_config.json:
3. Calibrate
The AI agent calibrates itself on first use. The flow:
- Agent calls
health_check— discovers calibration is missing - Agent gathers reference points — uses a coordinate reading tool (like MPos) or Move-Tool + Cursor.Position to get both physical and logical coordinates at 2+ known screen landmarks
- Agent calls
calibratewith the reference points — computes scale factors - Agent verifies — moves cursor to a known element, confirms it landed correctly, calls
calibrate_verify
Calibration persists in state/calibration.json and only needs to be redone if DPI settings change or the display configuration changes.
Calibration Guide
What you need
Two coordinate readings for the same point:
- Physical coordinates — from Move-Tool, Click-Tool, or State-Tool (these operate in physical space)
- Logical coordinates — from
[System.Windows.Forms.Cursor]::Positionin PowerShell, orGetWindowRectAPI calls
Good calibration landmarks
- Start button (bottom-left of taskbar) — easy to locate precisely
- Date/time (bottom-right of taskbar) — anchors the opposite corner
- Minimize button of any maximized window — well-defined clickable target
Example calibration call
This computes a scale factor (here, ~1.75x) and persists it for future coordinate conversions.
Verification
After calibration, the agent should:
- Use
convert_coordinatesto convert a known logical position to physical - Use Move-Tool to move the cursor there
- Confirm the cursor is on the expected target
- Call
calibrate_verifywithsuccess: true
UI Element Finding
Beyond coordinate conversion, precision-desktop can locate elements directly by name using Windows UI Automation — no coordinates needed.
This works for:
- Native Windows application controls (buttons, text fields, menus)
- Chrome extension popups and dialogs
- Overlay windows that State-Tool may not see
- Any UI element exposed via Windows UI Automation
Scoped search
You can scope searches to a specific window to avoid finding elements in the wrong application:
Discovery
Don't know the element name? Use list_ui_elements to see what's available:
Integration with windows-mcp
precision-desktop is designed to work alongside windows-mcp (or any MCP that provides desktop click/type/scroll tools).
The patching concept
Rather than forking windows-mcp, precision-desktop describes patch intents — what should change in the companion MCP and why. The AI agent reads these intents and applies version-appropriate patches itself.
Current patch intents:
dpi_awareness— Add an optionalcoordinate_systemparameter to Click-Tool and Move-Tool that auto-converts logical coordinates to physicalfind_and_click— Add an optionalelement_nameparameter to Click-Tool that finds and clicks an element by name (no coordinates needed)
Use patch_status to check which patches are applied.
Environment variable
If windows-mcp is installed in a non-standard location, set the WINDOWS_MCP_PATH environment variable:
By default, it looks in the standard Claude Extensions directory (%APPDATA%\Claude\Claude Extensions\ant.dir.cursortouch.windows-mcp).
Architecture
How calibration works
- User (or AI agent) provides 2+ points with both physical and logical coordinates
calibration.pycomputes the median scale factor for X and Y axes independently- Checks consistency — if points disagree by more than 2%, flags as inconsistent
- Computes offset (typically 0 for standard DPI scaling, non-zero for multi-monitor setups)
- Persists to
state/calibration.json - Subsequent
convert_coordinatescalls use the persisted factors
How UI Automation finding works
find_element.pyruns PowerShell scripts that loadUIAutomationClientandUIAutomationTypesassemblies- Searches the UI Automation tree for elements matching the requested name
- Returns bounding rectangles in the coordinate system that UI Automation reports (which is physical on DPI-aware processes)
- Results include center coordinates ready for direct use with Click-Tool/Move-Tool
Requirements
- Windows 10/11 (uses Windows UI Automation)
- Python 3.10+
- PowerShell (ships with Windows)
- mcp >= 1.0.0 (MCP SDK)
- MPos or similar coordinate reader (for calibration) — any tool that shows the cursor's screen position in both physical and logical coordinates. MPos is lightweight and portable (no install needed)
License
來源:README.md,提交 58a56a6
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分