Julia MCP Bridge Operations
The Julia bridge lives in bridge/ and exposes telegram_send, telegram_receive, and bridge_health via MCP on http://127.0.0.1:3001. Use the steps below whenever you need to debug, restart, or exercise the bridge.
Prerequisites
node/npmavailable locally (Node ≥18)mcporterinstalled (npm i -g mcporter)config/mcporter.json(project scope) includes:{ "mcpServers": { "julia-bridge": { "transport": "http", "url": "http://127.0.0.1:3001" } } }juliaagent definition (agents/juliamcp.yml) already references thejulia-bridge/*skills.
Health + Status Checks
- From repo root run:
mcporter call julia-bridge.bridge_health - Interpret the JSON payload:
status: ok→ Julia heartbeat seen in the last 15 sstatus: degraded→ bridge alive but Julia heartbeat missing (OpenClaw heartbeat still present)status: down→ no peers (restart bridge or check heartbeats)queuesizes show pending messages for each side.
- If the call errors with HTTP 404/connection refused, the server is not running — restart it (see below).
- For quick queue inspection (without MCP):
curl -s http://127.0.0.1:3001/queues/openclaw | jq curl -s http://127.0.0.1:3001/queues/julia | jq
Sending Messages (OpenClaw → Julia)
- Always generate a deterministic
correlationIdso replies can be matched (e.g.,uuidgenor hash of source message). - Invoke the
julia-bridge/sendskill with:{ "correlationId": "julia-20260221-001", "text": "<payload>", "context": "optional metadata", "target": "julia" } - Inspect the response fields:
successshould betruequeueDepthindicates how many OpenClaw→Julia messages are waiting.
- The skill automatically updates the OpenClaw heartbeat; if it fails, run the health workflow above.
Receiving Replies (Julia → OpenClaw)
- Poll with
julia-bridge/receive. Provide acorrelationIdto fetch a single reply or omit to drain everything fortarget: "openclaw". - Use the
timeoutfield (milliseconds) to long-poll:{ "target": "openclaw", "correlationId": "julia-20260221-001", "timeout": 5000 } - If nothing arrives within the timeout, check the
/queues/openclawendpoint or confirm Julia is enqueueing messages (see/inbound).
Starting / Restarting the Bridge Server
- In a dedicated terminal:
This runscd bridge npm install # only needed after dependency changes npm startnode server.jsand logs requests prefixed with[bridge]. - Stop with
Ctrl+Cand restart if you change the server code. - For background runs, consider
nodemonorpm2(not configured by default). - After restart, re-run the health check to verify connectivity.
Inbound Hooks (Julia → Bridge)
- HTTP endpoint for Julia to push responses:
curl -X POST http://127.0.0.1:3001/inbound \ -H 'Content-Type: application/json' \ -d '{"correlationId":"...","text":"...","context":"..."}' - Heartbeat endpoint (updates
bridge_healthpeer status):curl -X POST http://127.0.0.1:3001/heartbeat/julia curl -X POST http://127.0.0.1:3001/heartbeat/openclaw
Troubleshooting
| Symptom | Fix |
|---|---|
SSE error: 404 from mcporter |
Bridge not bound to /mcp — ensure server uses the Streamable HTTP routes defined in server.js. |
Output validation error: no structured content |
Ensure helper toJsonResult returns both content (human-readable) and structuredContent (raw JSON). Already baked into server.js. |
queueDepth never drains |
Confirm julia-bridge/receive is called with correct target and correlation ID. Use /queues/<target> endpoint for visibility. |
Julia heartbeat stuck in down |
Hit /heartbeat/julia, or ensure Julia pushes via /inbound. |
mcporter can’t resolve server |
Re-run mcporter config add julia-bridge http://127.0.0.1:3001 --transport http. |
Related Files
bridge/server.js– MCP server implementationbridge/package.json– scripts (npm start)skills/julia-bridge/*.yml– OpenClaw callable tool wrappersagents/juliamcp.yml– agent definition that wires these tools together