Skip to content

Repository files navigation

CAPP — Casper Agent Permission Protocol

The open standard for granting AI agents scoped, revocable on-chain authority on Casper — powered by the native add_associated_key primitive. No smart contracts. No trusted intermediaries. No Gnosis Safe.

Casper Agentic Buildathon 2026 submission

🌐 Live: capp-protocol.vercel.app 📦 SDK: npmjs.com/package/casper-agent-permissions 🔌 MCP: npmjs.com/package/capp-mcp-server 💻 GitHub: github.com/codeswithroh/capp


The Problem

Every AI agent framework hits the same wall: how do you give an agent permission to act on a user's behalf without giving it full account control?

  • Ethereum requires a Gnosis Safe — a complex multi-sig contract, $100–$500 per delegation
  • Solana has no native standard — every protocol invents its own, zero composability
  • Every chain treats this as an application-layer problem and pushes it onto developers

The result: bespoke trust arrangements everywhere, no standard, no on-chain enforcement.


The Solution

Casper already solved this at the protocol level. Casper's add_associated_key is a native system call that adds a secondary signing key with a bounded weight:

agent key weight:    1
deploy threshold:    3   →  agent cannot sign alone, ever
key management thr:  3   →  agent cannot modify account keys

One transaction. Enforced by every Casper validator. Zero extra contracts.

CAPP formalizes this primitive into a composable permission layer for AI agents — with an SDK, a CLI, an MCP server, and a reference application.


Architecture

┌──────────────────────────────────────────────────────┐
│              Application Layer (Reference App)        │
│    Task marketplace — agents bid & execute work       │
│             using CAPP-scoped permissions             │
├──────────────────────────────────────────────────────┤
│                  Protocol SDK Layer                   │
│         casper-agent-permissions (npm)                │
│          grant · verify · revoke · audit              │
├──────────────────────────────────────────────────────┤
│               On-Chain Registry Layer                 │
│          AgentRegistry.wasm on Casper Testnet         │
│         add_associated_key (native protocol call)     │
└──────────────────────────────────────────────────────┘

npm Packages

casper-agent-permissions — Core SDK

npm install casper-agent-permissions

Full permission lifecycle — grant, verify, revoke, audit. Ships with the capp CLI binary. Built on casper-js-sdk v5. CJS + ESM + DTS.

import { CasperAgentPermissions } from "casper-agent-permissions";

const capp = new CasperAgentPermissions({ network: "casper-test" });

// Grant a scoped mandate to an AI agent
const { deployHash } = await capp.grant({
  ownerPublicKey: "01abc...",
  agentPublicKey: "01def...",
  maxCsprMotes: "5000000000",  // spending cap
  keyWeight: 1,                // always below deploy threshold
  expiresIn: 86400,            // 24h TTL
});

// Verify
const grant = await capp.verify(deployHash);

// Revoke — atomically removes the associated key
await capp.revoke({ ownerPublicKey: "01abc...", agentPublicKey: "01def..." });

// Full audit log
const history = await capp.audit();

📦 npmjs.com/package/casper-agent-permissions


capp-mcp-server — Model Context Protocol Server

npm install -g capp-mcp-server

Exposes CAPP operations as native MCP tools — connect to Claude Desktop and manage on-chain agent permissions through conversation. First blockchain protocol with MCP-native permission management.

Tools exposed:

Tool Description
capp_grant Grant a scoped on-chain mandate to an AI agent
capp_verify Verify that a grant is currently active
capp_revoke Revoke an agent's permission atomically
capp_audit Return the full permission ledger for an account
capp_list_agents List all agents in the registry

Claude Desktop setup — add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "capp": {
      "command": "capp-mcp-server",
      "env": {
        "CAPP_NETWORK": "casper-test",
        "CAPP_NODE_URL": "https://node.testnet.cspr.cloud/rpc"
      }
    }
  }
}

📦 npmjs.com/package/capp-mcp-server


CLI

The capp CLI ships inside casper-agent-permissions:

# Grant a permission
CAPP_SIGNER=<private-key> capp grant \
  --agent 01def... \
  --max-cspr 5000 \
  --weight 1 \
  --expires 86400

# Verify
capp verify --deploy-hash abc123...

# Revoke
capp revoke --agent 01def...

# Audit log
capp audit

Reference Application

A live AI agent task marketplace built entirely on CAPP permissions. Every bid, execution, and deliverable flows through the permission protocol — not the platform.

capp-protocol.vercel.app

Pages

Route Description
/ Landing — protocol overview, architecture, live stats
/playground Interactive CAPP lifecycle — Configure → Grant → Verify → Revoke (no wallet needed)
/tasks Live task marketplace — AI agents bid autonomously
/tasks/new Post a task with CSPR budget
/tasks/[id] Task detail, bid list, live execution log
/agents Agent registry — on-chain keys, reputation scores
/mcp MCP Server showcase — Claude Desktop integration guide
/protocol Full protocol specification and key weight model

What makes it different

  • Agent keys are real Casper keypairs — every bid and deliverable is signed by the agent's own ed25519 key, not the platform's
  • Cryptographic provenance — verify any work submission with any ed25519 library, no RPC call needed
  • Playground needs no wallet — judges can try the full CAPP lifecycle instantly in-browser
  • Autonomous bidding — agents run on Claude (claude-sonnet-4-6) with tool use, scoped by their CAPP mandate

Why Casper

Chain Agent Delegation Cost Composable?
Ethereum Gnosis Safe (multi-sig contract) $100–$500/setup No standard
Solana None — app-specific Varies No
Casper add_associated_key — native protocol call ~$0.01 Yes

Tech Stack

Layer Tech
Frontend Next.js 16 App Router + TypeScript
Wallet CSPR.click Web SDK
Blockchain Casper Network (Testnet) — add_associated_key / remove_associated_key
Casper SDK casper-js-sdk v5 (RpcClient, HttpHandler, PublicKey)
AI (bidding) Claude claude-sonnet-4-6 with tool use
MCP @modelcontextprotocol/sdk v1.29.0, stdio transport
Package build tsup — CJS + ESM + DTS
Deploy Vercel

Local Development

# Install dependencies
npm install

# Create env file
cp .env.example .env.local
# Add: ANTHROPIC_API_KEY, CSPR_CLOUD_API_KEY

# Run dev server
npm run dev

Open http://localhost:3000.

Packages (standalone npm packages)

# SDK
cd packages/casper-agent-permissions
npm install
npm run build

# MCP server
cd packages/capp-mcp-server
npm install
npm run build

Repository Structure

/
├── src/
│   ├── app/                  # Next.js App Router pages
│   │   ├── page.tsx          # Landing
│   │   ├── playground/       # Interactive CAPP demo
│   │   ├── tasks/            # Task marketplace
│   │   ├── agents/           # Agent registry
│   │   ├── mcp/              # MCP Server showcase
│   │   └── protocol/         # Protocol spec
│   ├── lib/
│   │   ├── casper-agent-permissions/  # In-app SDK (mirrors npm package)
│   │   └── casper/           # Transaction builders, key registry
│   ├── components/           # UI components
│   ├── providers/            # CSPR.click, wallet context
│   └── store/                # Zustand state
├── packages/
│   ├── casper-agent-permissions/  # Published npm SDK + CLI
│   └── capp-mcp-server/           # Published MCP server
└── public/
    └── capp-logo.png         # 1024×1024 logo

License

MIT

About

AI Agent Task Marketplace on Casper Network — Casper Agentic Buildathon 2026

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages