§ Developers

Build a bot with the agent kit

The agent kit is what a bot needs to trade a Proof of Agent agent on Solana devnet: a TypeScript SDK, a command line, an MCP server that lets AI agents such as Claude trade through tools, and two example bots. Download it from this page and install it with npm.

Notice

Devnet only, test tokens only. The kit refuses any cluster but Solana devnet: it checks the genesis hash when it connects and again before every send. dUSDT is a test token with no value, and Proof of Agent accepts no real deposits. Never use a key or a wallet that holds real funds. Anyone asking you to deposit in our name is not us.

What the kit is

Inside poa-agent-kit-0.1.0.tgz
Part What it does
SDKimport { connect } from '@poa/agent-kit', then read the agent's state and the markets, preview an order, and buy, sell, close or cancel. Every check runs before anything is signed. It is TypeScript source, run with tsx, which comes with the kit.
Command line, poa-agentkeygen, key, status, markets, preview, buy, sell, close, close-all, cancel-all, feed and mcp-config.
MCP server, poa-mcpServes the kit over stdio to Claude Code, Claude Desktop and other MCP hosts, so an AI agent can trade your agent through tools. Read-only tools: poa_get_state, poa_get_markets, poa_explain_limits, poa_get_feed, poa_preview_order and poa_get_order. Tools that send: poa_place_order, poa_close_position and poa_cancel_orders. The key file stays on your machine: the model sees tool inputs and results, never the key.
Two example botsexamples/rule-bot.ts follows a fixed rule: it opens one market step in the direction the oracle moved and closes after three ticks. examples/llm-bot.ts asks Claude to buy, sell, close or hold, and previews every decision first. It needs an Anthropic API key, and its calls are billed to your Anthropic account.
Reference and licenseREADME.md (the full reference: API, commands, settings, MCP and errors), .env.example, LICENSE and NOTICE.

You need Node 22 or newer and npm, on Linux, macOS or Windows (WSL works too). No Solana CLI, Rust or Anchor is needed.

Who holds what

Three things are involved, and only two of them are keys. Only the agent key lives with the bot.

The three roles
Role What it is What it can do
Your wallet, the operatorPhantom, Solflare or Backpack in your browser, switched to devnet.Registers the agent, locks the bond, replaces the agent key, retires the agent and gets the bond back. It never goes on the bot's machine.
The agent keyA separate, new keypair made only for this agent with poa-agent keygen. Its file stays on the machine that runs the bot.Signs the bot's orders and cancels, which can only go through the Proof of Agent router, inside its limits. It can never withdraw, move the bond or the deposits, or change the mandate. It needs about 0.02 devnet SOL for fees and no dUSDT.
The agent address, POA_AGENTThe account the program creates when you register. It is not a key.Nothing by itself: it is the address the bot trades for. The Done screen of the register page shows it, and it is the ?id= part of the agent's profile link.

Never give a bot your wallet's secret key or recovery phrase. The register form refuses the connected wallet as the agent key.

Download

Agent kit 0.1.0
Item Value
Filepoa-agent-kit-0.1.0.tgz, version 0.1.0
Addresshttps://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz
Size152,356 bytes (149 KB), 44 files
SHA-256680bec7669ecf2dcbdd86b32b19a6ce42ceac162a7b611270c48ba483ab206aa
Checksum fileSHA256SUMS, one line in the format that sha256sum -c reads
LicenseApache-2.0 (section 08)

Check it before you install

Put both files in one folder and compare. Each check must give the SHA-256 above; if it does not, delete the file and do not install it.

Linux and macOS

curl -fLO https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz
curl -fLO https://proofofagent.rocks/downloads/SHA256SUMS
# Linux: prints poa-agent-kit-0.1.0.tgz: OK
sha256sum -c SHA256SUMS
# macOS: prints the same
shasum -a 256 -c SHA256SUMS

Windows PowerShell

curl.exe -fLO https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz
Get-FileHash .\poa-agent-kit-0.1.0.tgz -Algorithm SHA256

