BetterTouchTool MCP Server
This MCP server enables AI assistants like Claude to control and interact with BetterTouchTool on macOS, providing comprehensive access to BTT's automation and customization features.
Capabilities:
Query BTT Configuration: Retrieve and filter triggers by type (keyboard shortcuts, Touch Bar, trackpad gestures, etc.), app, or folder; get specific trigger details by UUID; list named triggers; and inspect preset details including status and visibility
Manage Triggers: Execute named triggers, run actions assigned to specific trigger UUIDs, trigger arbitrary BTT actions via JSON definitions, create new triggers, modify existing triggers, and delete triggers
Manage Variables: Read and set both string and number variables (built-in and user-defined) with optional persistence across BTT restarts
Control Widgets: Update Touch Bar, Menu Bar, or Stream Deck widget text, icons, colors, and backgrounds in real-time; force script widgets to refresh
Access Clipboard: Read and write clipboard content in various formats including plain text, HTML, and base64 images
Manage Presets: Export BTT presets to files with optional compression and settings inclusion; import presets for backup and sharing
System Utilities: Display macOS notifications with custom titles, subtitles, sounds, and images; open BetterTouchTool and navigate directly to specific triggers or elements for editing
Enables control and interaction with BetterTouchTool on macOS, allowing management of triggers, shortcuts, automations, variables, Touch Bar/Menu Bar widgets, presets, and clipboard operations.
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., "@BetterTouchTool MCP Server show me all my named triggers"
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.
BetterTouchTool MCP Server
A Model Context Protocol (MCP) server that enables AI assistants like Claude to control and interact with BetterTouchTool on macOS.
What is this?
This MCP server acts as a bridge between Claude (or other MCP-compatible AI assistants) and BetterTouchTool, allowing you to:
Query your BTT configuration - Understand what triggers, shortcuts, and automations you have set up
Execute triggers and actions - Run named triggers, keyboard shortcuts, or any BTT action
Manage variables - Get and set BTT variables for dynamic workflows
Update widgets - Modify Touch Bar, Menu Bar, or Stream Deck widgets in real-time
Control presets - Export, import, and manage BTT presets
Access clipboard - Read and write clipboard contents programmatically
Related MCP server: Keyboard Maestro MCP Server
Prerequisites
macOS (BetterTouchTool is macOS-only)
BetterTouchTool installed with a valid license
Python 3.12+
uv (recommended) or pip for package management
Claude Desktop or another MCP-compatible client
Installation
1. Enable BTT Webserver
First, enable the BetterTouchTool webserver:
Open BetterTouchTool
Go to Preferences → Advanced → Webserver
Check Enable Webserver
Note the port (default:
56786)Optionally set a Shared Secret for authentication
2. Install the MCP Server
Option A: Install with uv (Recommended)
# Clone the repository
git clone https://github.com/your-username/bettertouchtool-mcp-server.git
cd bettertouchtool-mcp-server
# Install dependencies with uv
uv syncOption B: Install with pip
# Clone the repository
git clone https://github.com/your-username/bettertouchtool-mcp-server.git
cd bettertouchtool-mcp-server
# Create virtual environment and install
python -m venv .venv
source .venv/bin/activate
pip install -e .3. Configure Claude Desktop
Add the server to your Claude Desktop configuration file:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
Using uv:
{
"mcpServers": {
"bettertouchtool": {
"command": "uv",
"args": [
"--directory",
"/path/to/bettertouchtool-mcp-server",
"run",
"btt-mcp-server"
]
}
}
}Using Python directly:
{
"mcpServers": {
"bettertouchtool": {
"command": "/path/to/bettertouchtool-mcp-server/.venv/bin/python",
"args": ["-m", "btt_mcp"]
}
}
}4. Restart Claude Desktop
After saving the configuration, restart Claude Desktop to load the MCP server.
Available Tools
The server provides 20 tools organized into categories:
Configuration Reading
Tool | Description |
| List triggers with optional filtering by type, app, or parent |
| Get detailed info about a specific trigger by UUID |
| List all named triggers (quick actions) |
| Get info about presets and their status |
Trigger Management
Tool | Description |
| Execute a named trigger by name |
| Execute any BTT action via JSON definition |
| Execute all actions assigned to a trigger UUID |
| Create a new trigger from JSON definition |
| Modify an existing trigger |
| Remove a trigger (⚠️ destructive) |
Variable Management
Tool | Description |
| Read string or number variables |
| Set persistent or runtime variables |
Widget Control
Tool | Description |
| Update widget text, icon, or colors |
| Force a script widget to refresh |
Clipboard Operations
Tool | Description |
| Read clipboard in various formats |
| Write to clipboard |
Preset Management
Tool | Description |
| Export preset to a file |
| Import preset from a file |
System Utilities
Tool | Description |
| Show a macOS notification |
| Open BTT and navigate to an element |
Usage Examples
Exploring Your Configuration
Ask Claude:
"What triggers do I have set up in BetterTouchTool?"
"Show me all my named triggers"
"What keyboard shortcuts do I have configured?"
Running Automations
"Run my 'Toggle Dark Mode' trigger in BTT"
"Execute the BTT trigger that opens my development environment"
Working with Variables
"What's the current value of my 'workMode' variable in BTT?"
"Set my BTT variable 'currentProject' to 'MCP Server Development'"
Updating Widgets
"Update my Touch Bar clock widget to show 'Meeting in 5 min' with a red background"
"Refresh my system stats widget"
Managing Configuration
"Export my current BTT preset to ~/Desktop/my-preset.bttpreset"
"Show me the details of trigger with UUID abc-123-def"
Complex Workflows
"I want to create a new named trigger that opens Safari and navigates to my project management tool"
"Help me understand what my 'Morning Routine' trigger does and suggest improvements"
Configuration
Configuration is stored in ~/.config/btt-mcp/config.yml. The file is created automatically with defaults on first use, or you can create it manually:
# BTT MCP Server Configuration
host: 127.0.0.1
port: 56786
shared_secret: null # Set this if you've configured a shared secret in BTT
use_cli: false # Set to true to use bttcli instead of HTTPConfiguration Options
Option | Default | Description |
|
| BTT webserver host |
|
| BTT webserver port |
|
| Shared secret for authentication (if configured in BTT) |
|
| Use |
Example: With Shared Secret
If you've configured a shared secret in BTT preferences:
host: 127.0.0.1
port: 56786
shared_secret: my_secret_keyExample: Using CLI Mode
For faster performance using the Unix socket:
use_cli: trueThis uses the socket at /tmp/com.hegenberg.BetterTouchTool.sock for lower latency.
Trigger Types
When filtering triggers, you can use these types:
named_trigger- Named triggers (quick actions)keyboard_shortcut- Keyboard shortcutstouchbar- Touch Bar itemstrackpad- Trackpad gesturesmagic_mouse- Magic Mouse gesturesdrawings- Drawing gesturessiri_remote- Siri Remotenormal_mouse- Regular mouse buttonsstream_deck- Stream Deck buttonsmidi- MIDI triggersmenubar- Menu bar items
Troubleshooting
"Connection refused" errors
Ensure BTT is running
Verify webserver is enabled in BTT preferences
Check the port matches (default: 12345)
"403 Forbidden" errors
You have a shared secret configured in BTT. Either:
Add
shared_secret: your_secretto~/.config/btt-mcp/config.ymlRemove the shared secret from BTT preferences
"bttcli not found" (CLI mode)
The CLI tool should be at:
/Applications/BetterTouchTool.app/Contents/SharedSupport/bin/bttclior
~/Applications/BetterTouchTool.app/Contents/SharedSupport/bin/bttcli
Tools not appearing in Claude
Check Claude Desktop config syntax is valid JSON
Verify the path to the MCP server is correct
Restart Claude Desktop
Check Console.app for MCP-related errors
Development
Project Structure
The codebase is organized into a modular package:
src/btt_mcp/
├── server.py # FastMCP server initialization
├── config.py # Constants and configuration
├── models/ # Pydantic input models (7 files)
├── client/ # BTT communication (HTTP + CLI)
├── formatters/ # Output formatting
└── tools/ # MCP tool implementations (6 files)See CLAUDE.md for detailed architecture documentation.
Running locally for testing
# With uv
uv run btt-mcp-server
# Or directly
python -m btt_mcpRunning Tests
# Run all 48 tests
uv run pytest
# With verbose output
uv run pytest -vTesting with MCP Inspector
npx @modelcontextprotocol/inspector uv --directory /path/to/project run btt-mcp-serverAPI Reference
This server implements the BTT Webserver API. Key endpoints used:
GET /get_triggers- Retrieve trigger configurationsGET /trigger_named- Execute named triggersGET /trigger_action- Execute arbitrary actionsGET /get_string_variable/set_string_variable- Variable managementGET /update_touch_bar_widget- Widget updatesGET /get_clipboard_content/set_clipboard_content- Clipboard access
License
MIT License - see LICENSE file.
Contributing
Contributions welcome! Please feel free to submit issues and pull requests.
Acknowledgments
BetterTouchTool by folivora.AI
Model Context Protocol by Anthropic
FastMCP for the Python MCP framework
Available Tools
20 toolsbtt_add_triggerA
Add a new trigger to BetterTouchTool.
The trigger definition should be in JSON format. You can get
the format by copying an existing trigger's JSON in BTT.
Args:
params: Contains the trigger JSON definition and optional parent UUID.
Returns:
Confirmation of trigger creation.
Inputs: params (required). Returns: result
btt_delete_triggerADestructive
Delete a trigger from BetterTouchTool.
WARNING: This permanently removes the trigger. Make sure you have
the correct UUID before deleting.
Args:
params: Contains the UUID of the trigger to delete.
Returns:
Confirmation of deletion.
Inputs: params (required). Returns: result
btt_display_notificationB
Display a macOS notification via BTT.
Args:
params: Notification title, subtitle, sound, and optional image.
Returns:
Confirmation of notification being displayed.
Inputs: params (required). Returns: result
btt_execute_triggerB
Execute all actions assigned to a specific trigger by UUID.
Args:
params: Contains the UUID of the trigger to execute.
Returns:
Result of the execution.
Inputs: params (required). Returns: result
btt_export_presetARead-onlyIdempotent
Export a BTT preset to a file.
Useful for backing up configurations or sharing presets.
Args:
params: Preset name and export options.
Returns:
Path to exported preset file.
Inputs: params (required). Returns: result
btt_get_clipboardBRead-onlyIdempotent
Get the current clipboard content.
Can retrieve content in various formats including plain text, HTML,
images (as base64), and more.
Args:
params: Format to retrieve and whether to return as base64.
Returns:
Clipboard content.
Inputs: params (required). Returns: result
btt_get_preset_detailsBRead-onlyIdempotent
Get details about a specific preset.
Returns information about the preset's status, UUID, and visibility.
Args:
params: Name of the preset to query.
Returns:
Preset details in markdown or JSON format.
Inputs: params (required). Returns: result
btt_get_triggerARead-onlyIdempotent
Retrieve a specific trigger by its UUID.
Use this to get detailed information about a single trigger, including
all its configuration and assigned actions.
Args:
params: Contains the UUID of the trigger to retrieve.
Returns:
Trigger configuration in markdown or JSON format.
Inputs: params (required). Returns: result
btt_get_triggersARead-onlyIdempotent
Retrieve triggers from BetterTouchTool with optional filtering.
Use this tool to explore and understand the current BTT configuration.
You can filter by trigger type, parent folder, specific app, or get all triggers.
Args:
params: Filter parameters including trigger_type, trigger_id, app_bundle_identifier, etc.
Returns:
List of triggers in markdown or JSON format based on response_format setting.
Inputs: params (required). Returns: result
btt_get_variableARead-onlyIdempotent
Get the value of a BTT variable.
BTT has many built-in variables (like BTTActiveAppBundleIdentifier)
and supports user-defined variables.
Args:
params: Variable name and type (string or number).
Returns:
Current value of the variable.
Inputs: params (required). Returns: result
btt_import_presetB
Import a BTT preset from a file.
Args:
params: Path to the preset file.
Returns:
Confirmation of import.
Inputs: params (required). Returns: result
btt_list_named_triggersARead-onlyIdempotent
List all named triggers configured in BetterTouchTool.
Named triggers are triggers configured in the 'Other' tab that can be
called by name from scripts or other actions.
Returns:
List of named triggers with their names and UUIDs.
Inputs: params (required). Returns: result
btt_refresh_widgetAIdempotent
Refresh a script widget to re-execute its scripts.
Use this to force a widget to update its display by running
its assigned scripts again.
Args:
params: UUID of the widget to refresh.
Returns:
Confirmation of refresh.
Inputs: params (required). Returns: result
btt_reveal_in_uiAIdempotent
Reveal a trigger or element in the BetterTouchTool UI.
Opens BTT and navigates to the specified element for editing.
Args:
params: UUID of the element to reveal.
Returns:
Confirmation.
Inputs: params (required). Returns: result
btt_set_clipboardBIdempotent
Set the clipboard content.
Can set content in various formats including plain text and HTML.
Args:
params: Content to set and format.
Returns:
Confirmation of clipboard being set.
Inputs: params (required). Returns: result
btt_set_variableAIdempotent
Set a BTT variable to a specified value.
Variables can be persistent (survive BTT restart) or runtime-only.
Args:
params: Variable name, value, type, and persistence setting.
Returns:
Confirmation of variable being set.
Inputs: params (required). Returns: result
btt_trigger_actionA
Trigger any BTT predefined action using a JSON definition.
You can get the JSON for an action by right-clicking a configured
trigger in BTT and selecting 'Copy JSON'.
Args:
params: Contains the action JSON definition.
Returns:
Result of the action execution.
Inputs: params (required). Returns: result
btt_trigger_namedA
Execute a named trigger by its name.
Named triggers are configured in BTT's 'Other' tab and can perform
any sequence of actions.
Args:
params: Contains the trigger_name and whether to wait for completion.
Returns:
Result of the trigger execution (if wait_for_reply is True).
Inputs: params (required). Returns: result
btt_update_triggerBIdempotent
Update an existing trigger's configuration.
Provide the UUID of the trigger and a JSON object with the
properties to update.
Args:
params: Contains UUID and JSON with properties to update.
Returns:
Confirmation of update.
Inputs: params (required). Returns: result
btt_update_widgetAIdempotent
Update the display of a Touch Bar, Menubar, or Stream Deck widget.
This allows temporary updates to widget appearance without changing
the underlying configuration.
Args:
params: Widget UUID, type, and display properties to update.
Returns:
Confirmation of widget update.
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have distinct purposes, but there is some potential confusion between btt_execute_trigger, btt_trigger_action, and btt_trigger_named, as they all involve executing triggers or actions. The descriptions help clarify differences, but an agent might initially struggle to choose the right one for a given task.
All tool names follow a consistent btt_verb_noun pattern with snake_case, such as btt_add_trigger, btt_delete_trigger, and btt_get_clipboard. This uniformity makes the tool set predictable and easy to navigate.
With 20 tools, the count is on the higher side but reasonable for a comprehensive BetterTouchTool server covering triggers, presets, variables, clipboard, notifications, and widgets. It might feel slightly heavy, but each tool appears to serve a specific function in the domain.
The tool set provides complete coverage for managing BetterTouchTool, including CRUD operations for triggers (add, delete, get, update, list), preset handling (export, import, get details), variable management (get, set), clipboard control, notifications, and widget updates. No obvious gaps are present for the intended domain.
Maintenance
Related MCP Connectors
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Create Tasks and run Workflows in Bleep from Claude, ChatGPT, and other AI assistants.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants access to the macOS clipboard content, supporting text, images, and binary data via OSAScript.8MIT
- AlicenseNot gradedqualityDmaintenanceAn advanced macOS automation toolkit that enables AI clients to directly control a machine through deep integration with Keyboard Maestro. It provides a comprehensive suite of tools for executing macros, managing variables, and performing complex system automation with enterprise-grade security.13MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to automate macOS through AppleScript and JXA by providing 44 tools for application management, window control, and UI interaction. It allows for comprehensive system control including screen capture, keyboard and mouse simulation, and system information retrieval.4415 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to automate macOS desktop tasks including mouse control, keyboard input, screenshots, window management, and UI interaction.10 npm415MIT