da-mcp
The da-mcp server is a cross-platform desktop automation MCP server that enables AI agents to interact with the local desktop environment through tools for screen capture, OCR with UI element classification, mouse and keyboard control, and program launching. It supports Linux (X11/Wayland), macOS, and Windows with automatic backend fallbacks.
Capture and Recognition
Capture full-screen or display-specific screenshots as PNG images.
List all connected displays with their IDs, bounds, scale factors, rotation, and primary status.
Perform OCR on a display to extract text and classify UI elements into categories like buttons, input fields, labels, checkboxes, radio buttons, menus, menu items, and icons, aiding targeted automation.
Mouse Control
Get the current cursor position in screen coordinates.
Move the cursor to absolute coordinates, optionally with a duration for smooth movement.
Click, double-click, and drag with configurable mouse buttons (left, right, middle, back, forward) at any location.
Scroll the mouse wheel horizontally and vertically by pixel deltas.
Keyboard Control
Type text at the current keyboard focus with optional per-character delays.
Press single keys or key chords (e.g., Ctrl+C, Alt+Tab) with support for modifiers (ctrl, alt, shift, meta/super) and hold duration.
Program Launch
Launch applications by name or absolute path, with optional working directory, environment variables, detached mode, and execution timeout.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@da-mcpTake a screenshot and click the OK button at those coordinates"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
da-mcp — Crossplatform Desktop Automation MCP Server
A Model Context Protocol (MCP) server that lets AI agents (OpenCode, Claude Desktop, etc.) interact with a local desktop environment: screenshots, OCR with UI-element classification, mouse/keyboard control, and program launch — on Linux, macOS, and Windows.
Features
12 tools registered under the da_* namespace:
Capture
da_screenshot— Capture full screen or a specific display as PNG.da_ocr— Run OCR (Tesseract) on a screenshot and return structured text + UI element classification.da_list_displays— List connected displays with id, bounds, scale factor.
Input
da_get_mouse_position— Read current cursor position (X11/Linux usesxdotool getmouselocation --shell, Wayland usesydotool, macOS/Windows usesrobotjs).da_move_mouse— Move the cursor to (x, y).da_click— Click at (x, y) with optional button (left/right/middle/back/forward) and count.da_double_click— Convenience wrapper for double-click.da_drag— Drag from (x1, y1) to (x2, y2).da_scroll— Scroll wheel at (x, y) by (dx, dy).da_type— Type a string at the current focus.da_key— Press a single key or chord (e.g.Ctrl+C).
Launch
da_launch— Launch a program by name or path; returns a spawn handle with PID + POSIX signal exit codes (SIGINT=130, SIGTERM=143, SIGHUP=129, SIGKILL=137, SIGQUIT=131, SIGABRT=134).
UI element classification (OCR post-processing)
The da_ocr classifier tags each detected text region with one of:
Category | Examples |
| "OK", "Cancel", "Apply" |
| Text fields, search boxes |
| Static descriptive text |
| "☑ Enable", "☐ Dark mode" |
| "◉ Local", "○ Network" |
| Top-level menu headers ("File", "Edit") |
| Dropdown entries ("New", "Open…") |
| Toolbar / sidebar icons |
Related MCP server: desk-mcp
Architecture
Language: TypeScript 7.0 (strict, ESM, Node 22+);
exactOptionalPropertyTypes,noUncheckedIndexedAccess,noFallthroughCasesInSwitchall on. Exact version pins (no^/~).MCP SDK: v2 (
@modelcontextprotocol/server@2.0.0) overStdioServerTransport(production) andInMemoryTransport(tests).Module layout (250 LOC ceiling per file):
Screenshot —
src/screenshot/{png,backends,index,types}.ts. PNG validation/encoding isolated inpng.ts; backend dispatch (node-screenshots → screenshot-desktop → Windows CLI) inbackends.ts.OCR —
src/ocr/{cli,index,mock,parse,wasm,types,classify,classify-rules}.ts. CLI backend (runCli), WASM fallback (runWasm), parser, mock; orchestrator inindex.tsrethrows asOCR_FAILEDwhen both backends fail.Input —
src/input/{routing,mouse,keyboard,scroll,drag,types,index}.ts. Shared routing helpers (runCli,resolveRouting,requireTool,loadRobotjs,isMockMode,validateCoords,Routing) inrouting.ts; per-input-type operations in dedicated files.Launch —
src/launch/{launch,types}.ts.open(1)+child_process.spawn(shell:false);SIGNAL_EXIT_CODESmap for POSIX signal mapping.Platform —
src/platform/{detect,types}.ts.detectPlatform()returns{ os, display, tools, home };assertPlatformSupported()throwsPLATFORM_INIT_FAILEDon unsupported combos.Server —
src/server.ts. Registers 12 tools, wraps handler results intoCallToolResultwithstructuredContent(Buffers stripped tonumber[]for JSON-safety), installs SIGINT/SIGTERM shutdown.
Backend dispatch
Capability | Primary | Fallback 1 | Fallback 2 |
Screenshot (Linux X11) |
|
| — |
Screenshot (Linux Wayland) |
|
| — |
Screenshot (macOS) |
|
| — |
Screenshot (Windows) |
| PowerShell BitBlt ( | — |
Input (Linux X11) |
| — | — |
Input (Linux Wayland) |
|
| — |
Input (macOS / Windows) |
| — | — |
OCR (any OS) |
|
| — |
Every spawnSync/spawn call uses shell:false. Permission-gated errors (e.g. macOS ScreenCaptureKit, Windows access denied) are detected via a tightened pattern (screen…permission, screencapturekit, access is denied) and re-thrown as DaMcpError('PERMISSION_DENIED').
Install
# System dependencies (apt/dnf/brew; see scripts/install-system-deps.sh)
sudo ./scripts/install-system-deps.sh
# npm deps
npm install
# Build
npm run build
# Verify type-check (strict mode)
npm run typecheck
# Run all tests (mock mode — skips real native calls)
DA_MCP_TEST_MODE=mock npm testRun
stdio (default)
The server speaks MCP over stdio. Configure your MCP client to launch node /projects/da-mcp/dist/server.js (or npx tsx src/server.ts for dev).
HTTP (opt-in, token-protected)
Set DA_MCP_TRANSPORT=http to expose the server on http://127.0.0.1:3000/<token>. A 256-bit random token is generated on first start and persisted at:
OS | Token path |
Linux |
|
macOS |
|
Windows |
|
The token file is created with mode 0o600 (owner-only). Rotate it any time:
node /projects/da-mcp/dist/server.js token regenerate
# → http://127.0.0.1:3000/<43-char-base64url-token>Override defaults with env vars:
DA_MCP_HTTP_HOST— bind address (default127.0.0.1); supports IPv4, IPv6 ([::1]), and hostnameDA_MCP_PORT— port (default3000)DA_MCP_TOKEN_PATH— override token storage path
The URL is unauthenticated token (bearer-style): anyone with the token can call tools. Bind only to 127.0.0.1 (default) — do not expose this to a network without adding an upstream auth proxy.
OpenCode / Claude Desktop example config
{
"mcpServers": {
"da-mcp": {
"command": "node",
"args": ["/projects/da-mcp/dist/server.js"],
"env": {
"DISPLAY": ":0",
"DA_MCP_LOG": "info"
}
}
}
}Cross-platform notes
OS | Screenshot | Input | Notes |
Linux X11 |
|
| Requires |
Linux Wayland |
|
| XWayland fallback if available |
macOS |
|
| First call needs Screen Recording permission (TCC) |
Windows |
|
| VS Build Tools required; PowerShell BitBlt fallback if GDI fails |
Development
# Strict type-check (no emit)
npx tsc --noEmit
# All tests in mock mode (CI default)
DA_MCP_TEST_MODE=mock npx vitest run
# Single test file
npx vitest run test/unit/screenshot.test.ts
# Watch mode
npx vitestTest inventory
18 test files: 15 unit (
test/unit/) + 3 e2e (test/e2e/)216 tests passing / 17 skipped in mock mode (e2e require real X11/tesseract)
Test runtime:
process.env['DA_MCP_TEST_MODE'] === 'mock'short-circuits native calls;_mock.tsmodules inject deterministic native modules
Conventions
250 LOC ceiling per file (measured as non-blank, non-comment lines:
awk '!/^[[:space:]]*$/ && !/^[[:space:]]*(\/\/|#|--)/' <file> | wc -l)ESM imports use
.jssuffix even for.tssourceAll
spawn*calls withshell: falseAll native errors wrapped in
DaMcpErrorwith typedcodefromErrorCodeunionPublic surface re-exported from
src/screenshot/index.tsandsrc/input/index.ts— consumers import from there, not from per-operation filesForbidden:
as any,@ts-ignore,@ts-expect-error,console.log,shell: true, auto-commits
Environment variables
DISPLAY— X11 display (Linux only)WAYLAND_DISPLAY— Wayland display socketDA_MCP_LOG— log level (trace|debug|info|warn|error), defaultinfoDA_MCP_TESSERACT_BIN— path totesseractbinary, defaulttesseractDA_MCP_OCR_BACKEND—cli(default) orwasmDA_MCP_TEST_MODE—mockskips real native calls in tests; e2e tests skip when setDA_MCP_SCREENSHOT_BACKEND— force a screenshot backend (node-screenshots|screenshot-desktop|windows-cli); default auto-detectDA_MCP_TRANSPORT—stdio(default) orhttp;httpenables the opt-in HTTP transportDA_MCP_PORT— HTTP port whenDA_MCP_TRANSPORT=http(default3000)DA_MCP_HTTP_HOST— HTTP bind address (default127.0.0.1); supports IPv4, IPv6, hostnameDA_MCP_TOKEN_PATH— override the auth token storage path
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceAn open-source MCP server for macOS and Windows that provides native desktop control via Accessibility APIs, OCR, and Chrome CDP. It enables AI agents to interact with applications, manage browser sessions, and automate workflows with high-speed native UI actions.Last updated9810AGPL 3.0
- Alicense-qualityDmaintenanceA desktop automation MCP server that enables AI agents to interact with Linux environments through screenshots, window inspection, and input simulation. It provides tools for mouse control, keyboard input, and screen capture using xdotool and XDG Desktop Portals.Last updatedMIT
- AlicenseAqualityAmaintenanceWindows desktop automation MCP server — screenshot, mouse, keyboard & UI Automation. Lets LLM agents see and control your Windows desktop directly.Last updated301,3308MIT
- Alicense-qualityBmaintenanceAn MCP server that gives any AI assistant eyes and hands on your desktop — screenshots, clicking, typing, OCR, window management, accessibility-tree queries, workflow recording.Last updated5Apache 2.0
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Local-first RAG engine with MCP server for AI agent integration.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/cioinside/da-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server