Stdio MCP server registered as a Claude Code --channels source. Receives inbound events from SynthesisAgent.OpenclawPlugin and emits notifications/claude/channel to push them into the running Claude turn loop. Forwards tools/call requests back to OpenClaw for execution. Capability declaration uses experimental.claude/channel — required nesting discovered 2026-05-14 against the official Anthropic discord plugin source.
2.4 KiB
2.4 KiB
SynthesisAgent.ClaudePlugin
The Claude Code side of SynthesisAgent. A stdio MCP server that registers as a --channels plugin and bridges to SynthesisAgent.OpenclawPlugin.
What it does
- Receives inbound messages from OpenClaw and emits
notifications/claude/channelso Claude Code starts a new turn. - Receives the OpenClaw tool catalog at
hello_acktime and exposes them as MCP tools. - Forwards every
tools/callover the bridge for OpenClaw to execute. - Forwards Claude's
permission_requestnotifications to OpenClaw, and surfaces the user's reply back.
Required env vars
Set by OpenclawPlugin when it spawns Claude:
| Var | Example | Meaning |
|---|---|---|
SYNTHESIS_BRIDGE_URL |
ws://127.0.0.1:18801/bridge |
Where to connect |
SYNTHESIS_BRIDGE_TOKEN |
... |
Shared secret |
SYNTHESIS_OPENCLAW_SESSION |
discord:alice |
This Claude process serves this session |
SYNTHESIS_CLAUDE_SESSION |
<uuid> |
The Claude session UUID, for traceability |
Spawn shape (done by OpenclawPlugin)
claude \
--channels plugin:synthesis-claude@local \
--resume "$SYNTHESIS_CLAUDE_SESSION" \
--allowed-tools "Read Edit Bash mcp__synthesis__*" \
--append-system-prompt-file ./session-context.md
TODO
- Verify exact semantics of
--channels plugin:foo@baragainst the running Claude Code build. - Verify
mcp.notification('notifications/claude/channel', ...)triggers a new turn (vs being silently accepted). May need to first land onclaude/channelcapability declaration. - Implement attachment download flow (
download_attachmentstyle) — currently passthrough. - Implement
fetch_messagesto query OpenClaw history. - Wire
bun-typesinstall inpackage.json.
Manual test (once OpenclawPlugin is wired up)
# Terminal 1: start OpenclawPlugin bridge server
openclaw # with SynthesisAgent.OpenclawPlugin loaded
# Terminal 2: simulate the spawn manually
SYNTHESIS_BRIDGE_URL=ws://127.0.0.1:18801/bridge \
SYNTHESIS_BRIDGE_TOKEN=local-dev \
SYNTHESIS_OPENCLAW_SESSION=test:1 \
SYNTHESIS_CLAUDE_SESSION=$(uuidgen) \
claude --channels plugin:synthesis-claude@local
# Terminal 3: push a fake inbound message via OpenclawPlugin admin CLI
openclaw synthesis push --session test:1 --content "hello"
A successful run: Claude Code visibly starts a new turn in Terminal 2 reacting to "hello".