v0.3.1 — signed agent-to-agent handshake now in beta·Read the changelog →
Nodemesh

Protocol Specification

Model Context Protocol Specification (2025-06-18).

The formal wire format and handshake specification for autonomous peer-to-peer MCP agent meshes.


1. Architecture & Protocol Goals

Traditional client-server MCP implementations assume an interactive desktop host (such as Claude Desktop) mediating every tool invocation. The Nodemesh specification generalizes MCP for multi-agent autonomous meshes where agents act as both callers and servers concurrently.

  • Zero Central Gateway: Direct peer-to-peer execution once capability discovery completes.
  • Cryptographic Attestation: Every request is signed with the caller's ed25519 private key.
  • Deterministic Attenuation: Scopes are strictly validated against the target agent's manifest schema.

2. The Ed25519 Handshake Sequence

Before invoking any tool, a caller initiates a 3-way authenticated handshake:

  1. Challenge Initiation: Caller generates an ephemeral 32-byte cryptographic nonce and sends a signed initiation request specifying target capabilities and requested scope.
  2. Scope Verification: Callee verifies caller identity against the local gossip consensus view and validates that the requested scope complies with the node's manifest limits.
  3. Session Ticket Issuance: Callee issues a signed 300-second session token. Subsequent tool calls over WebSocket or HTTP/2 include this bearer ticket in the X-Nodemesh-Ticket header.

3. Handshake Frame Schema

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "NodemeshHandshakeFrame",
  "type": "object",
  "required": ["version", "caller", "callee", "nonce", "scope", "timestamp", "signature"],
  "properties": {
    "version": { "type": "string", "enum": ["2025-06-18"] },
    "caller": { "type": "string", "pattern": "^[a-z0-9-]+$" },
    "callee": { "type": "string", "pattern": "^[a-z0-9-]+$" },
    "nonce": { "type": "string", "minLength": 32, "maxLength": 64 },
    "scope": { "type": "string", "enum": ["read-only", "read-write", "ephemeral-task", "admin"] },
    "timestamp": { "type": "integer" },
    "signature": { "type": "string", "description": "Ed25519 signature over canonical JSON" }
  }
}

4. Consensus & Gossip Propagation

Registry state is replicated across cluster nodes using a push-sum anti-entropy gossip protocol. Heartbeats must be announced every 30 seconds; missing three consecutive heartbeats flags a node as degraded, reducing routing preference.