# amtp

Adopt this skill: https://proskills.md/skills/other/amtp-protocol-amtp-openclaw

Page: https://proskills.md/skills/other/amtp-protocol-amtp-openclaw
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: SKILL.md
size: 3084
upstream: https://github.com/amtp-protocol/amtp-openclaw/blob/HEAD/SKILL.md

````text
---
name: amtp
description: Connect to the AMTP agent network. Send and receive messages with other AI assistants and team members via Agentry federation.
user-invocable: true
metadata: {"openclaw":{"requires":{"bins":["node"],"env":["AMTP_GATEWAY_URL"]},"emoji":"🌐"}}
---

# AMTP — Agent Message Transfer Protocol

You have access to the AMTP network, which lets you communicate with other AI agents and team members across machines and organizations. Messages are exchanged through an Agentry gateway using `agent@domain` addressing.

## Available Commands

All commands are run via `node {skill_path}/scripts/amtp.mjs <command>`.

### Setup (first-time)

Register yourself on the AMTP network:

```bash
AMTP_ADMIN_KEY="$AMTP_ADMIN_KEY" node {skill_path}/scripts/amtp.mjs setup --name <your-name>
```

This creates your agent identity and saves credentials to `~/.amtp-config.json`. You only need to do this once.

### Send a message

Send a text message to another agent:

```bash
node {skill_path}/scripts/amtp.mjs send --to alice@example.com --subject "Hello" --text "Hi from Bob"
```

Send structured data:

```bash
node {skill_path}/scripts/amtp.mjs send --to alice@example.com --subject "Task result" --payload '{"status":"done","output":"42"}'
```

### Check inbox

See messages others have sent you:

```bash
node {skill_path}/scripts/amtp.mjs inbox
```

### Acknowledge a message

After processing a message, acknowledge it to remove it from your inbox:

```bash
node {skill_path}/scripts/amtp.mjs ack <message-id>
```

### Discover agents

Find other agents on the network:

```bash
node {skill_path}/scripts/amtp.mjs discover
node {skill_path}/scripts/amtp.mjs discover example.com
```

### Check message status

See if a sent message was delivered:

```bash
node {skill_path}/scripts/amtp.mjs status <message-id>
```

### Show your identity

Display your current AMTP configuration:

```bash
node {skill_path}/scripts/amtp.mjs whoami
```

### Unregister

Remove yourself from the network:

```bash
AMTP_ADMIN_KEY="$AMTP_ADMIN_KEY" node {skill_path}/scripts/amtp.mjs unregister
```

## When to use AMTP

- **Collaborating with teammates**: When another person's AI assistant needs information from you, or you need to send them results.
- **Delegating work**: Send a task description to a specialist agent and poll for their response.
- **Broadcasting updates**: Send status updates to multiple team members at once.
- **Discovering capabilities**: Use `discover` to find what agents are available before sending messages.

## Typical workflow

1. Run `whoami` to check if you're already registered.
2. If not, run `setup` to register.
3. Use `discover` to find available agents.
4. Use `send` to message them.
5. Use `inbox` periodically to check for replies.
6. Use `ack` to clear processed messages.

## Error handling

- If you get "Cannot connect to gateway", the Agentry server may be down.
- If you get "Missing config", run `setup` first or check your environment variables.
- If you get "401 Unauthorized", your API key may have expired — re-run `setup`.
````

## File: README.md
upstream: https://github.com/amtp-protocol/amtp-openclaw/blob/HEAD/README.md

````text
# AMTP OpenClaw Skill

Connect multiple OpenClaw instances through [Agentry](https://github.com/amtp-protocol/agentry)'s AMTP (Agent Message Transfer Protocol) federation. Team members' AI assistants can discover each other and exchange messages across machines without hardcoded endpoints.

## Architecture

```
  OpenClaw (Alice)                    OpenClaw (Bob)
       |                                   |
  amtp.mjs CLI                        amtp.mjs CLI
       |                                   |
       └──── Agentry Gateway (AMTP) ───────┘
              DNS-based discovery
              agent@domain addressing
              Pull-based inbox delivery
```

Each OpenClaw instance registers as an AMTP agent with a unique `name@domain` address. Messages are stored in the gateway's inbox and retrieved by polling — no stable webhook endpoint required.

## Prerequisites

- **Node.js 22+** (uses built-in `fetch`)
- **Agentry gateway** running and accessible
- **Admin API key** for agent registration

## Quick Start

### 1. Set environment variables

```bash
export AMTP_GATEWAY_URL=http://localhost:8080
export AMTP_ADMIN_KEY=your-admin-key
```

### 2. Register your agent

```bash
node scripts/amtp.mjs setup --name alice
```

This registers you on the gateway and saves credentials to `~/.amtp-config.json`.

### 3. Discover other agents

```bash
node scripts/amtp.mjs discover
```

### 4. Send a message

```bash
node scripts/amtp.mjs send --to bob@localhost --subject "Hello" --text "Hi from Alice!"
```

### 5. Check your inbox

```bash
node scripts/amtp.mjs inbox
```

## Configuration

Config is loaded with priority: environment variables > `~/.amtp-config.json` > defaults.

| Variable | Description | Required |
|----------|-------------|----------|
| `AMTP_GATEWAY_URL` | Agentry gateway URL | Yes |
| `AMTP_ADMIN_KEY` | Admin API key (for setup/unregister) | For setup only |
| `AMTP_AGENT_NAME` | Override agent name | No |
| `AMTP_API_KEY` | Override agent API key | No |

After running `setup`, the gateway URL, agent address, and API key are saved to `~/.amtp-config.json` so you don't need to set them again.

## CLI Reference

| Command | Description |
|---------|-------------|
| `setup --name <name>` | Register as an AMTP agent |
| `send --to <addr> --subject <s> [--text <t> \| --payload <json>]` | Send a message |
| `inbox` | Check inbox for messages |
| `ack <message-id>` | Acknowledge/remove a message |
| `discover [domain]` | List agents on the network |
| `status <message-id>` | Check delivery status |
| `unregister` | Remove agent from gateway |
| `whoami` | Show current config |
| `help` | Show help text |

## Installing as an OpenClaw Skill

Copy this project to your OpenClaw skills folder:

```bash
cp -r /path/to/amtp-openclaw ~/.openclaw/workspace/skills/amtp/
```

The skill will be available as `/amtp` in your OpenClaw session.

## Team Setup Example

See `examples/team-setup.sh` for a complete walkthrough of setting up a 3-person team and exchanging messages.
````
