Skip to content

ErwanLorteau/cursor-control-mcp

Repository files navigation

Cursor Control MCP Server

An MCP server that gives AI agents the ability to control mouse cursor and keyboard with security guardrails.

Features

  • Mouse Control: move, click, double-click, right-click, drag, scroll
  • Keyboard Control: type text, press keys, hotkey combinations
  • Screenshots: capture full screen or regions
  • Security: session-based control, kill switch, action logging

Installation

pip install -e .

Usage

Start the server

cursor-control-mcp [config.yaml]

Configure with Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "cursor-control": {
      "command": "cursor-control-mcp",
      "args": ["/path/to/config.yaml"]
    }
  }
}

Tools

Tool Description
screenshot Capture screen or region
move_cursor Move cursor to coordinates
click Click at position
double_click Double-click at position
drag Drag from one point to another
scroll Scroll mouse wheel
type_text Type text string
press_key Press key with modifiers
hotkey Press key combination
get_status Get session status and screen info
request_control Start control session
release_control End control session
get_action_log Get recent action history

Security

Kill Switch

Press Ctrl+Alt+Escape (configurable) to immediately end the session.

Session Control

  • Sessions have a maximum duration (default: 30 min)
  • All actions are logged to SQLite database
  • No control without active session (except screenshot)

Action Logging

Every action is logged with timestamp and parameters. View logs:

# Via MCP tool
get_action_log(last_n=50)

Configuration

See config.yaml for options:

max_session_minutes: 30
kill_switch_hotkey: [ctrl, alt, escape]
log_all_actions: true
log_path: "~/.cursor-control-mcp/actions.db"

Requirements

  • Python 3.10+
  • Windows: Works out of the box
  • macOS: Works out of the box
  • Linux: Requires X11 display (Wayland partial support)

Platform-specific install

# Windows
pip install -e ".[windows]"

# Linux
pip install -e ".[linux]"

# macOS
pip install -e .

License

MIT

About

MCP server for AI cursor and keyboard control with security guardrails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors