Touchpoint's MCP server gives LLM agents full read and control access to desktop UI elements across Linux, macOS, and Windows via native accessibility APIs (AT-SPI2, UIA, AX) and Chrome DevTools Protocol for browser/Electron web content.
Discovery & Inspection
apps— List all applications visible in the accessibility treewindows— List all open windows with IDs, titles, sizes, and app nameselements— Browse the accessibility tree with filtering by role, state, depth, and sort orderfind— Search for UI elements by name using 4-stage matching (exact → contains → word → fuzzy)get_element— Fetch a detailed snapshot of a single element by ID, including supported actions
Screenshots
screenshot— Capture the full desktop, a specific app, window, element bounding box, or monitor
UI Actions
click— Click an element by ID or screen coordinates (left, right, or double-click)set_value— Set text content of an editable fieldset_numeric_value— Set the value of a slider or spinboxfocus— Move keyboard focus to an elementaction— Execute any raw accessibility action by name (e.g. "expand or collapse")activate_window— Bring a window to the foreground
Keyboard & Mouse Input
type_text— Type text into the focused element (supports\n,\t,\b)press_key— Press a single key or combination (e.g.["ctrl", "s"]), with repeat supportmouse_move— Move the cursor to an element or screen coordinatesscroll— Scroll up, down, left, or right at the cursor position
Waiting / Polling
wait_for— Wait for UI elements to appear or disappear, with multi-query andany/allmodeswait_for_app— Wait for an application to appear or disappearwait_for_window— Wait for a window (matched by title substring) to appear or disappear
Output is returned in flat, tree, or JSON formats with persistent element IDs for reliable cross-action references.
Enables interaction with Discord's desktop interface by reading its structured accessibility data and Electron-based web content.
Provides deep integration with Electron-based applications, allowing AI agents to read and interact with both native and web-based UI elements via CDP.
Enables discovery and interaction with Firefox UI elements, allowing agents to automate browser tasks like filling fields and clicking buttons.
Supports automated interaction with Google Chrome through native accessibility APIs and Chrome DevTools Protocol (CDP) for structured access to web content.
Allows programmatic control over the Slack desktop application by reading its accessibility tree to locate and interact with UI components like buttons and message fields.
Touchpoint is a cross-platform Python library for reading and interacting with desktop UI through native accessibility APIs. One import, one API — works on Linux, macOS, and Windows, with built-in support for Chromium and Electron apps via CDP (Chrome DevTools Protocol).
Instead of scraping pixels or running vision models, Touchpoint reads the real accessibility tree — structured names, roles, states, and positions for every element on screen. Fast and reliable, with no vision model required. Ships with an MCP server so LLM agents like Claude, Cursor, or any local model can control any desktop app out of the box.
import touchpoint as tp
elements = tp.find("Send", role=tp.Role.BUTTON, app="Slack")
tp.click(elements[0])Why Touchpoint?
Screenshot / vision | Browser automation | Touchpoint | |
Native desktop apps | ⚠️ inaccurate or slow | ❌ | ✅ |
Browsers | ⚠️ inaccurate or slow | ✅ | ✅ via CDP |
Electron apps (Slack, VS Code, ...) | ⚠️ inaccurate or slow | ⚠️ web content only | ✅ native + web |
Structured element data | ❌ needs OCR/vision model | ✅ web only | ✅ names, roles, states, positions |
Works with local / non-vision models | ❌ | ✅ web only | ✅ all apps |
Works across Linux, macOS, Windows | ✅ | ✅ | ✅ |
Table of Contents
Related MCP server: Linux Desktop MCP Server
Install
Requires Python 3.10+.
pip install touchpoint-pyEverything is included: your platform's native backend, CDP support for browsers and Electron apps, the MCP server, and screenshot capabilities. Platform-specific dependencies are installed automatically via pip environment markers.
Platform requirements
Platform | Backend | Requirement |
Linux | AT-SPI2 | Install |
Windows | UI Automation | None — uses built-in COM APIs |
macOS | Accessibility (AX) | Grant permission: System Settings → Privacy & Security → Accessibility |
Quick Start
import touchpoint as tp
# Discover
apps = tp.apps() # ["Firefox", "Slack", "Terminal", ...]
windows = tp.windows() # Window objects with title, position, size
all_els = tp.elements(app="Firefox", named_only=True) # only elements with text labels
# Find
results = tp.find("Search", role=tp.Role.TEXT_FIELD, app="Firefox")
# Act
tp.set_value(results[0], "touchpoint python", replace=True)
tp.press_key("enter")
tp.hotkey("ctrl", "s") # keyboard shortcuts
# Wait for UI changes
tp.wait_for("results", app="Firefox", timeout=10)
# Screenshot
img = tp.screenshot() # full desktop → PIL.Image
img = tp.screenshot(app="Firefox") # cropped to app windowElement IDs
Every element has a unique ID like atspi:1234:1:2.0 or cdp:9222:TID:4. Action functions accept either an Element object or a bare ID string — useful for storing references across steps:
results = tp.find("Send", max_results=1)
element_id = results[0].id # "atspi:1234:1:5.2"
# later...
tp.click(element_id) # works with just the stringOutput formats
Control how results are returned:
tp.elements(app="Slack", format="flat") # one compact line per element (best for LLMs)
tp.elements(app="Slack", format="tree") # indented parent/child hierarchy
tp.elements(app="Slack", format="json") # full JSON with all fieldsMCP Server
Touchpoint ships an MCP (Model Context Protocol) server ready for any MCP-compatible client. Use it to let LLM agents like Claude, Cursor, local models, or any tool that supports MCP control your desktop.
Two modes — vision and no-vision
Set TOUCHPOINT_MODE=no-vision (default: vision) to switch modes:
Vision mode — agents use
screenshot()to see the screen and interact by element ID or coordinates. Best for frontier models with strong vision capabilities.No-vision mode — agents use
snapshot()to get a compact structured text tree of the active window, then act on element IDs directly. Works with any model including local ones that have no vision capability. Most action tools append auto-verify flags ((new window: ...),(focus moved),(no change detected)) so the agent can detect state changes without taking a screenshot.
Tools
Category | Vision mode | No-vision mode |
Orient |
|
|
Find |
|
|
Read |
|
|
Actions |
|
|
Keyboard |
|
|
Mouse |
|
|
Window |
|
|
Waiting |
|
|
Health |
|
|
The MCP server includes built-in instructions that teach agents the correct workflow for each mode — including the orient → act → verify loop, when to use read_text vs find, and how to recover from errors.
┌──────────┐
┌───▶│ ORIENT │ screenshot · apps · windows
│ └────┬─────┘
│ ▼
│ ┌──────────┐
│ │ LOCATE │ find · snapshot · get_element
│ └────┬─────┘
│ ▼
│ ┌──────────┐
│ │ ACT │ click · set_value · type_text · press_key
│ └────┬─────┘
│ ▼
│ ┌──────────┐
│ │ VERIFY │───▶ Done ✅
│ └────┬─────┘
│ │ not yet
└─────────┘Client setup
Config file location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"touchpoint": {
"command": "touchpoint-mcp"
}
}
}If using a virtualenv, use the full path: "/path/to/venv/bin/touchpoint-mcp"
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"touchpoint": {
"command": "touchpoint-mcp"
}
}
}Create or edit ~/.cursor/mcp.json:
{
"mcpServers": {
"touchpoint": {
"command": "touchpoint-mcp"
}
}
}Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"touchpoint": {
"command": "touchpoint-mcp"
}
}
}claude mcp add touchpoint -- touchpoint-mcpAdd to mcpServers in ~/.openclaw/openclaw.json:
{
"mcpServers": {
"touchpoint": {
"command": "touchpoint-mcp"
}
}
}Environment variables
Variable | Example | Description |
|
| Auto-discover CDP ports from running processes |
|
| Explicit app-to-port mapping (JSON) |
|
| Single app name (pair with |
|
| Single port (pair with |
|
| Seconds between CDP port scans |
|
| Display scale override |
|
| Minimum match score for find() (0.0–1.0) |
|
| Use coordinate fallback when native actions fail |
|
| Maximum elements per query |
|
| Default tree depth limit |
|
| Max seconds to wait for a macOS AX app reply |
Browser & Electron Apps (CDP)
Native accessibility APIs return limited data for Electron and Chromium apps (Slack, Discord, VS Code, etc.). Touchpoint's CDP backend connects via Chrome DevTools Protocol to get the full web content.
Auto-discovery is enabled by default — Touchpoint automatically finds running browsers and Electron apps that were launched with a debug port. No manual configuration needed beyond launching the app with the flag.
Setup
Launch the app with a debug port:
# Linux
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/tp-chrome
# macOS
open -na "Google Chrome" --args --remote-debugging-port=9222 --user-data-dir=/tmp/tp-chrome
# Windows
start chrome --remote-debugging-port=9222 --user-data-dir=%TEMP%\tp-chromeConfigure Touchpoint:
import touchpoint as tp
tp.configure(cdp_discover=True) # auto-discover from running processes
# or
tp.configure(cdp_ports={"Google Chrome": 9222}) # explicit mappingControl what you get with the
sourceparameter:
tp.elements(app="Google Chrome", source="full") # native chrome + web content (default)
tp.elements(app="Google Chrome", source="cdp_ax") # web content only (CDP accessibility tree)
tp.elements(app="Google Chrome", source="native") # native UI only (toolbar, tabs, menus)
tp.elements(app="Google Chrome", source="dom") # DOM walker (catches what AX misses)CDP results are merged with native backend results — you get the toolbar and window controls from AT-SPI2/UIA/AX, combined with the full web page content from CDP, in a single elements() call.
source="ax" remains accepted as a compatibility alias for
source="cdp_ax". Prefer cdp_ax in new code so it is not confused with
the native macOS AX backend.
API Reference
Discovery
Function | Description |
| List application names in the accessibility tree |
| All windows with id, title, app, position, size, active state |
| UI elements, with filtering, tree mode, and formatting |
| Deepest element at screen coordinates |
| Fresh snapshot of a single element by ID |
Search & Wait
Function | Description |
| Search by name — 4-stage matching: exact → contains → word → fuzzy |
| Poll until elements appear (or disappear with |
| Poll until an app appears or disappears |
| Poll until a window appears or disappears |
Actions
Function | Description |
| Click via accessibility action, with coordinate fallback |
| Double-click |
| Right-click / context menu |
| Set text content ( |
| Set slider or spinbox value |
| Select a substring within text content across Linux, Windows, macOS, and web/CDP |
| Select a character range when you already know the offsets |
| Move keyboard focus |
| Execute a raw accessibility action by name |
| Bring a window to the foreground (restores from minimized) |
| Minimize a window. Use |
| Enter or exit fullscreen for a window |
| Politely close a window |
| Move a window to a new screen position |
| Resize a window to width × height pixels |
Input
Function | Description |
| Type into the currently focused element |
| Press and release a key ( |
| Key combination ( |
| Click at screen coordinates |
| Double-click at coordinates |
| Right-click at coordinates |
| Move the cursor |
| Scroll at current cursor position |
Screenshot & Config
Function | Description |
| Full desktop or cropped to app/window/element/monitor |
| Number of connected monitors |
| Set runtime options (see Configuration) |
| Report backend, input, CDP, timeout, and dependency health |
All action functions accept an Element object or a string ID. elements(), find(), and get_element() support format="flat", format="json", or format="tree" (elements only) to return pre-formatted strings instead of objects. Window management is implemented across Linux AT-SPI2, Windows UIA, and macOS AX backends.
Architecture
┌───────────────────────────────────────────────────────┐
│ import touchpoint as tp │
│ tp.find() · tp.click() · tp.screenshot() · ... │
│ (Public API) │
├─────────────────────────┬─────────────────────────────┤
│ Backend (ABC) │ InputProvider (ABC) │
├─────────────────────────┼─────────────────────────────┤
│ AT-SPI2 (Linux) │ Xdotool (X11) │
│ UIA (Windows) │ SendInput (Win32) │
│ AX (macOS) │ CGEvent (macOS) │
│ CDP (browsers) │ │
├─────────────────────────┴─────────────────────────────┤
│ Utilities: formatter · matcher · screenshot · scale │
└───────────────────────────────────────────────────────┘Two-layer design:
Backend reads the accessibility tree and runs structured actions (click, set_value, focus). Element-aware and reliable.
InputProvider simulates raw keyboard and mouse input. Coordinate-based and element-blind. Used as an automatic fallback when a native accessibility action isn't available.
CDP runs alongside the platform backend. Their results are merged: native window chrome (toolbar, tabs, menus) from AT-SPI2/UIA/AX, plus full web content from CDP, unified under one API.
For detailed internals, see ARCHITECTURE.md.
Configuration
tp.configure(
fuzzy_threshold=0.6, # minimum match score for find() (0.0–1.0)
fallback_input=True, # use InputProvider when native actions fail
type_chunk_size=40, # split long text into chunks for typing (0 = disable)
max_elements=5000, # max elements per query
max_depth=20, # default tree depth limit
scale_factor=None, # display scale override (None = auto-detect)
cdp_ports={"Chrome": 9222}, # explicit CDP port mapping
cdp_discover=True, # auto-discover CDP ports from running processes
cdp_refresh_interval=5.0, # seconds between CDP target scans
ax_messaging_timeout=1.0, # max seconds to wait for a macOS AX app reply
)tp.diagnostics() returns a JSON-friendly health report. It includes the
active backend, input provider, CDP targets, optional platform tools, configured
timeouts, and macOS apps recently skipped after an AX messaging timeout.
Development
git clone https://github.com/Touchpoint-Labs/touchpoint.git
cd touchpoint
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytestStatus
Alpha — fully functional and tested on all three platforms. The API may change before 1.0 based on user feedback.
Platform | Backend | Input | CDP | Tests |
Linux (X11) | ✅ AT-SPI2 | ✅ xdotool | ✅ | ✅ |
Windows | ✅ UIA | ✅ SendInput | ✅ | ✅ |
macOS | ✅ AX | ✅ CGEvent | ✅ | ✅ |
Known limitations
Wayland input — The Linux InputProvider uses
xdotool, which requires X11. On pure Wayland (no XWayland), keyboard/mouse simulation is unavailable. The accessibility tree and native actions still work.Synchronous CDP — CDP calls block on WebSocket responses. JavaScript dialogs (alert, confirm, prompt) are auto-dismissed to prevent deadlocks. An async rewrite is planned.
No browser navigation API — Touchpoint doesn't have built-in URL navigation. Agents can navigate by interacting with UI elements directly: find the address bar, type a URL, press Enter.
CDP windows are page targets, not OS windows — but window management still works:
tp.activate_window()brings the target forward via CDP, andminimize/fullscreen/close/move/resizeon a surfacedcdp:window are routed to the underlying native OS window (resolved by owning PID) and handled by the platform backend. They raiseActionFailedErroronly if no native OS window for that target can be found (e.g. it has been closed).Backend role/state parity is still uneven — macOS AX and Windows UIA both improved significantly in
0.3.0, but Windows still relies on more heuristics and has more unmapped long-tail roles than the other backends.
Roadmap
High Priority
Async CDP architecture — non-blocking WebSocket, proper dialog queuing, concurrent multi-tab queries
Medium Priority
Backend role/state parity — close remaining role mapping gaps, especially UIA long-tail roles on Windows
Wayland input backend —
libei/xdg-desktop-portalRemoteDesktop when X11 isn't available
Lower Priority
Tooltip and notification visibility
Element caching
License
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Touchpoint-Labs/Touchpoint'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
