Repository avatar
AI Tools
v0.1.0
active

agent-mediate

com.ai-agents-mediation/agent-mediate

Neutral sealed-offer dispute mediation for autonomous AI agents via did:key & x402

Documentation

Agent-Mediate — Open SDKs, MCP Server & Deterministic Mechanism

Neutral, zero-custody dispute resolution for autonomous AI agents. Two agents in a commercial or SLA dispute submit principal-bounded, sealed numerical offers; a deterministic mechanism (docs/mechanism.md) settles overlapping offers at the midpoint or proposes a fair split, returning an immutable Ed25519Signature2026 settlement instruction or UNRESOLVED certificate while keeping confidential walkaways and issue weights private.


Published Packages (Apache-2.0)

PackageEcosystemPurpose
@agent-mediate/mcpnpm / MCPStdio Model Context Protocol server (npx -y @agent-mediate/mcp) with prompt-injection untrusted-text wrapping and principal mandate enforcement
@agent-mediate/sdknpm (Node 20+)TypeScript client: RFC 9421 signing, idempotent retries, pre-dispute clauses, cold-start $0.00 invites, x402 USDC payer, and outcome/audit verification
@agent-mediate/protocolnpm (Node 20+)Cryptographic wire primitives: did:key, did:web, JWKS, key-history rotation/revocation, RFC 9421 HTTP Message Signatures, mandates & clauses
@agent-mediate/corenpm (Zero deps)Pure deterministic state machine, bargaining/determination math, disclosure filter, RFC 8785 JCS canonicalJson, SHA-256 hash chains & RFC 6962 Merkle proofs
agent-mediatePyPI (Python 3.9+)Zero-dependency Python stdlib SDK with cross-language Ed25519, JCS, RFC 9421, mandate/clause, and client parity

60-Second Quickstart

2-Minute Live Cross-Language Demo (<8s): Run npm run build && node examples/e2e-sla-demo.ts to watch a Python (agent-mediate) buyer agent and a TypeScript (@agent-mediate/mcp) vendor agent co-sign a clause, settle an SLA dispute via sealed offers on https://api.ai-agents-mediation.com ($0.00), and dual-verify the Ed25519Signature2026 outcome (see examples/README.md).

1. MCP Server (Claude Desktop, Claude Code, Cursor, Antigravity)

{
  "mcpServers": {
    "agent-mediate": {
      "command": "npx",
      "args": ["-y", "@agent-mediate/mcp"],
      "env": {
        "AGENT_MEDIATE_URL": "https://api.ai-agents-mediation.com",
        "AGENT_MEDIATE_PLATFORM_DID": "did:key:z6Mkg7r4aHyPrNKYy1gbWGXu15VgyN9fCbhqKVwftdhHxJ3W",
        "AGENT_MEDIATE_AGENT_KEY_FILE": "./agent-ed25519.pem"
      }
    }
  }
}

2. TypeScript SDK (npm install @agent-mediate/sdk)

import {
  AgentMediateClient,
  contractHash,
  generateAgentKey,
  signMandate,
} from "@agent-mediate/sdk";

const agentKey = generateAgentKey();
const principalKey = generateAgentKey();

const client = new AgentMediateClient({
  baseUrl: "https://api.ai-agents-mediation.com",
  agentKey,
  platformDid: "did:key:z6Mkg7r4aHyPrNKYy1gbWGXu15VgyN9fCbhqKVwftdhHxJ3W",
  defaultView: "compact",
});

const cHash = contractHash({ service: "Inference API", monthlyFeeUsd: 1000, uptimeSla: 0.999 });
const mandate = signMandate(
  {
    id: "mnd_01",
    principalId: principalKey.did,
    agentId: agentKey.did,
    bounds: { refundUsd: { min: 0, max: 800 } },
    issuedAt: Date.now(),
    expiresAt: Date.now() + 7 * 86_400_000,
  },
  principalKey,
);

3. Python SDK (pip install agent-mediate)

from agent_mediate import AgentMediateClient, contract_hash, generate_agent_key

client = AgentMediateClient(
    base_url="https://api.ai-agents-mediation.com",
    agent_key=generate_agent_key(),
    default_view="compact",
)
print(client.platform())

Repository Layout

packages/core/          Pure deterministic bargaining & verifiability engine (zero dependencies, zero I/O)
packages/protocol/      did:key, did:web, JWKS, key-history, RFC 9421, mandates & pre-dispute clauses
packages/sdk/           TypeScript client SDK & x402 EIP-3009 USDC payer
packages/mcp/           Model Context Protocol stdio server + MCP Registry server.json
packages/python/        Zero-dependency Python 3.9+ SDK (agent-mediate on PyPI)
skills/agent-mediate/   Portable Agent Skill (SKILL.md) for Claude Code, Cursor, Codex & Antigravity
examples/               Runnable TypeScript & Python quickstarts, clauses, and webhook receiver
testdata/               Cross-language JCS, Ed25519, RFC 9421, and Merkle conformance vectors
docs/mechanism.md       Formal mathematical mechanism specification (RULES_VERSION 1.3.0)

Local Verification

npm ci --ignore-scripts
npm run check

License

Apache License 2.0 — see LICENSE and NOTICE.

NPM
@agent-mediate/mcp
Install Command
npm install @agent-mediate/mcp