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/mcpspeaks 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" mcpAny 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/mcpIn 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
| Tool | What it does |
|---|---|
hushd_Read | The pool and the desk: listed tokens and deposit limits, pool counts, desk counts |
hushd_Read | Makers 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_Read | Recent deals as the chain sees them: class, maker, state and receipt |
hushd_Read | One deal's public record and receipt |
hushd_Read | Check a hushdproof1… string, as a named reader if given |
hushd_Wallet | The agent's hushd1… receive address |
hushd_Wallet | Sync, then the private balance per token |
hushd_Wallet | Its limits per payment and per day, and what it spent today |
hushd_Wallet | Its NEAR account: a policy wallet's owner, TEE rules and frozen state, or its own key |
hushd_Wallet | Testnet tokens to the agent's NEAR account |
hushd_Wallet | Move tokens from its NEAR account into its private balance |
hushd_Wallet, limited | Pay a hushd1… address privately |
hushd_Wallet, limited | Pay anyone as a claim link: whoever opens it first claims it, with no gas |
hushd_Wallet | Claim a link into its own private balance (its own link: a take back) |
hushd_Wallet | Links it paid, read from the pool: waiting, claimed or taken back |
hushd_Wallet | Take back a link it paid that nobody claimed |
hushd_Wallet, limited | Pay out to a NEAR account |
hushd_Wallet, limited | Ask the desk, match in the enclave, settle privately |
hushd_Wallet | Deals it took part in, with the terms only it can read |
hushd_Wallet | Payments it made, newest first, numbered for hushd_prove |
hushd_Wallet | A payment, funds or volume proof for one named reader |
hushd_Wallet, limited | Fetch 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 defaulthushd_send,hushd_pay_link,hushd_cash_outandhushd_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_x402pays 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_tradeneedsmin_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_limitslets 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_AGENTThe Agents page in the app does the same from a NEAR wallet or a passkey.
| Rule | Who enforces it |
|---|---|
| Contract calls only, to Hushd's contracts only | The TEE, before it signs |
| NEAR attached per call and per day, calls per hour, hours of the day | The TEE, before it signs |
| Freeze | The 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, payees | This server, before it proves or pays (the TEE does not read call arguments) |
Environment
| Variable | What it sets |
|---|---|
HUSHD_ | The agent's seed, 64 hex. Without it, the file `pnpm mcp init` wrote |
HUSHD_ | Where the seed, notes and spending ledger live (default ~/.hushd) |
HUSHD_ | Caps per payment, per token, e.g. USDC=100,wNEAR=50 |
HUSHD_ | Caps per UTC day, per token, e.g. USDC=500,wNEAR=250 |
HUSHD_ | Its OutLayer policy wallet's key (wk_…): the NEAR account for hushd_faucet and hushd_shield, signed in a TEE |
HUSHD_ | A date after which the agent may not spend at all, e.g. 2026-12-01 |
HUSHD_ | The only hushd1… addresses and NEAR accounts it may send, cash out or pay over x402 to, comma separated |
HUSHD_ | Or a NEAR testnet account with its own key, for hushd_faucet and hushd_shield |
HUSHD_ | That account's key (ed25519:…) |
HUSHD_ | testnet; mainnet once Hushd's contracts are deployed there (or with HUSHD_RPC_URL, a local node running them) |
HUSHD_ | A self-hosted Hushd API (default https://api.hushd.net) |
HUSHD_ | NEAR RPC endpoints, comma separated |
HUSHD_ | Proving artifacts on disk (found on its own inside the repo) |
HUSHD_ | Or where to fetch them (default https://hushd.net/circuits) |
HUSHD_ | The checker proof links point to (default https://hushd.net/verify) |
HUSHD_ | The 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.