Skip to main content
Glama
README.md
# mcp-control

MCP server that gives Claude Code full mouse, keyboard, and app control on macOS. Tell Claude what to do and watch it operate your computer.

Pair with [mcp-screen](https://github.com/andrefigueira/mcp-screen) for vision + control.

## Setup

Add to `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "control": {
      "command": "npx",
      "args": ["mcp-control"]
    }
  }
}
```

Restart Claude Code. Done.

## Usage

Just tell Claude what to do:

- "Open Safari and go to github.com"
- "Click the search box and type my query"
- "Fill in this form - name is Andre, email is..."
- "Switch to Slack and send a message"
- "Scroll down on this page"

## Tools

### Mouse
| Tool | Description |
|------|-------------|
| `mouse_move` | Move cursor to (x, y) |
| `mouse_click` | Click at (x, y) with left/right, single/double/triple |
| `mouse_drag` | Drag from one point to another |
| `mouse_scroll` | Scroll up/down/left/right |
| `get_cursor_position` | Get current cursor coordinates |

### Keyboard
| Tool | Description |
|------|-------------|
| `type_text` | Type a string into the focused field |
| `press_key` | Press a key combo (e.g. cmd+c, tab, enter) |

### App Control
| Tool | Description |
|------|-------------|
| `get_frontmost_app` | Get focused app name and bundle ID |
| `focus_app` | Bring an app to the front |
| `list_windows` | List all visible windows with positions and sizes |

### Batch
| Tool | Description |
|------|-------------|
| `run_actions` | Execute a sequence of actions in one call - click, type, press keys, switch apps |

The `run_actions` tool is the key for speed. Instead of one tool call per action (each with Claude think time), it batches everything into a single round-trip.

## How It Works

Uses macOS Core Graphics events via JXA (JavaScript for Automation) and AppleScript. Zero external dependencies - just built-in macOS tools.

- Mouse control: CGEvent API (sub-millisecond)
- Keyboard: AppleScript keystroke (handles Unicode)
- Key combos: CGEvent with modifier flags
- App control: AppleScript

## Permissions

Your terminal needs **Accessibility** permission:

**System Settings > Privacy & Security > Accessibility** - enable your terminal app.

## Requirements

- macOS
- Node.js >= 18

## Author

[@voidmode](https://x.com/voidmode)

## License

MIT

TDQS

A3.5/5.0

Scored across 11 tools

Disambiguation5/5

Each tool maps to a distinct desktop-control action: pointer movement, clicking, dragging, scrolling, typing, key presses, app/window introspection, focus, or batched execution. The only meta-tool, run_actions, is clearly described as a batch alternative to individual calls rather than an overlapping primitive.

Naming Consistency4/5

All names use snake_case, and the mouse_* group is internally consistent while the remaining tools mostly follow verb_noun patterns like get_cursor_position and press_key. The mixed resource-first vs action-first style is a minor deviation, not a readability problem.

Tool Count5/5

Eleven tools is well-scoped for a desktop-control server. Each tool covers a meaningful primitive, and the batch run_actions tool is a useful efficiency addition rather than unnecessary surface area.

Completeness4/5

Core desktop interactions are covered: mouse movement, clicking, dragging, scrolling, typing, key presses, app focus, cursor position, window listing, and batch actions. Minor gaps remain around screen capture/vision and direct window manipulation, but agents can still accomplish the main control workflows.