@web4w3/nut-js-mcp-server
v1.0.4
Published
MCP server for desktop automation via @nut-tree-fork/nut-js
Maintainers
Readme
nut-js MCP Server
MCP server for desktop automation via @nut-tree-fork/nut-js. Exposes mouse, keyboard, screen capture, clipboard, and YAML-based scenario execution.
Setup
npx -y @web4w3/nut-js-mcp-serverNo cloning or build step needed. The package is pre-compiled and available on npm as @web4w3/nut-js-mcp-server.
macOS Permissions
Grant your terminal Accessibility and Screen Recording permissions in System Settings > Privacy & Security.
MCP Configuration
{
"mcpServers": {
"nut-js": {
"command": "npx",
"args": ["-y", "@web4w3/nut-js-mcp-server"]
}
}
}Tools
Mouse
mouse_move— Move cursor to (x, y) with animationmouse_set_position— Instant cursor placementmouse_get_position— Get cursor coordinatesmouse_click— Click (left/right/middle, single/double)mouse_press/mouse_release— Hold/release buttonsmouse_scroll— Scroll in any directionmouse_drag— Drag to coordinates
Keyboard
keyboard_type— Type a text stringkeyboard_press_key— Press key combination (e.g., Ctrl+C)keyboard_hold_key/keyboard_release_key— Hold/release keyslist_keys— List all available key names
Screen
screen_size— Get screen dimensionsscreen_capture— Save screenshot to filescreen_capture_base64— Get screenshot as base64screen_color_at— Get pixel color at point
Clipboard
clipboard_get/clipboard_set— Read/write clipboard
Configuration
configure_mouse_speed— Set movement speed (px/s)configure_mouse_delay— Set inter-action delayconfigure_keyboard_delay— Set typing delay
Utility
wait— Pause executionrun_scenario— Execute YAML scenario from stringrun_scenario_file— Execute YAML scenario from file
YAML Scenario Format
name: "My Automation"
config:
mouseSpeed: 1000
mouseDelay: 100
keyboardDelay: 50
steps:
- action: move
x: 100
y: 200
- action: click
button: left
double: false
- action: type
text: "Hello world"
- action: hotkey
keys: [LeftControl, S]
- action: screenshot
filename: "result"
- action: wait
ms: 1000
- action: scroll
direction: down
amount: 5
- action: drag
x: 400
y: 300
- action: clipboard_set
text: "copied text"
- action: repeat
count: 3
steps:
- action: key
keys: [Tab]Available Actions
| Action | Parameters |
|--------|-----------|
| move | x, y |
| click | button (left/right/middle), double (bool) |
| press | button |
| release | button |
| scroll | direction (up/down/left/right), amount |
| drag | x, y |
| type | text |
| key | keys (array of Key names) |
| hotkey | keys (array of Key names) |
| screenshot | filename, format (png/jpg), directory, region ({x,y,width,height}) |
| clipboard_set | text |
| clipboard_get | — |
| wait | ms |
| repeat | count, steps (nested array) |
