Keyboard Maestro MCP Server
Click on "Deploy 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., "@Keyboard Maestro MCP Server Take a screenshot of my active window and describe what you see"
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.
Keyboard Maestro MCP Server
An MCP (Model Context Protocol) server that connects AI assistants like Claude to Keyboard Maestro, enabling them to trigger macros and retrieve clipboard results from your Mac.
What It Does
This MCP server lets AI assistants:
Trigger macros on one or multiple Macs
Capture clipboard contents (text and images) from macros
Take screenshots and analyze them
Run OCR and extract text
Control multiple machines from a single configuration
When you run a macro that copies something to the clipboard (like a screenshot), the AI can retrieve and see that content directly.
Related MCP server: Playwright MCP for macOS
Requirements
macOS with Keyboard Maestro 11+ installed
Keyboard Maestro Web Server enabled
Node.js 18+
Quick Start
1. Add the MCP Server
Add to your MCP client configuration:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"keyboard-maestro": {
"command": "npx",
"args": ["-y", "keyboard-maestro-mcp"]
}
}
}Claude Code (~/.claude/mcp.json):
{
"keyboard-maestro": {
"command": "npx",
"args": ["-y", "keyboard-maestro-mcp"]
}
}2. Run the Config Tool
After adding the server and restarting your MCP client, ask the AI:
Open the Keyboard Maestro config toolThe config tool will guide you through:
Enable Web Server - Instructions for Keyboard Maestro's Web Server settings
Add Machine(s) - Enter connection details and test the connection
Update Config - Automatically update your MCP config file (or copy JSON)
Install Macros - Generate and import the required Keyboard Maestro macros
Configuration Reference
Environment Variables
When machines are configured, the server uses these environment variables:
Variable | Description |
| JSON array of machine configurations |
Or for a single machine:
Variable | Required | Default | Description |
| Yes | - | Hostname or IP address |
| No | 4490 | Web server port |
| Yes | - | Web server username |
| Yes | - | Web server password |
| No | false | Use HTTPS instead of HTTP |
| No | Host value | Friendly name for the machine |
| Yes | - | Folder where clipboard files are saved |
Machine Configuration Object
Each machine in KM_MACHINES supports:
Field | Required | Default | Description |
| Yes | - | Friendly name for the machine |
| Yes | - | Hostname or IP address |
| No | 4490 | Web server HTTP port |
| Yes | - | Web server username |
| Yes | - | Web server password |
| No | false | Use HTTPS instead of HTTP |
| Yes | - | Folder where clipboard files are saved |
Port Spacing: Keyboard Maestro uses two consecutive ports (HTTP and HTTPS on port + 1). When configuring multiple machines, space ports by at least 2 (e.g., 4490, 4492, 4494).
Available Tools
interactive_config
Visual configuration tool with interactive UI (for Claude Desktop and other MCP Apps-supporting clients). Provides:
Machine management (add, edit, remove, test)
MCP config file updates
Macro group generation and installation
config
Text-based configuration tool (for Claude Code and other CLI clients).
list_machines
List all configured Keyboard Maestro machines.
list_macros
List available macros from a machine.
trigger_macro
Trigger a macro by name or UUID.
trigger_macro_on_all
Trigger a macro on all configured machines simultaneously.
get_clipboard_result
Retrieve the current clipboard contents from a machine.
trigger_and_capture
Trigger a macro and automatically capture the clipboard result.
Example Workflows
Screenshot Analysis
Take a screenshot of the active window and describe what you seeOCR Text Extraction
Run OCR on my clipboard image and read the textMulti-Machine Control
Mute audio on all my machinesKeyboard Maestro Setup
The config tool will guide you, but here's a summary:
Enable Web Server
Open Keyboard Maestro
Go to Keyboard Maestro → Preferences (⌘,)
Click the Web Server tab
Check Web Server Enabled
Set a Username and Password
Note the HTTP Port (default: 4490)
Import Macros
After generating macros with the config tool:
Go to File → Import → Import Macros Safely...
Select the downloaded
keyboard-maestro-mcp.kmmacrosfileThe "Keyboard Maestro MCP" group will appear
Security Considerations
Credentials are passed via environment variables
Use HTTPS (
secure: true) when connecting over untrusted networksThe web server uses HTTP Basic Authentication
Consider firewall rules to restrict access to the web server port
Clipboard files are stored in your configured folder
Troubleshooting
"Connection refused" errors
Verify Keyboard Maestro's web server is enabled
Check the port number matches your configuration
Ensure no firewall is blocking the connection
Macros not appearing in list
The macro must be enabled
The macro group must be enabled
The macro must have a name
Clipboard capture returns nothing
Run the config tool to verify macros are installed
Check that
outputDirpoints to the same folder configured in the macrosEnsure the folder exists and is writable
License
MIT
Available Tools
12 toolsconfigKeyboard Maestro MCP ConfigC
Configuration tool for Keyboard Maestro MCP.
This tool helps you:
Add and manage Keyboard Maestro machines
Test connections to machines
Update your MCP client configuration
Generate and install the required macros
Inputs: no named parameters.
generate_macros_contentB
Generate Keyboard Maestro macros file, save to Downloads, and create the storage directory
Inputs: path (required).
get_clipboard_resultA
Retrieve the current clipboard contents from a remote machine. Returns text directly or displays images.
This is the companion tool to trigger_macro - use it to retrieve results after triggering macros that:
Take screenshots (the image will be on the clipboard)
Copy text or data to clipboard
Perform OCR or text extraction
Any operation that puts results on the system clipboard
The tool works by triggering a helper macro that saves the clipboard to a file, then reading that file. Requires the "Save Clipboard to File" macro to be installed (see error message for setup instructions if not configured).
Inputs: machine.
get_config_stateB
Get the current configuration state for Keyboard Maestro MCP
Inputs: no named parameters.
list_machinesB
List all configured Keyboard Maestro machines
Inputs: no named parameters.
list_macrosB
List available macros from a Keyboard Maestro machine's web server
Inputs: machine.
test_machine_connectionC
Test connection to a Keyboard Maestro machine
Inputs: host (required), password (required), username (required), port, +1 more.
trigger_and_captureA
Trigger a macro and automatically capture the clipboard result. This is a convenience tool that combines trigger_macro + get_clipboard_result.
Use this when you want to:
Take a screenshot and see it immediately
Run a macro that copies something to clipboard and retrieve it
Perform OCR and get the extracted text
The macro runs first, then after a short delay the clipboard is captured and returned.
Inputs: macro (required), delay, value, machine.
trigger_macroA
Trigger a Keyboard Maestro macro by name or UUID. The macro runs on the remote machine.
IMPORTANT: Keyboard Maestro's web server does not return macro output directly. If you need to retrieve results from a macro:
For macros that capture screenshots or copy data to clipboard: call get_clipboard_result afterward to retrieve the clipboard contents
For macros that write to files: the files are saved on the remote machine
Common patterns:
Screenshot workflow: trigger_macro("Take Screenshot...") → get_clipboard_result() to see the image
Text capture: trigger_macro("Copy Selection") → get_clipboard_result() to get the text
Inputs: macro (required), value, machine.
trigger_macro_on_allB
Trigger a Keyboard Maestro macro on all configured machines
Inputs: macro (required), value.
update_mcp_configC
Update an MCP client config file with Keyboard Maestro machine definitions
Inputs: machines (required), configPath (required), storagePath (required).
verify_macros_installedB
Check if the Keyboard Maestro MCP macros are installed on configured machines
Inputs: machineName.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
The broad 'config' tool overlaps substantially with get_config_state, test_machine_connection, update_mcp_config, generate_macros_content, and verify_macros_installed, creating fuzzy boundaries in the setup cluster. trigger_and_capture also overlaps with trigger_macro plus get_clipboard_result, though its description clearly frames it as a convenience wrapper.
Most tools follow a snake_case verb_noun pattern (list_machines, trigger_macro, get_clipboard_result), which is predictable. Minor deviations are the bare noun 'config' and 'trigger_and_capture' using 'and' rather than a single verb_noun form.
Twelve tools is a reasonable size for a server covering machine configuration, macro discovery, triggering, and clipboard capture. There is some redundancy from the broad config tool and the convenience trigger_and_capture tool, but the count itself is not excessive.
The core workflow is well covered: configure/test/list machines, list/trigger macros, trigger across all machines, retrieve clipboard results, and generate/verify helper macros. Gaps exist around explicit machine removal and macro inspection/update, but these are minor for the primary execution-focused purpose.
Maintenance
Related MCP Connectors
Mac & Windows: let ChatGPT, Claude & Cursor use your email, calendar, iMessage, Teams, files.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Claude and ChatGPT, connected to your iCloud Calendar, Mail, Contacts and Reminders.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceConnect AI with any macOS app. Deep integration with native apps like Calendar, Mail, Notes, plus UI control for all applications. Works with Claude, Cursor, Raycast, and any MCP-compatible AI.46MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to see and interact with any macOS application using natural language commands. Perfect for testing Mac applications, UI automation, and app development with AI assistance.34MIT
- AlicenseNot gradedqualityBmaintenanceGives AI assistants direct access to macOS clipboard - letting Claude copy generated code, text, or files straight to your clipboard for pasting anywhere on Mac.253MIT
- AlicenseNot gradedqualityDmaintenanceEnables high-speed native macOS automation for Claude by interacting directly with the Accessibility API, AppleScript, and UI trees instead of using screenshots. It allows users to read app states, click elements, and type text semantically across any macOS application.12 npm13MIT