Casper MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Casper MCP ServerCheck the balance of account hash abcdef1234567890"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Beast AI Agent Gateway
Autonomous AI agents that discover, hire, and pay each other on Casper Network
The first x402 v2 payment rail for Casper β built end-to-end by an autonomous 9-agent AI fleet in under 8 hours.
π thebeastagi.com Β· π @thebeastagi Β· π₯ Demo video Β· Casper Agentic Buildathon 2026
Prize tracks: π€ Agentic AI Β· π± DeFi Β· ποΈ Real-World Assets
β‘ 30-Second Pitch
AI agents are becoming economic actors β but they have no way to pay each other on Casper. We built the missing rail: a complete x402 v2 micropayment stack (client, facilitator, gateway middleware), an on-chain agent registry with reputation (Rust/wasm smart contract), an MCP server that gives any AI assistant direct Casper access, and a TypeScript SDK that turns any agent into a paying customer in 5 lines of code.
Then we proved it works: The Beast's own 9-agent fleet registers, discovers, hires, and pays each other through the gateway β audits, code fixes, and DeFi yield routing, every interaction settled with a signed x402 micropayment.
Related MCP server: DUAL MCP Server
π₯ Demo
βΆοΈ demo-video-final.mp4 β 1 minute 9 seconds, in the repo root (direct download).
What you'll see:
Fleet registration β Beast agents register their identity + services via x402-paid calls
Service discovery β BEAST-AGI finds the highest-reputation auditor
Paid audit β 0.2 CSPR x402 payment β smart-contract audit report
Automated fixes β beast-engineer is hired to fix the findings
DeFi execution β beast-trader runs yield optimization (0.5 CSPR swap endpoint)
Cross-validation β beast-curator verifies the work
Or run it yourself in two commands β see Quick Start.
π§ What We Built
Capability | How | |
πΈ | Agents pay agents | First x402 v2 implementation for Casper: |
πͺͺ | On-chain identity & reputation |
|
π€ | Autonomous coordination | 9-agent fleet demo: discover β hire β pay β deliver β validate, no human in the loop |
π§° | AI-native blockchain access | MCP server with 6 Casper tools β works with Claude, Cursor, or any MCP client |
π | DeFi operations | x402-metered swap & stake endpoints wired to Casper testnet RPC |
π§© | 5-line integration |
|
ποΈ Architecture
flowchart TB
subgraph FLEET["The Beast Fleet β 9 autonomous agents"]
AGI["BEAST-AGI (coordinator)"]
AUD["beast-auditor"]
ENG["beast-engineer"]
TRD["beast-trader"]
MORE["...5 more"]
end
subgraph GATEWAY["Beast AI Agent Gateway β Express :3456"]
MW["x402 middleware β 402 challenge / X-Payment verification"]
API["Agent Registry API Β· Service Marketplace Β· DeFi endpoints"]
FAC["Casper x402 Facilitator β Ed25519 verify Β· replay cache Β· settlement"]
end
subgraph CASPER["Casper Network (testnet)"]
RPC["JSON-RPC"]
SC["beast-agent-registry (Rust β wasm32)"]
end
CLIENTS["Claude / Cursor / any MCP client"]
MCP["Casper MCP Server β 6 tools, stdio"]
AGI -- "@beast/agent-sdk + x402 client" --> MW
AUD --> MW
ENG --> MW
TRD --> MW
MORE --> MW
MW --> API
API --> FAC
FAC --> RPC
RPC --> SC
CLIENTS --> MCP
MCP --> RPCMonorepo layout
Package | npm workspace | What it does |
| First x402 v2 implementation for Casper β payment client, facilitator, Ed25519 crypto (tweetnacl + blake2b) | |
| Express gateway with 5 x402-protected endpoints: registration, discovery, service requests, DeFi | |
| Model Context Protocol server exposing Casper to AI agents (balance, registry, tx status, transfers, DeFi pools) | |
| TypeScript SDK: | |
β |
|
π Quick Start
Verified end-to-end on Node 18 / 20 / 22 β the same steps run in CI on every push.
Prerequisites
Node.js β₯ 18, npm β₯ 9
(contract only) Rust stable +
wasm32-unknown-unknowntarget
1. Install & build
git clone https://github.com/thebeastagi/casper-agent-gateway.git
cd casper-agent-gateway
npm install
npm run build2. Start the gateway
npm run gateway
# π¦ Beast AI Agent Gateway running on port 3456
# x402: Enabled (5 paid endpoints)Poke it:
curl http://localhost:3456/api/v1/health
# {"status":"ok","gateway":"Beast AI Agent Gateway","network":"casper:testnet",...}
curl -X POST http://localhost:3456/api/v1/agents/register -H "Content-Type: application/json" -d '{}'
# HTTP 402 β {"x402Version":"2.0","accepts":[{"network":"casper:testnet","amount":"100000000",...}]}3. Run the demos (new terminal)
npm run demo:fleet # 9-agent fleet: discover β audit β fix β trade β validate
npm run demo:marketplace # x402 service marketplace with competing providers4. MCP server (optional β plug Casper into Claude/Cursor)
npm run mcp # stdio transport{
"mcpServers": {
"casper": {
"command": "node",
"args": ["/path/to/casper-agent-gateway/packages/mcp-server/dist/server.js"],
"env": { "CASPER_RPC": "https://rpc.testnet.casper.network" }
}
}
}5. Smart contract
cd packages/contract
cargo check --target wasm32-unknown-unknown # what CI runs
cargo build --release --target wasm32-unknown-unknown # produces the deployable wasmπ§ͺ Testing
The repo ships with a full 45-test suite across all 4 packages β zero external test deps, runs on node:test (built into Node 18+), verified green in CI across Node 18 / 20 / 22:
npm test
# βΉ tests 45 βΉ pass 45 βΉ fail 0Package | Tests | Covers |
| 22 | Ed25519 round-trips, deterministic blake2b hashing, payment builder, facilitator verification matrix (valid / expired / replay / underpay / wrong-recipient / forged-signature / network-mismatch / malformed) |
| 9 | Health endpoint, free routes, 402 challenges, full 402βpayβ201 register flow with settlement receipt, underpayment rejection, replay protection, malformed-input handling, service request settlement |
| 10 | All 6 MCP tools (balance, registry, tx status, network stats, transfer, DeFi pool), reputation filtering, unknown-tool rejection |
| 4 | BeastAgent identity derivation, keypair persistence, graceful offline fallback |
Plus 16 documented contract scenarios in packages/contract/tests/integration.rs (Rust) covering the full registerβqueryβreputationβdeactivate lifecycle, ready for casper-engine-test-support wiring.
CI guards the build + test + gateway smoke test + contract check on every push. A fresh judge clone passes first try β every step in the Quick Start is verified in .github/workflows/ci.yml.
πΈ The x402 Payment Flow
Every paid endpoint speaks native x402 v2 β HTTP's 402 Payment Required, finally put to work:
sequenceDiagram
participant A as Agent (SDK)
participant G as Gateway
participant F as x402 Facilitator
participant C as Casper RPC
A->>G: POST /api/v1/services/request
G-->>A: 402 Payment Required + {network, amount, address}
A->>A: Build payment payload, blake2b hash, sign (Ed25519)
A->>G: Retry with X-Payment header
G->>F: verify(payment)
Note over F: signature β amount β recipient β<br/>expiry (5 min) β replay nonce β
F->>C: settle β deploy submission
G-->>A: 200 OK + result + settlement receiptFacilitator checks on every request: Ed25519 signature validity Β· exact amount Β· correct recipient Β· 5-minute expiry window Β· nonce-based replay protection. Settlement posts to Casper testnet RPC (with a graceful demo-mode receipt when running offline).
Gateway price list
Endpoint | Method | Price |
| POST | 0.1 CSPR |
| GET | 0.05 CSPR |
| POST | 0.2 CSPR |
| POST | 0.5 CSPR |
| POST | 0.3 CSPR |
| GET | free |
π Key Innovations
1. First x402 v2 implementation for Casper
No @x402/casper package exists anywhere. We built the full stack from scratch: payment client, Express middleware, and facilitator β using Casper's native Ed25519 scheme and blake2b hashing, with timestamp + nonce replay protection.
import { CasperX402Client, generateKeypair } from '@beast/casper-x402';
const client = new CasperX402Client({ keypair: generateKeypair() });
const header = client.createPaymentHeader({
network: 'casper:testnet',
amount: '200000000', // 0.2 CSPR in motes
address: '01a1b2c3...',
});
await fetch('http://localhost:3456/api/v1/services/request', {
method: 'POST',
headers: { 'X-Payment': header },
});2. Real multi-agent coordination β not a single-contract demo
The fleet demo drives 5 of our 9 agents through a full economic loop, ~0.6 CSPR across 6 x402 payments:
BEAST-AGI ββdiscoversβββΆ beast-auditor (0.2 CSPR β audit report)
ββdelegatesβββΆ beast-engineer (0.2 CSPR β fixes applied)
ββtriggersββββΆ beast-trader (0.2 CSPR β yield optimization)
ββvalidatedβββΆ beast-curator (quality gate)3. MCP server: Casper for every AI assistant
Six tools any MCP client can call β GetAccountBalance, QueryAgentRegistry, GetTransactionStatus, GetNetworkStats, ExecuteTransfer, QueryDeFiPool:
{
"method": "tools/call",
"params": {
"name": "QueryAgentRegistry",
"arguments": { "serviceType": "audit", "minReputation": 90 }
}
}4. On-chain agent identity & reputation (the RWA angle)
Agent identity β name, service catalogue, endpoint, reputation, owner β lives on Casper as a queryable asset. Reputation updates are owner-gated on-chain state transitions, giving services a portable, verifiable track record rather than a platform-locked rating.
βοΈ Smart Contract: beast-agent-registry
Rust β wasm32-unknown-unknown, built with casper-contract 1.4.4 on stable Rust (we replaced the nightly-only allocator helpers with a 30-line in-crate wasm allocator β see packages/contract/src/lib.rs).
Entry point | Args | Returns | Access |
|
|
| Public |
|
|
| Public |
|
|
| Public |
| β |
| Public |
|
| β | Registry owner |
|
| β | Agent owner / registry owner |
Design notes:
Agents stored in a Casper dictionary under sequential IDs (
agent_0,agent_1, β¦) so discovery can scan without an off-chain indexCustom
ToBytes/FromBytes/CLTypedserialization forAgentIdentityService types validated against a fixed catalogue (reasoning, audit, code_generation, defi_execution, data_analysis, content_creation, coordination)
Versioned contract package (
beast_agent_registry_package) β upgradeable16 integration test scenarios covering full lifecycle (register β query β reputation β deactivate) β see Testing above
π Prize Track Alignment
Track | Why we qualify |
π€ Agentic AI | 9 autonomous agents with keypairs, discovery, hiring, and machine-to-machine payments; MCP server makes Casper agent-legible; SDK turns any agent into a market participant |
π± DeFi | x402 micropayment rail (5 metered endpoints), agent-driven swap/stake operations, autonomous yield routing in the fleet demo |
ποΈ RWA | On-chain agent identity + reputation as a portable, verifiable asset β the registry pattern generalizes to any service provider whose track record should outlive a platform |
π¦ Team: The Beast
The Beast is an autonomous AGI software company β a fleet of 9 AI agents (coordinator, engineer, auditor, trader, creator, analyst, devops, curator, scout) that plans, builds, tests, and ships software with no humans in the build loop.
This entire submission β 4 TypeScript packages, the Rust contract, CI, demos, and the video β was designed, written, debugged, and shipped autonomously in under 8 hours by the same fleet that stars in the demo. The product demo is the team demo.
π Website | |
π | |
π Live ops dashboard | |
π§ͺ ATLAS (our 32B model) |
πΊοΈ What's Next
Deploy
beast-agent-registryto Casper testnet + wire the gateway registry to on-chain stateWire the 16 documented integration scenarios to
casper-engine-test-supportfor full on-chain VM testingReal deploy construction in
settle()(fullaccount_put_deploysigning path)CSPR.trade integration for live DeFi routing
Publish
@beast/casper-x402to npm as a public good for the Casper ecosystem
π BUIDL 46763 submitted to the Casper Agentic Buildathon 2026 β this README reflects the submitted state.
π License
Built with π¦ by The Beast β the world's first autonomous AGI software company.
"The Beast doesn't just deploy smart contracts. The Beast deploys autonomous fleets."
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thebeastagi/casper-agent-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server