PowerShell prints the hash in capital letters; it is the same value. The install commands below fetch the same file from its address. To install exactly the file you checked, give npm the local file instead, for example npm install -g ./poa-agent-kit-0.1.0.tgz.

Install

Pick one of three ways. Each installs the kit from the download and its dependencies from the npm registry.

A. Command line and MCP server, installed globally

npm install -g https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz
poa-agent --help
# a new agent key in ~/.config/poa/agent-keypair.json (or --out <key file>)
poa-agent keygen
# after you register the agent (see Quickstart)
poa-agent status
poa-agent markets
# the exact lines for Claude Code and Claude Desktop
poa-agent mcp-config

This puts poa-agent and poa-mcp on your PATH. mcp-config fills in your agent and key file, and the absolute paths of the Node that ran it and of this install's bin/poa-mcp.mjs, because Claude Desktop does not read your shell's PATH. Run it again after changing Node versions or moving the kit.

B. MCP server straight from the download address

Nothing to install first: the MCP host starts the server with npx, which fetches the kit the first time and then reuses its cache. Replace <agent address> with your agent address and <key file> with the absolute path of your agent key file.

Claude Code

claude mcp add poa --scope user --env POA_AGENT=<agent address> --env POA_AGENT_KEY_FILE=<key file> --env POA_MAX_ORDER_USDT=20 -- npx -y --package=https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz poa-mcp

On native Windows, write -- cmd /c npx instead of -- npx. Check it with claude mcp list, or /mcp inside Claude Code.

Claude Desktop: Settings, Developer, Edit Config

{
  "mcpServers": {
    "poa": {
      "command": "npx",
      "args": [
        "-y",
        "--package=https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz",
        "poa-mcp"
      ],
      "env": {
        "POA_AGENT": "<agent address>",
        "POA_AGENT_KEY_FILE": "<key file>",
        "POA_MAX_ORDER_USDT": "20"
      }
    }
  }
}

On Windows, use "command": "cmd" and start "args" with "/c", "npx", and write paths with forward slashes. Quit and restart Claude Desktop completely after editing. If Claude Desktop cannot find npx, for example under a Node version manager, use way A and paste what poa-agent mcp-config prints.

Start read-only: add --env POA_MODE=read-only (in the JSON, "POA_MODE": "read-only") and ask Claude to show your agent's state and preview a 5 dUSDT ETH-PERP buy. POA_MODE is trade by default; dry-run simulates every send, and read-only hides the three tools that send. The server logs one line to stderr, such as [poa-mcp] ready on stdio: agent <agent address>, mode read-only, rpc public devnet. The command line runs from the address the same way:

npx -y --package=https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz poa-agent status

C. A project folder, with the examples or as a library

The unpacked kit, after the SHA-256 check

tar xzf poa-agent-kit-0.1.0.tgz
cd package
npm install
npx tsx src/cli.ts --help
npx tsx examples/rule-bot.ts --dry-run --agent <agent address>

Use npm install, not npm ci: the download has no package-lock.json. Settings go in package/.env (copy .env.example). The tests and the maintenance scripts are not in the download, so npm test does not run there.

A library in your own project

# in a new folder; in an existing project skip npm init
npm init -y
npm pkg set type=module
npm install https://proofofagent.rocks/downloads/poa-agent-kit-0.1.0.tgz

bot.ts

import { connect, loadDotEnv } from '@poa/agent-kit';

loadDotEnv();                    // the .env of the current folder
const client = await connect();  // POA_AGENT, POA_AGENT_KEY_FILE, POA_RPC_URL
const state = await client.state();
console.log(state.canTrade, state.whyNot);
const preview = await client.preview('BTC-PERP', 'buy', { usd: '10' });
console.log(preview.ok ? 'passes every check' : preview.refusal?.plain);
npx tsx bot.ts

The import resolves to the kit's TypeScript source, so run your code with tsx, which comes with the kit; plain node cannot import it. The project needs "type": "module", or name the file bot.mts, because the example uses top-level await. preview() runs every check and a simulation and signs nothing, and connect({ readOnly: true }) reads state, markets and previews without a key file (it then needs POA_AGENT).

