Skip to content
06 / 12

Agents and MCP

Give an agent a private balance and a seat at the desk. It pays, trades and proves through MCP, and never spends past the limits you set.

Local
Own seed, all tools
Hosted
hushd.net/mcp, read-only
Transport
stdio, Streamable HTTP

Two ways to connect

  • Locally, with the agent's own seed. The server runs next to the agent, over stdio. It holds the agent's keys, proves every payment in its own process, and refuses anything over its limits. This is how an agent pays, trades and proves.
  • Hosted, read-only. https://hushd.net/mcp speaks Streamable HTTP and runs only the read tools. It holds no keys and cannot move anything.

Run it locally

From a checkout of the repo:

pnpm install
pnpm mcp init   # writes a new agent seed to ~/.hushd/seed (mode 600)

# Claude Code: the agent's own wallet, inside its limits
claude mcp add hushd \
  -e HUSHD_LIMIT_PER_PAYMENT="USDC=100,wNEAR=50" \
  -e HUSHD_LIMIT_PER_DAY="USDC=500,wNEAR=250" \
  -- pnpm --silent --dir "$PWD" mcp

Any other MCP client takes the same command:

{
  "mcpServers": {
    "hushd": {
      "command": "pnpm",
      "args": ["--silent", "--dir", "/path/to/hushd", "mcp"],
      "env": {
        "HUSHD_LIMIT_PER_PAYMENT": "USDC=100,wNEAR=50",
        "HUSHD_LIMIT_PER_DAY": "USDC=500,wNEAR=250"
      }
    }
  }
}

The server is the @hushd/mcp package in the repo (packages/mcp), which is not published on npm, so it runs from a checkout of the repo. With no seed it starts anyway and serves the read tools only. To fund the agent, give it a policy wallet (or a NEAR account with its own key) and use hushd_faucet then hushd_shield, or pay its hushd1 address from your own private balance.

The hosted, read-only server

claude mcp add --transport http hushd-read https://hushd.net/mcp

In a client that takes a URL, add https://hushd.net/mcp as a Streamable HTTP server. It is stateless and answers the five read tools below, against NEAR testnet.

Tools

ToolWhat it does
hushd_statusReadThe pool and the desk: listed tokens and deposit limits, pool counts, desk counts
hushd_makersReadMakers taking requests now: name, pricing style, bond, deals, slashed amount, its recent record (settled, lapsed, lapse rate) and whether a request asks it (paused accounts with include_inactive)
hushd_desk_dealsReadRecent deals as the chain sees them: class, maker, state and receipt
hushd_dealReadOne deal's public record and receipt
hushd_verify_proofReadCheck a hushdproof1… string, as a named reader if given
hushd_addressWalletThe agent's hushd1… receive address
hushd_balanceWalletSync, then the private balance per token
hushd_limitsWalletIts limits per payment and per day, and what it spent today
hushd_policyWalletIts NEAR account: a policy wallet's owner, TEE rules and frozen state, or its own key
hushd_faucetWalletTestnet tokens to the agent's NEAR account
hushd_shieldWalletMove tokens from its NEAR account into its private balance
hushd_sendWallet, limitedPay a hushd1… address privately
hushd_pay_linkWallet, limitedPay anyone as a claim link: whoever opens it first claims it, with no gas
hushd_claim_linkWalletClaim a link into its own private balance (its own link: a take back)
hushd_my_linksWalletLinks it paid, read from the pool: waiting, claimed or taken back
hushd_take_back_linkWalletTake back a link it paid that nobody claimed
hushd_cash_outWallet, limitedPay out to a NEAR account
hushd_tradeWallet, limitedAsk the desk, match in the enclave, settle privately
hushd_my_dealsWalletDeals it took part in, with the terms only it can read
hushd_my_paymentsWalletPayments it made, newest first, numbered for hushd_prove
hushd_proveWalletA payment, funds or volume proof for one named reader
hushd_pay_x402Wallet, limitedFetch a URL and pay its private 402, inside the limits

hushd_trade takes the package kind, what to sell and how much, what to buy, a min_receive above zero (the least it accepts, sealed to the enclave) and a quote window of 10 to 300 seconds. It returns the deal, the maker and what was given and received. hushd_prove takes a reader and a validity of 1 to 90 days, and returns the proof with a link to check it.

