About Cloaked Agent
Cloaked Agent is an SDK and MCP server for giving AI agents limited spending accounts on Solana without sharing wallet keys. Its tools check balances and limits, send SOL or USDC, and make automatic x402 payments.
Key features
- 01On-chain per-transaction and total limits
- 02Balance and spending-status checks
- 03SOL and USDC payments
- 04Automatic x402 payments
- 05Optional ZK privacy proofs
Use cases
- 01Checking an agent account's available balance
- 02Sending capped SOL or USDC payments
- 03Fetching x402-protected resources with payment
MCP support
The MCP server exposes tools to check balance and spending constraints, send SOL or USDC, and fetch x402-protected resources with automatic payment.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y @cloakedagent/sdkCLOAKED_AGENT_KEYSecretBase58 encoded Cloaked Agent private keyCLOAKED_BACKEND_URLBackend relay URL (default: https://api.cloakedagent.com)SOLANA_RPC_URLSecretSolana RPC endpoint URL (default: https://api.devnet.solana.com)Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
4Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| agent_key | string | No | Cloaked Agent key (optional, uses env CLOAKED_AGENT_KEY if not provided) |
Details
From the project README@cloakedagent/sdk
Trustless spending accounts for AI agents on Solana
Give AI agents spending power without giving them your wallet keys. On-chain enforced limits they literally cannot bypass.
Documentation · Website · GitHub
Installation
npm install @cloakedagent/sdk
Quick Start
For AI Agents (MCP)
Add to your Claude Desktop or MCP-compatible client:
{
"mcpServers": {
"cloaked": {
"command": "npx",
"args": ["@cloakedagent/sdk/mcp"],
"env": {
"CLOAKED_AGENT_KEY": "your-agent-key-here"
}
}
}
}
For Developers
import { CloakedAgent } from "@cloakedagent/sdk";
// Load agent from key
const agent = new CloakedAgent(agentKey, rpcUrl);
// Check balance
const balance = await agent.getBalance();
// Spend within limits
await agent.spend({
destination: recipientPubkey,
amount: 100_000_000 // 0.1 SOL in lamports
});
// Spend USDC
await agent.spendToken({
destination: recipientPubkey,
mint: USDC_MINT,
amount: 5_000_000 // 5 USDC
});
Features
- On-chain constraints - Per-tx, daily, and total limits enforced by Solana program
- MCP integration - Works with Claude and other AI agents via Model Context Protocol
- x402 support - Automatic payment for pay-per-use APIs
- USDC support - Send USDC with per-token spending constraints
- Privacy mode - Optional ZK proofs to hide wallet-agent link
API
CloakedAgent
// Create from agent key
const agent = new CloakedAgent(agentKey: string, rpcUrl: string);
// Properties
agent.publicKey // Agent's public key
agent.vaultPda // Vault address (holds funds)
agent.agentStatePda // State account address
// Methods
await agent.getBalance() // Get vault balance in lamports
await agent.getStatus() // Get full status with constraints
await agent.spend({ destination, amount }) // Spend SOL
await agent.spendToken({ destination, mint, amount }) // Spend USDC
await agent.getTokenBalance(mint) // Get token balance
await agent.enableToken(owner, mint, constraints) // Enable USDC
MCP Tools
When running as MCP server, provides these tools:
cloak_balance- Check available balancecloak_status- Get spending limits and constraintscloak_pay- Send SOL or USDC to destinationcloak_x402_fetch- Fetch x402-protected resources with auto-payment
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.