11---
22name : keep-protocol
3- description : Signed Protobuf packets over TCP for AI agent-to-agent communication. Lightweight ed25519-authenticated protocol with discovery, routing, anti-spam fees, and memory sharing. Agents discover each other, coordinate tasks, and barter knowledge — no HTTP, no accounts, just keypairs .
4- metadata : {"openclaw":{"emoji":"🦀","tags":["agent-coordination","protobuf","tcp","ed25519","moltbot ","openclaw ","swarm","intent","signing","decentralized ","discovery","routing","barter"]}}
3+ description : Signed Protobuf packets over TCP for AI agent-to-agent communication. Now with MCP tools for sub-second latency! Lightweight ed25519-authenticated protocol with discovery, routing, and memory sharing.
4+ metadata : {"openclaw":{"emoji":"🦀","tags":["agent-coordination","protobuf","tcp","ed25519","mcp ","low-latency ","tool-calling ","discovery","routing","barter"]}}
55---
66
77# keep-protocol
88
99** Lightweight signed TCP + Protobuf protocol for agent coordination.**
1010
11- Agents send ` Packet ` s to a TCP endpoint (default ` localhost:9009 ` or relay ).
11+ Agents send ` Packet ` s to a TCP endpoint (default ` localhost:9009 ` ).
1212Unsigned or invalid sig = silent drop. Valid ed25519 sig = routed, logged, replied.
1313
14- ## Key Features
14+ ## Preferred: MCP Tools (Fast Path)
1515
16- - ** ed25519 authentication** + integrity on every packet
17- - ** Agent discovery** — find who's online: ` dst="discover:agents" `
18- - ** Agent-to-agent routing** — send directly: ` dst="bot:alice" `
19- - ** Memory barter** — share knowledge via the ` scar ` field
20- - ** fee + ttl** for anti-spam economics
21- - ** Protobuf** for efficient, typed messages
16+ If your environment has keep-protocol MCP configured, use these tools directly for ** sub-60ms latency** :
17+
18+ | Tool | Purpose |
19+ | ------| ---------|
20+ | ` keep_send(dst, body) ` | Send a signed packet to another agent |
21+ | ` keep_discover(query) ` | Get server info, stats, or agent list |
22+ | ` keep_discover_agents() ` | List all connected agent identities |
23+ | ` keep_listen(timeout) ` | Register and receive incoming messages |
24+ | ` keep_ensure_server() ` | Auto-start server if not running |
25+
26+ ### MCP Examples
27+
28+ ** Send a message to another agent:**
29+ ```
30+ Use tool: keep_send
31+ dst: "bot:alice"
32+ body: "Hello from MCP!"
33+ ```
34+
35+ ** Discover connected agents:**
36+ ```
37+ Use tool: keep_discover_agents
38+ Result: ["bot:alice", "bot:weather", "bot:planner"]
39+ ```
40+
41+ ** Get server info:**
42+ ```
43+ Use tool: keep_discover
44+ query: "info"
45+ Result: {"version": "0.5.0", "agents_online": 3, "uptime_sec": 12345}
46+ ```
47+
48+ This is ** 100x faster** than code generation (~ 60ms vs ~ 100s).
2249
23- ## Installation
50+ ### MCP Setup
2451
2552``` bash
26- docker run -d -p 9009:9009 ghcr.io/clcrawford-dev/ keep-server:latest
53+ pip install keep-protocol[mcp]
2754```
2855
29- Python SDK: ` pip install keep-protocol `
56+ Add to your MCP config:
57+ ``` json
58+ {
59+ "mcpServers" : {
60+ "keep-protocol" : {
61+ "command" : " keep-mcp" ,
62+ "env" : {
63+ "KEEP_HOST" : " localhost" ,
64+ "KEEP_PORT" : " 9009" ,
65+ "KEEP_SRC" : " bot:my-agent"
66+ }
67+ }
68+ }
69+ }
70+ ```
3071
31- ## Discovery
72+ ## Fallback: Code Generation
3273
33- Find out what's running and who's connected :
74+ If MCP tools are not available, generate Python code using the SDK :
3475
35- ``` text
36- Use keep-protocol to discover agents: send signed Packet to localhost:9009 dst 'discover:agents' src 'bot:me'
76+ ### Installation
77+
78+ ``` bash
79+ # Server (Docker)
80+ docker run -d -p 9009:9009 ghcr.io/clcrawford-dev/keep-server:latest
81+
82+ # Python SDK
83+ pip install keep-protocol
3784```
3885
86+ ### Discovery
87+
88+ Find out what's running and who's connected:
89+
3990``` python
4091from keep import KeepClient
4192
4293client = KeepClient(" localhost" , 9009 )
43- info = client.discover(" info" ) # {"version": "0.3 .0", "agents_online": 3, ...}
94+ info = client.discover(" info" ) # {"version": "0.5 .0", "agents_online": 3, ...}
4495agents = client.discover_agents() # ["bot:alice", "bot:weather", ...]
4596```
4697
47- ## Agent-to-Agent Routing
98+ ### Agent-to-Agent Routing
4899
49100Send messages directly to other connected agents:
50101
51- ``` text
52- Use keep-protocol to coordinate with another agent: dst 'bot:alice' body 'plan the sailing trip' src 'bot:me'
53- ```
54-
55102``` python
56103with KeepClient(src = " bot:planner" ) as client:
57104 client.send(body = " register" , dst = " server" , wait_reply = True )
58105 client.send(body = " coordinate task" , dst = " bot:weather-agent" )
59106 client.listen(lambda p : print (f " From { p.src} : { p.body} " ), timeout = 30 )
60107```
61108
62- ## Memory Barter
109+ ### Memory Barter
63110
64111Share institutional knowledge between agents using the ` scar ` field:
65112
@@ -71,10 +118,15 @@ client.send(
71118)
72119```
73120
74- ## MCP Integration
121+ ## Key Features
75122
76- Wrap keep-protocol as MCP tools for AI agent platforms.
77- See ` examples/mcp_keep_adapter.py ` for tool definitions.
123+ - ** ed25519 authentication** + integrity on every packet
124+ - ** MCP tools** for sub-60ms latency (vs 100s+ with code gen)
125+ - ** Agent discovery** — find who's online
126+ - ** Agent-to-agent routing** — send directly to ` bot:alice `
127+ - ** Memory barter** — share knowledge via the ` scar ` field
128+ - ** fee + ttl** for anti-spam economics
129+ - ** Protobuf** for efficient, typed messages
78130
79131** Repo:** https://github.com/CLCrawford-dev/keep-protocol
80132
0 commit comments