Overview
The Cashmere Agent SDK (@cashmerelabs/cashmere-agent-sdk) turns cross-chain USDC transfers into a standard AI agent tool. Any framework that supports function calling or tool use can integrate Cashmere bridging in minutes.
What agents can do:
- Simulate a transfer to preview fees, duration, and route viability without executing
- Execute a transfer across 17 chains (EVM, Solana, Aptos, Sui)
- Query supported routes and CCTP versions programmatically
MCP Server
The SDK package includes an MCP server, so Claude Desktop, Claude Code, Hermes Agent and other MCP clients can quote and send transfers as tools. It runs over stdio withnpx -y @cashmerelabs/[email protected] and needs Node.js 22 or later. Keep the version pinned: the process holds your keys, so it should run exactly the release you chose.
The same server has the Goat LP tools as well; see Goat LP tools.
- Claude Desktop
- Claude Code
- Hermes Agent
Add the server to For quotes only, replace the key with
claude_desktop_config.json (Settings → Developer → Edit Config) and restart Claude Desktop. The file is in ~/Library/Application Support/Claude/ on macOS and %APPDATA%\Claude\ on Windows."CASHMERE_MCP_READ_ONLY": "1".Environment
The server reads its settings from the environment only, and only underCASHMERE_ names. Claude Code passes your shell environment to MCP servers, so a key exported there for other tools, such as an EVM_PRIVATE_KEY, never becomes a wallet the agent can spend from.
Paste each key as the wallet exports it: hex for EVM wallets such as MetaMask; base58 for Phantom or Solflare, or
solana-keygen’s JSON array; hex or ed25519-priv-0x... for Aptos wallets such as Petra; suiprivkey1... for Slush or Sui Wallet, or hex.
The server guards cashmere_bridge in several ways:
- It is listed only when a private key is set and
CASHMERE_MCP_READ_ONLYis not. - Its description tells the agent to confirm the amount, the chains and the recipient with the user before calling it, and not to retry a failed call on its own.
- It is annotated as destructive. In Claude Code it always needs the user’s own approval, never a one-tap one.
- Before signing, it refuses:
- a recipient that is not in the destination chain’s address format. CCTP takes any 32 bytes as the recipient, so an EVM address sent to Sui or Aptos would otherwise mint to an account nobody controls;
- a Gas API quote for another destination, or with a fee or deadline out of bounds;
- an amount above
CASHMERE_MCP_MAX_AMOUNTor pastCASHMERE_MCP_MAX_TOTAL, or a recipient outsideCASHMERE_MCP_ALLOWED_RECIPIENTS; - a transfer identical to one from the last 10 minutes, unless the agent passes
allowDuplicateafter asking the user; - a call that the client cancelled or timed out while it waited.
- It sends one transfer at a time and reports success only once the transaction is confirmed. Its errors never contain a private key.
Goat LP Tools
From 0.4.0 the MCP server also has tools for Goat LP: Uniswap v3 and v4 liquidity on Robinhood Chain (chain 4663), with the auto-compound, auto-range and auto-exit automations. They need no extra setup: the same server and the samenpx command as above.
The read tools are always on. The write tools are listed only when
CASHMERE_EVM_PRIVATE_KEY is set and
CASHMERE_MCP_READ_ONLY is not. They are annotated as destructive, so Claude Code always asks for the user’s own approval,
and they share cashmere_bridge’s queue: one write at a time from the wallet.
Plan, then execute
Called withoutexecute, a write tool sends nothing. It returns a plan and a planId: every transaction and signed
message in order, with contract names and addresses, amounts or settings, fees, and the result of simulating it. The agent
shows the plan to the user and waits for an explicit yes. Only then does it call the same tool with the same inputs plus
execute: true and the planId. A plan is single use and lasts 10 minutes. At execute the tool builds the plan again from
fresh chain reads and sends nothing if it has changed.
When a plan asks for an acknowledgement, for example a pool price more than 1% away from Chainlink, the agent asks the
user and plans again with acknowledge: true.
What the tools check
- The chain is Robinhood Chain (4663), checked again right before anything is signed.
- Every contract the tools send to, or give a permission to, matches the code hash pinned in the SDK, and the Uniswap position managers point at the pinned PoolManager and factory. None of the Goat LP contracts is upgradeable, and their source is published on the explorer.
- Each transaction is decoded and simulated right before it is signed. A revert refuses it, and the amounts must match the plan.
- A signed message for v4 auto-compound is checked before signing: only for
GoatAutoCompoundV4, for a position the wallet owns, at most 30 runs at a time and at most 90 days. - Never a permission for all positions, an unlimited token or Permit2 allowance, a transfer of a position, an output to anyone but the wallet, or an owner, guardian or keeper function. No swaps. Another app’s approval on a position is left alone.
- Automations only where the app offers them: listed pairs, reviewed hooks, and the keeper’s size limit per pair. A
refusal gives the app’s reason. Nothing is turned on while that list cannot be read from
api.cashmere.exchange; a stop still works. - Deposits: Uniswap v3 pools and v4 pools without a hook; no token that copies an official stock ticker or takes a fee when it moves; the pool price within 5% of Chainlink where both tokens have a feed; balances that cover the deposit.
Fees
Auto-compound takes 10% of the fees it adds back, and Cashmere pays the gas. Auto-range takes 0.15% of the amount moved per move, and auto-exit 0.15% once, when it closes. On Uniswap v4, auto-compound needs no permission on the position: the wallet signs one message per run, which costs no gas. See Fees.Settings
Both caps value a deposit with the API’s token prices and refuse it when a price is missing. The Claude Code plugin asks
for these as optional settings. The tools read
api.cashmere.exchange the way the app does,
with the honest User-Agent: cashmere-agent-sdk/<version>, within its per-minute limits.
Not in this version
- Deposits into Uniswap v4 pools that have a hook are refused; use the app for those.
- Allow for all positions is not available to agents.
Agent Skill
The SDK repository ships an agent skill,cashmere-usdc-transfers, that teaches an agent to run USDC payments and transfers with the MCP tools. The agent collects the amount, the chains and the recipient, checks the address format, quotes the transfer and confirms it with the user. Only then does it send, and it reports the result. The skill also covers fees, speed and what to do when a transfer fails. It follows the Agent Skills format.
From 0.4.0 a second skill,
goat-lp, does the same for the Goat LP tools: it finds pools and positions, plans a deposit or an automation, shows the plan, and executes it only after the user confirms. Install it the same way, from the skills/goat-lp folder; on Hermes Agent, hermes skills install cashmere-prod/cashmere-agent-sdk/skills/goat-lp. The Claude Code plugin includes both skills.
Install
Requires Node.js 22 or later.Quick Setup
Simulate Before Execute
Usesimulate() to let the agent preview costs before committing funds:
estimatedFee.cashmere is Cashmere’s fixed fee: in the source chain’s smallest native unit with the default feeMode: 'native', or like '0.19 USDC' with 'stable', taken from the amount. Cashmere’s contracts can also take a percentage of the amount, capped at 1%. It is 0 on every chain today, so the quote doesn’t include it. On V2 Fast, Circle keeps up to circleBurnBps basis points when minting, so the recipient gets slightly less than amount.
This calls the Gas API and Circle Iris to fetch real-time fee data without submitting any transaction.
Framework Integration
- OpenAI Assistants
- LangChain
- crewAI
- Hermes
- Custom Framework
Import the JSON tool schemas and pass them directly to the OpenAI API:The schemas define three tools:
Tool Schemas Reference
cashmere_bridge
Executes a cross-chain USDC transfer. Its description tells the agent to confirm the amount, the chains and the recipient with the user before every call.
Returns:
{ txHash, explorerUrl, version, from, to }
cashmere_simulate
Previews a transfer without executing.
Returns:
{ supported, version, estimatedDuration, estimatedFee: { cashmere, circleBurnBps } }
cashmere_supported_routes
Lists routes, grouped by source chain. Read-only. The JSON schema is exported as supportedRoutesToolSchema, and getSupportedRoutes() returns the same data in code.
Returns:
{ routes: [{ from, destinations, versions, defaultVersion, estimatedDuration }] }, where versions are the CCTP versions the SDK sends those routes over and estimatedDuration maps each version to a duration.
Supported Chains
Every chain can send to every other over CCTP V2, and the SDK sends every route over V2. The V1 column shows what the contracts still accept; Circle is retiring V1 burns.SKILL.md (Agent Context)
The SDK ships with aSKILL.md file that provides comprehensive context for AI agents. Load it to give your agent detailed knowledge about Cashmere CCTP:
- All contract addresses and program IDs (public, on-chain data)
- Fee calculation formulas and gas API integration
- Per-chain transfer patterns and ABI details
- CCTP version routing rules and estimated durations
Security
- Keys come from environment variables or your own secret store, and are used only for in-memory signing
- The MCP server reads keys from its environment only, removes them from its environment once read, never logs them, and redacts them from tool errors
- The library never writes to the console; the MCP server prints one status line to stderr, without keys
- Every contract address in the SDK is public on-chain data
.env.exampleships with empty values: never commit.env
Next Steps
- Smart Contracts — per-chain contract details and ABI reference
- Backend APIs — Gas API and monitoring endpoints
- Contract Addresses — deployed addresses for all 17 chains
- GitHub — source code and issues