AI agents
The command line and MCP server.
Both SDKs install a pmwallets command that prints JSON, for scripts and for AI agents — Claude Code, Codex, Gemini CLI, Cursor, WorkBuddy or any other that can run a command or connect to an MCP server. The agent reads each fill with its market and decimal amounts, decides, and places its own orders through the copy-trading bot’s order command. Give it the guide pmwallets skill prints.
export PMW_API_KEY=pmw_... npx pmwallets leaderboard --minWinLo 0.55 --category politics --limit 20 npx pmwallets subscribe <handle> # billed per hour npx pmwallets new-fills # fills since the previous call, each once npx pmwallets watch # live: one JSON line per fill, with its market # hand every batch of fills to an agent; it trades through pmwallets-copytrade npx pmwallets watch --batch-sec 30 --exec 'claude -p "Fills from traders I follow are on stdin. For each BUY above $1000, read the market with pmwallets-copytrade market, then buy $5 with --key <eventId> if the price is below 0.6." --allowedTools "Bash(pmwallets-copytrade:*)"'
watch --execruns the command once per batch, the fills on its stdin as JSON lines; a batch is handed over at most once, and one that fails or is interrupted is kept, never re-run.pmwallets-copytrade order buy <tokenId> --usdc 5 --key <eventId>:--usdcis a ceiling, and the same--keynever sends a second order, so an agent can retry safely. The config’smodedecides: dry-run simulates against the live book, live trades.- MCP (both tools as MCP servers):
{ "mcpServers": { "pmwallets": { "command": "npx", "args": ["-y", "pmwallets", "mcp"], "env": { "PMW_API_KEY": "pmw_..." } }, "copytrade": { "command": "npx", "args": ["-y", "pmwallets-copytrade", "mcp", "--config", "/abs/path/config.yaml"] } } }
Remote MCP, nothing to install: https://api.pmwallets.com/mcp — claude.ai and ChatGPT sign in with OAuth (the app gets a token that works on MCP only and renews itself; the connection is listed, and revocable, on API keys); other clients can send Authorization: Bearer pmw_…. https://api.pmwallets.com/mcp/public needs no account.
Platforms without a shell (Dify, Coze, n8n, GPT Actions): import openapi.json, or receive fills as signed webhooks.
What an agent can do with these tools, and what its API key can spend →