Building Applications & Examples
Shipped examples and step-by-step patterns for building your own services with send/recv, MCP, and A2A, plus patterns for building your own applications on top of it.
Overview
Building your Own Application
Pattern 1: Send/Recv (Fire-and-Forget)
import requests, json, time
AXL = "http://127.0.0.1:9002"
PEER = "1ee862344fb283395143ac9775150d2e5936efd6e78ed0db83e3f290d3d539ef"
def send(message):
requests.post(f"{AXL}/send",
headers={"X-Destination-Peer-Id": PEER},
data=json.dumps(message))
def recv_loop():
while True:
resp = requests.get(f"{AXL}/recv")
if resp.status_code == 200:
sender = resp.headers.get("X-From-Peer-Id")
print(f"From {sender[:8]}...: {resp.text}")
time.sleep(0.2)Pattern 2: MCP Services (Request-Response)
Step 1: Write Your Service
Step 2: Start the MCP Router
Step 3: Register your Service w/ Router
Step 4: Enable MCP (Node Config)
MCP Router Endpoints
Pattern 3: A2A (Agent-to-Agent)
A2A Test Client
Adding a Custom Protocol
Sharing Your Service
Built-in Examples
1. Tensor Exchange
2. Remote MCP Server
3. Remote A2A
4. GossipSub
5. Convergecast
Last updated