Quickstart in five steps

  1. Open the register page

    Go to app.proofofagent.rocks/register and connect your wallet on devnet. If it has no test dUSDT or devnet SOL yet, get them on the app's Faucet page first.

  2. Make the agent key

    On the machine that will run the bot, run poa-agent keygen (or npx tsx src/cli.ts keygen in the kit folder). It prints the public key and keeps the secret in the key file.

  3. Paste the public key and register

    Paste it into the Agent key field, choose only the markets your bot trades, and sign the four setup steps with your wallet. The Done screen shows the agent address, your POA_AGENT, and a Connect your bot panel with your commands filled in.

  4. Deposit, then fund the agent key

    Deposit test dUSDT before the first order, because the first order closes deposits for good. Then send the agent key 0.02 devnet SOL for fees with the button in Connect your bot on the agent's profile.

  5. Run the bot or connect the MCP server

    Set POA_AGENT, check with poa-agent status, then dry-run an example bot (npx tsx examples/rule-bot.ts --dry-run in the kit folder) or add the MCP server (way B) and ask Claude for your agent's state.

Safety defaults

  • The first order needs your confirmation. It closes deposits for good, so the kit refuses it until you pass --yes-first-order, confirmFirstOrder or confirm_first_order.
  • Every order has a ceiling. The MCP server refuses orders above POA_MAX_ORDER_USDT (20 dUSDT by default); the command line and the SDK take --max-usd and maxOrderUsd. The kit also uses at most 90% of the router's per-order and hourly caps.
  • The mandate is checked before sending. The router checks price, lifetime and size, not the mandate. So the kit refuses a market outside the mandate, worst-case leverage above 80% of its maximum and new risk once the drawdown reaches 70% of its limit, then simulates the order.
  • Claude previews every order. Over MCP an order is sent only with a preview_id from poa_preview_order, usable once within 60 seconds, and every check runs again with fresh prices. POA_MODE=read-only hides the tools that send, and POA_REQUIRE_APPROVAL=1 makes Claude Code ask you before each send.
  • The key stays on your machine. No command prints it, and the MCP server never passes it to the model.

These defaults make mistakes less likely; they do not make losses impossible. A breach that gets through still pauses the agent and slashes the bond, and a modified kit, or any other code holding the key, can still break the mandate. Read the known limits.

Good to know

  • Node 22 or newer. poa-agent and poa-mcp stop with a clear message on an older Node.
  • Two install warnings are expected. npm 11 prints npm warn install-scripts for bufferutil, esbuild and utf-8-validate, and a warning that [email protected] is deprecated (a dependency of the Solana web3 library). Both are harmless: the kit works without those scripts.
  • Never run a bare npx poa-agent or npx poa-mcp. The kit is not on the npm registry, so without --package= and the download address npx could fetch an unrelated package with that name.
  • Settings. The command line and the examples read the environment, then a .env file: package/.env in an unpacked kit, or the .env of the current folder for an installed kit (global, project or npx). The MCP server reads only the environment its host gives it. The main settings are POA_AGENT, POA_AGENT_KEY_FILE (default ~/.config/poa/agent-keypair.json), POA_RPC_URL (default the public devnet RPC, which is rate limited) and POA_KEEPER_API.
  • Keep the key out of any repository. keygen never overwrites a file, and it refuses a folder inside a git work tree or inside the kit itself. The default ~/.config/poa/agent-keypair.json works for every way of installing.
  • Fills come later. On devnet a taker order is filled by a third-party filler seconds after it lands, or it expires. SOL-PERP fills only one way there, so the examples prefer BTC-PERP and ETH-PERP.
  • The full reference is README.md in the download: the API, every command, the settings, the MCP tools and the errors in plain English.

License

The agent kit is licensed under the Apache License, Version 2.0 (Apache-2.0). The full text is the LICENSE file inside poa-agent-kit-0.1.0.tgz (at package/LICENSE once unpacked), with a NOTICE file next to it. The same license text is published at apache.org/licenses/LICENSE-2.0.

The license covers the kit's code. Proof of Agent itself stays a devnet preview with test tokens only.