To pay a counterparty who is not on Hushd yet, hushd_pay_link takes a token and an amount and returns a claim link (https://hushd.net/app/claim#…). Hand it over privately: whoever opens it claims the payment into their own private balance with a passkey or a NEAR wallet, and needs no gas. If nobody claims it, hushd_take_back_link returns the amount. An agent paid with a link claims it with hushd_claim_link.

Spending limits

Every token the agent may spend needs two caps, in the token's own units: one per payment and one per UTC day. A token with no limit set cannot be spent at all.

HUSHD_LIMIT_PER_PAYMENT="USDC=100,wNEAR=50,BTC=0.002"   # the default
HUSHD_LIMIT_PER_DAY="USDC=500,wNEAR=250,BTC=0.01"       # the default
  • hushd_send, hushd_pay_link, hushd_cash_out and hushd_trade (for the amount sold) check both caps before anything is proved, and record what was spent once it is.
  • Anyone holding a link can claim it, so an agent with a payee list (HUSHD_ALLOW_TO) may not pay as a link at all.
  • hushd_pay_x402 pays a 402 only up to the smaller of the per-payment cap and what is left of today's; a higher price is refused, not paid. Like a send, it stops at the end date, and with a payee list it pays only a 402 whose hushd1… address is on it.
  • hushd_trade needs min_receive, the least the agent accepts, above zero. Anyone can register as a maker, so the floor is what keeps a fill fair.
  • What was spent today is kept in a file under HUSHD_HOME, so restarting the server does not reset the day.
  • hushd_limits lets the agent read its own limits, so it can plan inside them.

These limits are the only guard on the private balance, and they run in the MCP process beside the agent. The relayer sends whatever was proved and knows nothing of them. The seed sits on the same machine, so anything that can read it, an agent with shell or file access included, can spend the whole balance without asking the server. Keep in the balance only what you would let the agent lose.

Policy wallets

An agent does not need a NEAR key. Its NEAR account can be an OutLayer policy wallet: the key is made and kept inside OutLayer's TEE, the agent holds only an API key, and the enclave checks the owner's policy before it signs anything. The owner stores the policy on chain from their own account (on outlayer.testnet), which makes them its only controller, and can freeze the wallet with one transaction. The desk's three makers and the demo agent work this way.

# the owner: a wallet, its policy stored from the owner's account, funded for gas
pnpm --filter @hushd/services policy-wallet create MY_AGENT --per-tx 0.02 --daily 0.2 --per-hour 60
# the agent: only the wallet's key
claude mcp add hushd -e HUSHD_POLICY_WALLET_KEY=wk_… -e HUSHD_LIMIT_PER_DAY="USDC=500" -- pnpm --silent --dir "$PWD" mcp
# the owner, at any time
pnpm --filter @hushd/services policy-wallet freeze MY_AGENT

The Agents page in the app does the same from a NEAR wallet or a passkey.

RuleWho enforces it
Contract calls only, to Hushd's contracts onlyThe TEE, before it signs
NEAR attached per call and per day, calls per hour, hours of the dayThe TEE, before it signs
FreezeThe TEE reads it on chain for every signature; this server also stops every private payment while it is set
Token amounts per payment and per day, expiry, payeesThis server, before it proves or pays (the TEE does not read call arguments)

Environment

VariableWhat it sets
HUSHD_SEEDThe agent's seed, 64 hex. Without it, the file `pnpm mcp init` wrote
HUSHD_HOMEWhere the seed, notes and spending ledger live (default ~/.hushd)
HUSHD_LIMIT_PER_PAYMENTCaps per payment, per token, e.g. USDC=100,wNEAR=50
HUSHD_LIMIT_PER_DAYCaps per UTC day, per token, e.g. USDC=500,wNEAR=250
HUSHD_POLICY_WALLET_KEYIts OutLayer policy wallet's key (wk_…): the NEAR account for hushd_faucet and hushd_shield, signed in a TEE
HUSHD_LIMITS_EXPIREA date after which the agent may not spend at all, e.g. 2026-12-01
HUSHD_ALLOW_TOThe only hushd1… addresses and NEAR accounts it may send, cash out or pay over x402 to, comma separated
HUSHD_NEAR_ACCOUNTOr a NEAR testnet account with its own key, for hushd_faucet and hushd_shield
HUSHD_NEAR_PRIVATE_KEYThat account's key (ed25519:…)
HUSHD_NETWORKtestnet; mainnet once Hushd's contracts are deployed there (or with HUSHD_RPC_URL, a local node running them)
HUSHD_API_URLA self-hosted Hushd API (default https://api.hushd.net)
HUSHD_RPC_URLNEAR RPC endpoints, comma separated
HUSHD_CIRCUITS_DIRProving artifacts on disk (found on its own inside the repo)
HUSHD_CIRCUITS_URLOr where to fetch them (default https://hushd.net/circuits)
HUSHD_VERIFY_URLThe checker proof links point to (default https://hushd.net/verify)
HUSHD_APP_URLThe app claim links open in, as <origin>/app/claim#… (default https://hushd.net)

What stays on the agent's machine

  • The seed, which spends the agent's private balance. Keep it secret.
  • Its notes, in a file encrypted with AES-256-GCM under a key from the seed, so the file alone reveals nothing.
  • Every proof, made in the server's own process. The model sees results, never keys or notes.

Every note the agent makes for itself is also posted to the board, encrypted to it, so the seed alone recovers its balance on another machine.

For coding agents

The repo carries an AGENTS.md and an agent skill at skills/hushd/SKILL.md, and the site has llms.txt. Agents that pay for HTTP resources should also read private x402.