Implementation:23blocks OS Ai maestro AMP Channel Server
| Knowledge Sources | |
|---|---|
| Domains | Messaging, MCP |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
Concrete tool for a Claude Code MCP "channel" server that pushes AMP inbox events straight into a running session via MCP notifications, replacing fragile keystroke wake for idle agents, provided by AI Maestro's `lib/amp-channel-server.mjs`.
Description
The amp-channel-server is a Claude Code "channel" (MCP server) that injects AMP inbox events as real turns into a running Claude Code session without any tmux send-keys. It declares `claude/channel` capability, connects over stdio, and pushes via `mcp.notification({ method: 'notifications/claude/channel' })`. Self-registration: on startup it binds a free localhost port and writes `~/.aimaestro/channels/<agentId>.json` (port, pid, startedAt) so `lib/channel-bridge.mjs` can find it and POST a message in. A delivery handshake (`amp_channel_ack` tool) confirms the session can actually receive channel events — until acknowledged, the tmux fallback is kept as a safety net. Stdout is the MCP transport — all logging goes to stderr.
Usage
Spawned by Claude Code as a subprocess with `AIMAESTRO_AGENT_ID` set. No manual invocation needed.
Code Reference
Source Location
- Repository: ai-maestro
- File: lib/amp-channel-server.mjs
- Lines: L1-L150
Signature
// Spawned as a subprocess by Claude Code; communicates over stdio (MCP transport).
// Self-registers at ~/.aimaestro/channels/<agentId>.json
Import
// Not imported; spawned as a subprocess by Claude Code
// AI Maestro finds it via ~/.aimaestro/channels/<agentId>.json
I/O Contract
| Name | Type | Description |
|---|---|---|
| MCP notification | JSON | `notifications/claude/channel` with message body |
| amp_channel_ack | tool call | Session confirms it can receive events |
| registration file | JSON | `{ port, pid, startedAt }` for channel-bridge |
Usage Examples
// Claude Code spawns this automatically. AI Maestro delivers via:
// POST http://localhost:<port>/message
// The event appears as <channel source="amp"> in the session.