mcpField
C
Cloaked Agent

Cloaked Agent

Local
cloakedagent.comFinance1Updated 34w ago

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

  1. 01On-chain per-transaction and total limits
  2. 02Balance and spending-status checks
  3. 03SOL and USDC payments
  4. 04Automatic x402 payments
  5. 05Optional ZK privacy proofs

Use cases

  1. 01Checking an agent account's available balance
  2. 02Sending capped SOL or USDC payments
  3. 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.

mcp.json · Universal config
{
"mcpServers": {
"cloakedagent-cloaked": {
"command": "npx",
"args": [
"-y",
"@cloakedagent/sdk"
],
"env": {
"CLOAKED_AGENT_KEY": "<CLOAKED_AGENT_KEY>",
"CLOAKED_BACKEND_URL": "<CLOAKED_BACKEND_URL>",
"SOLANA_RPC_URL": "<SOLANA_RPC_URL>"
}
}
}
}
Run commandnpx -y @cloakedagent/sdk
Environment variables to set
CLOAKED_AGENT_KEYSecretBase58 encoded Cloaked Agent private key
CLOAKED_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.

Packages
npm@cloakedagent/sdk0.2.0

Tools

4

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
agent_keystringNoCloaked 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 balance
  • cloak_status - Get spending limits and constraints
  • cloak_pay - Send SOL or USDC to destination
  • cloak_x402_fetch - Fetch x402-protected resources with auto-payment

License

MIT

Comments

Markdown supported

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.