Shortcuts Bridge
Trigger macOS Shortcuts from Claude via a local HTTP bridge server running on the user's Mac.
Prerequisites
The user must have shortcuts_bridge.py running:
bash
python3 shortcuts_bridge.py
Bridge URL: http://127.0.0.1:9876
Security defaults:
- •
allow_remote_clientsshould stayfalse - •
auth_tokenshould be set for POST endpoints - •
enable_savefileshould stayfalseunless needed - •Browser calls require
cors_allowed_originsto include the page origin
Step 1: Check Available Shortcuts
Read the bridge health endpoint and only use shortcuts in allowed_shortcuts:
javascript
fetch('http://127.0.0.1:9876/health').then(r => r.json()).then(console.log)
If token auth is enabled, include header X-Bridge-Token.
Step 2: Trigger via Browser JavaScript
If direct shell HTTP calls are unavailable, use browser JavaScript:
javascript
(async () => {
const r = await fetch('http://127.0.0.1:9876/run', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Bridge-Token': 'YOUR_TOKEN_IF_REQUIRED'
},
body: JSON.stringify({
shortcut: 'SHORTCUT_NAME',
input: 'Your message or input here'
})
});
return await r.text();
})()
Response Format
Success: {"success": true, "shortcut": "SendText"}
Error: {"error": "...", "allowed": ["SendText", ...]}
Adding New Shortcuts
User must:
- •Create a Shortcut in Shortcuts.app (accepts text input if needed)
- •Add shortcut name to
allowed_shortcutsinshortcuts_bridge.local.json - •Restart the server
Common Shortcut Pattern
| Shortcut | Purpose | Input |
|---|---|---|
| SendText | Send iMessage/SMS | Message text |
| CreateReminder | Add reminder | Reminder text |
| ShowNotification | Local notification | Message text |
Troubleshooting
- •Timeout/no response: server not running or crashed. Restart
shortcuts_bridge.py. - •Connection refused: bridge not started.
- •Shortcut not in allowlist: add it to
allowed_shortcutsand restart.