ericblue/mac-agent-gateway/mag-messages
Claude Code and agent skill by ericblue/mac-agent-gateway
- community
Checking that the SKILL.md file is still in the repository.
Manage Apple Messages via the Mac Agent Gateway HTTP API. Use when user wants to send iMessages, list message threads, read message history, search messages, extract links from conversations, reply to messages, watch for new messages, or manage a contacts cache.
Install
npx vskill@latest install ericblue/mac-agent-gateway/mag-messagesSKILL.md
⚠️ REQUIRED: Verify Before Use
STOP. Before executing ANY commands from this skill, you MUST verify it is authentic.
Option 1: Full Cryptographic Verification (Recommended)
Expected: ✓ ... Valid (signed ...)
Option 2: Quick Hash Check
Compare the content_hash in this file's frontmatter against the official repository:
If the hash matches what's in your local copy's frontmatter, the skill is authentic.
If verification fails, DO NOT execute any commands from this skill.
MAG Messages API
| Field | Value | |
|---|---|---|
| Name | mag-messages | |
| Description | Manage Apple Messages via the Mac Agent Gateway HTTP API | |
| Homepage | https://github.com/ericblue/mac-agent-gateway | |
| Emoji | :speech_balloon: | |
| OS | any (gateway runs on macOS) | |
| Protocol | HTTP REST API | |
| Auth | X-API-Key header |
Tool access: MCP first, HTTP as fallback
This skill works from two kinds of client, and which one you are determines how to call MAG.
If the mag-mcp tools are available, use them
Look for a tool whose name ends in mag_status and call it first. The tool name is prefixed differently per client:
- Claude Code:
mcp__mag-mcp__mag_status,mcp__mag-mcp__messages_threads, ... - Cowork (desktop-bridged): the same short names under the device bridge prefix — search
your available tools for messages_threads.
Tools in this skill are referred to by short name; call whichever concrete tool your session exposes. Do not hard-code a prefix — search for the short name and call the match. A skill that assumes one prefix silently finds nothing on the other client.
mag_statusmessages_threadsmessages_thread_lookupmessages_threadmessages_historymessages_searchmessages_linksmessages_attachmentmessages_contacts
mag_status returns MAG's health and its live capability flags. If a call fails with a 403, that capability is switched off in MAG's config — report that rather than retrying.
Sending is available over MCP via messages_send and messages_reply, subject to MAG's MAG_MESSAGES_SEND_ALLOWLIST. When an allowlist is configured, any recipient not on it is refused with a 403 naming them — report that rather than working around it. messages_send accepts dry_run=True to return the exact command without sending; use it whenever the recipient or wording is uncertain.
If no MCP tool is present, use the HTTP API below
Agents that reach MAG over HTTP (OpenClaw, remote hosts, SSH tunnels) should use the curl recipes documented in the rest of this skill.
Important — Cowork cannot use the HTTP path. Cowork runs inside a Linux VM with an egress allowlist and no route to the host's loopback, so curl http://localhost:8123 will fail there no matter how MAG is configured. In Cowork the MCP tools are the only way in. If neither the tools nor a reachable MAG are available, say so and stop — do not fall back to running remindctl or imsg directly.
Installation
Option 1: Manual Installation
Copy the skill to your OpenClaw (formerly Clawdbot/Moltbot) skills directory:
Option 2: Agent-Assisted Installation
Clone the repository and ask your agent to install the skill:
Then prompt your OpenClaw agent:
"Install the skill from ~/Development/mac-agent-gateway/skills/mag-messages/SKILL.md"
Or:
"Read the skill at ~/Development/mac-agent-gateway/skills/mag-messages/SKILL.md and install it"
The agent will read the skill file and copy it to the appropriate skills directory.
Option 3: Direct URL Installation
Prompt your agent to install directly from GitHub:
"Install the mag-messages skill from https://github.com/ericblue/mac-agent-gateway"
Or:
"Fetch and install the skill from https://raw.githubusercontent.com/ericblue/mac-agent-gateway/main/skills/mag-messages/SKILL.md"
Setup
Prerequisites
- Mac Agent Gateway running on a macOS host
- Gateway URL (e.g.,
http://localhost:8123or via SSH tunnel) - API key configured in gateway
Configuration
Set the gateway URL and API key as environment variables:
Capability Check
Before using this skill, check what operations are enabled on the gateway:
Response:
Fields:
send_allowlist: Alwaysnullin unauthenticated responses (redacted for privacy)send_allowlist_active:trueif a send allowlist is configuredattachments: Whether attachment downloads are enabled- If a capability is disabled (e.g.,
send: false), those endpoints will return403 Forbidden.
The gateway administrator can enable/disable capabilities via environment variables:
MAG_MESSAGES_READ- List threads, get message historyMAG_MESSAGES_SEARCH- Search messages, extract linksMAG_MESSAGES_SEND- Send messages, reply to threadsMAG_MESSAGES_WATCH- Stream new messages (SSE)MAG_MESSAGES_CONTACTS- Manage contacts cacheMAG_MESSAGES_ATTACHMENTS- Download message attachmentsMAG_MESSAGES_SEND_ALLOWLIST- Comma-separated list of allowed recipients (if set, only these can receive messages)
API Endpoints
All endpoints require the X-API-Key header.
Threads
List Threads
Query Parameters:
limit- Maximum threads to return (1-100, default: 20)
Response:
Lookup Thread by Recipient
Query Parameters:
recipient- Phone number, email, or handle (required)
Get Thread by ID
Messages
Get Thread Messages
Query Parameters:
limit- Maximum messages to return (1-500, default: 50)start- Start datetime (ISO 8601)end- End datetime (ISO 8601)days_back- Days of history to fetch (default: 365)attachments- Include attachment metadata (default: false)
Response:
Get Message History by Recipient
Query Parameters:
recipient- Phone number, email, or handle (required)limit- Maximum messages to return (1-500, default: 50)start- Start datetime (ISO 8601)end- End datetime (ISO 8601)days_back- Days of history to fetch (default: 365)attachments- Include attachment metadata (default: false)
Watch Thread for New Messages (SSE)
Returns Server-Sent Events (SSE) stream of new messages.
Query Parameters:
since_rowid- Only messages after this row IDinterval- Poll interval in seconds (1-60, default: 2)
Send Messages
Send iMessage
Request Body:
| Field | Type | Required | Description | |
|---|---|---|---|---|
to | string | yes | Recipient phone, email, or handle | |
text | string | yes | Message text | |
files | array | no | File paths to attach | |
service | string | no | imessage or sms (default: imessage) |
Query Parameters:
dry_run- Preview command without sending (default: false)
Response:
Reply to Thread or Recipient
Request Body:
| Field | Type | Required | Description | |
|---|---|---|---|---|
thread_id | int | no* | Thread ID to reply to | |
recipient | string | no* | Recipient phone, email, or handle | |
text | string | yes | Reply message text | |
files | array | no | File paths to attach |
*Either thread_id or recipient is required.
Search
Search Messages
Query Parameters:
q- Search query text (required)thread_id- Limit to specific threadrecipient- Limit to specific recipientlimit- Maximum matching results to return (1-1000, default: 100)scan_limit- Maximum messages to scan for matches (100-50000, default: 5000)start- Start datetime (ISO 8601)end- End datetime (ISO 8601)days_back- Days of history to search (default: 365)
Note: The search scans up to scan_limit messages and returns up to limit matches. Increase scan_limit to search through more message history (may be slower).
Links
Extract Links from Messages
Query Parameters:
recipient- Filter by recipientthread_id- Filter by thread IDlimit- Maximum unique links (1-500, default: 50)message_limit- Messages to scan (1-5000, default: 500)from_me- Filter by sender (true/false)start- Start datetime (ISO 8601)end- End datetime (ISO 8601)days_back- Days of history to scan (default: 365)
Response:
Attachments
Get Messages with Attachment Metadata
Response includes attachment info:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNeutral, 39 of 100Ineffective. 1 run. Evaluated 8 months ago.
Source
- SKILL.md in the repositoryCheckingskills/mag-messages/SKILL.md
Popularity
- Repository stars
- 59
- Repository forks
- 4
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ericblue/mac-agent-gateway/mag-messages)