Skip to main content
Version: v0.10.13

MCP Server

The @peac/mcp-server package exposes PEAC Protocol as MCP tools. AI agents can verify receipts, inspect claims, decode tokens, issue new receipts, and create evidence bundles -- all through the standard Model Context Protocol interface.

226 tests across 22 test files

The MCP server is extensively tested. Every tool handler, error path, and security boundary has coverage.

Install

Terminal
npm install @peac/mcp-server

Quick start

Terminal
npx peac-mcp-server

The server starts on stdio transport by default, ready for any MCP client.


Tools

The MCP server exposes 5 tools in two security tiers.

Pure tools

Available immediately, no secrets required.

ToolInputOutput
peac_verifyReceipt JWS + issuer URLVerification result with 12 checks
peac_inspectReceipt JWSDecoded header, payload, metadata
peac_decodeRaw JWS stringBase64url-decoded parts

Privileged tools

Disabled by default. Require explicit capability configuration.

ToolInputOutput
peac_issueClaims + signing configSigned receipt JWS
peac_create_bundleReceipt array + issuerEvidence bundle file
Privileged tools require opt-in

Set PEAC_MCP_PRIVILEGED=true and provide signing keys to enable peac_issue and peac_create_bundle.


Usage examples

Verify a receipt

Tool call
{
"tool": "peac_verify",
"arguments": {
"receipt": "eyJhbGciOiJFZERTQSIs...",
"issuer_url": "https://api.example.com"
}
}
Response
{
"verified": true,
"checks": [
{ "id": 1, "name": "signature_valid", "passed": true },
{ "id": 2, "name": "algorithm_allowed", "passed": true },
{ "id": 3, "name": "type_header_present", "passed": true }
],
"claims": {
"iss": "https://api.example.com",
"sub": "agent:claude-123",
"peac": { "type": "api.request", "status": "executed" }
},
"_meta": {
"serverVersion": "0.10.13",
"policyHash": "sha256:abc...",
"protocolVersion": "peac-receipt/0.1"
}
}

Inspect a receipt

Tool call
{
"tool": "peac_inspect",
"arguments": {
"receipt": "eyJhbGciOiJFZERTQSIs..."
}
}

Returns the decoded header (alg, typ, kid), payload (all claims), and signature metadata without performing verification.

Issue a receipt

Tool call (privileged)
{
"tool": "peac_issue",
"arguments": {
"issuer": "https://api.example.com",
"subject": "agent:claude-123",
"type": "tool.call",
"attestation_type": "interaction",
"status": "executed"
}
}

Returns a signed JWS string ready for delivery.


Configuration

Environment variables

Environment
# Enable privileged tools
PEAC_MCP_PRIVILEGED=true

# Signing key for peac_issue
PEAC_PRIVATE_KEY=<base64url-ed25519-private-key>
PEAC_KID=peac-2026-02

# Optional: policy file path
PEAC_POLICY_PATH=/path/to/policy.json

Policy file

Fine-grained capability control:

policy.json
{
"capabilities": {
"verify": true,
"inspect": true,
"decode": true,
"issue": false,
"bundle": false
},
"issuer": {
"url": "https://api.example.com",
"kid": "peac-2026-02"
}
}

Structured outputs

Every tool response includes _meta for traceability and auditability:

{
"_meta": {
"serverVersion": "0.10.13",
"policyHash": "sha256:<canonical-hash-of-loaded-policy>",
"protocolVersion": "peac-receipt/0.1"
}
}

The policyHash is deterministic -- same policy always produces the same hash.


Security model

The MCP server is designed with defense-in-depth:

MeasureDescription
No ambient key discoveryKeys must be explicitly configured via env vars
Static policyPolicy loaded at startup, never fetched at runtime
SSRF preventionNo outbound network requests from tool handlers
Buffer growth capBounded memory allocation for all inputs
Capability-based accessPrivileged tools require explicit opt-in
Handler-transport separationCore logic is transport-neutral, tested independently

Integration with Claude Desktop

Add to your claude_desktop_config.json:

claude_desktop_config.json
{
"mcpServers": {
"peac": {
"command": "npx",
"args": ["peac-mcp-server"],
"env": {
"PEAC_MCP_PRIVILEGED": "false"
}
}
}
}

Once configured, Claude can verify any PEAC receipt you paste into the conversation.


Next steps