agent-trade
Enables trading on Polymarket prediction markets settled on Polygon, using a Polygon wallet private key and derived CLOB API credentials to search markets, read order books and recent trades, place and cancel buy/sell orders, and check positions.
Enables trading pre-market OTC tokens on Whales Market over Solana, with a Solana agent wallet, configurable Solana RPC, wallet status/balances, token price charts, market stats and upcoming token listings.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-trade find Bitcoin above 100k by July and buy 10 YES shares"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-trade
MCP server for AI agent trading β any agent, any venue.
Give your AI agent the ability to trade across prediction markets, pre-markets, and DEXs through a single Model Context Protocol server.
Features
π Multi-venue β One MCP server, multiple trading venues
π€ Agent Mode β Auto-sign trades with a dedicated wallet
π€ User Mode β Preview trades, sign manually
π‘οΈ Safety built-in β Spend limits, price sanity checks, persistent tracking
π Multi-chain β Solana, Polygon, 20+ EVM chains
π Read-only works instantly β No API keys needed for market data
Related MCP server: forge-agent-gate
Supported Venues
Venue | Type | Read | Trade | Chain |
Prediction Market | β | β | Polygon | |
Pre-market OTC | β | β | Solana, 20+ EVM |
Quick Start
With Claude Desktop / Cursor
Add to your MCP config:
{
"mcpServers": {
"agent-trade": {
"command": "npx",
"args": ["-y", "agent-trade"],
"env": {}
}
}
}That's it β market data works immediately with zero config.
With Claude Code
claude mcp add agent-trade -- npx -y agent-tradeWith OpenClaw
mcporter add agent-trade --command "npx -y agent-trade"Tools
Universal Tools (all venues)
Tool | Description |
| List available trading venues and their status |
| Search markets across venues |
| Get detailed market info |
| Get order book (bids/asks) |
| Get recent trades |
| Place a buy/sell order |
| Cancel an open order |
| Get portfolio positions |
| Get open orders |
| Check wallet balance and spend limits |
| Generate or configure wallet |
Polymarket Tools
Tool | Description |
| List market categories/tags |
| Get event with all markets by slug |
| Derive API credentials (one-time) |
Whales Market Tools
Tool | Description |
| Token price chart data |
| Market statistics & overview |
| Wallet info by address |
| Upcoming token listings |
Configuration
Environment Variables
Global
Variable | Description | Default |
| Enabled venues (comma-separated) | All available |
| Wallet type: |
|
| Agent wallet private key | β |
| Max spend per transaction (USD) |
|
| Max daily spend (USD) |
|
| Custom Solana RPC URL | Public RPC |
| Custom EVM RPC URL | Public RPC |
| Enable HTTP transport on this port | β (stdio) |
| HTTP bind address |
|
Polymarket
Variable | Description | Required |
| Polygon wallet private key | For trading |
| Derived API key | For trading |
| Derived API secret | For trading |
| Derived API passphrase | For trading |
Read-only mode needs zero config. Set
PM_PRIVATE_KEYto enable trading. Usepm_derive_api_keytool to generate API credentials.
Whales Market
Variable | Description | Required |
| API base URL | No (defaults to mainnet) |
| Auth token for private endpoints | For portfolio |
Trading Modes
User Mode (default)
Agent previews the trade, you sign and execute manually:
You: "Buy 10 YES shares on 'Bitcoin above 100k by July?'"
Agent: "Preview: Buy 10 YES @ $0.62 = $6.20 total. Confirm?"Agent Mode
Agent signs and executes trades autonomously with a dedicated wallet:
You: "Find underpriced markets and buy"
Agent: [executes trade on-chain] "Bought 10 YES @ $0.62, tx: 0x..."Safety features:
Per-transaction spend limit (default $50)
Daily spend limit (default $200)
Price sanity checks against market data
Persistent spend tracking across restarts
Private key never exposed in responses
Architecture
βββββββββββββββββββββββββββββββ
β AI Agent (Claude, etc) β
β MCP Client β
ββββββββββββ¬βββββββββββββββββββ
β MCP Protocol
ββββββββββββΌβββββββββββββββββββ
β agent-trade β
β Universal MCP Tools β
β βββββββββββ βββββββββββββ β
β β Wallet β β Safety β β
β β Manager β β (Spend β β
β β β β Tracker) β β
β ββββββ¬βββββ βββββββ¬ββββββ β
β β Adapter β β
β β Registry β β
β ββββββΌβββββ βββββββΌββββββ β
β βPolymar- β β Whales β β
β β ket β β Market β β
β β Gamma + β β API + β β
β β CLOB β β Solana + β β
β β β β EVM β β
β βββββββββββ βββββββββββββ β
ββββββββββββββββββββββββββββββββAdding New Venues
agent-trade uses an adapter pattern. To add a new venue:
Create
src/adapters/your-venue/index.tsimplementingTradingAdapterRegister in
src/registry.tsThat's it β universal tools work automatically
import { TradingAdapter, Market, TradeIntent, TradeResult } from '../adapter.js';
export class YourVenueAdapter implements TradingAdapter {
name = 'your-venue';
displayName = 'Your Venue';
isConfigured(): boolean { return true; }
async searchMarkets(params): Promise<Market[]> { /* ... */ }
async trade(intent: TradeIntent): Promise<TradeResult> { /* ... */ }
// ... implement remaining methods
}Development
git clone https://github.com/bigbearman/agent-trade.git
cd agent-trade
npm install
npm run build
npm run dev # watch modeTest with MCP Inspector
npm run inspectLicense
MIT
Available Tools
24 toolscancelC
Cancel an open order/offer.
Inputs: order_id (required), venue, chain_id.
get_marketC
Get detailed information about a specific market/token.
Inputs: market_id (required), venue.
get_order_bookB
Get the order book for a market: bids, asks, spread.
Inputs: market_id (required), depth, venue.
get_ordersC
Get open orders for your wallet or a specific address.
Inputs: venue, address.
get_positionsC
Get portfolio/positions for your wallet or a specific address.
Inputs: venue, address.
get_recent_tradesB
Get recent trades for a market or across all markets.
Inputs: limit, venue, market_id.
list_venuesA
List all available and configured trading venues.
Inputs: no named parameters.
pm_derive_api_keyA
Derive Polymarket API credentials from your private key (one-time setup). Requires PM_PRIVATE_KEY.
Inputs: no named parameters.
pm_get_eventA
Get a full Polymarket event with all its markets by slug
Inputs: slug.
pm_list_tagsB
List available Polymarket tags/categories for filtering markets
Inputs: no named parameters.
pm_price_historyB
Get price history for a Polymarket market. Returns time series data for trend analysis.
Inputs: slug, fidelity, interval.
search_marketsB
Search and list markets across trading venues. Filter by venue, category, name/symbol.
Inputs: page, take, venue, search, +5 more.
setup_walletB
Wallet setup guide. Check config, generate a new agent wallet, or show setup instructions.
Inputs: action, wallet_type.
tradeB
Create a buy/sell order. Agent mode: validates limits, signs, and executes. User mode: returns preview.
Inputs: side (required), price (required), amount (required), market_id (required), +2 more.
wallet_statusB
Get wallet configuration, balance, and spend limits.
Inputs: no named parameters.
wm_cancel_orderA
Cancel an unfilled order on Whales Market (settleCancelled on-chain)
Inputs: symbol, dry_run, chain_id, order_id.
wm_check_offer_statusB
Check the status of an offer on Whales Market
Inputs: offer_id.
wm_get_leaderboardC
Get Whales Market referral leaderboard and live stats
Inputs: page, take.
wm_get_market_statsB
Get Whales Market overall statistics and volume data
Inputs: no named parameters.
wm_get_networksA
List supported blockchain networks on Whales Market
Inputs: no named parameters.
wm_get_token_chartB
Get historical price chart data for a Whales Market token
Inputs: to, from, token_id, resolution.
wm_get_upcoming_tokensB
Get upcoming tokens on Whales Market
Inputs: no named parameters.
wm_get_wallet_infoC
Get Whales Market wallet info, tier, discount for an address
Inputs: address.
wm_react_to_offerC
Accept/fill an existing offer on Whales Market (agent mode only)
Inputs: amount, symbol, dry_run, chain_id, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 24 tools
Most tools target recognizable resources, but there is real overlap between generic and venue-specific operations. In particular, cancel vs wm_cancel_order, get_market vs venue-specific market/token tools, and wallet_status vs wm_get_wallet_info require careful reading to choose correctly.
Names are consistently snake_case and mostly follow a verb_noun or prefix_verb_noun pattern, with wm_ and pm_ prefixes clearly marking venue-specific tools. Minor deviations like bare cancel/trade and noun-style wallet_status keep it from being fully uniform.
At 24 tools the surface is heavy and verges on overloaded. The count is somewhat justified because the server spans generic trading plus Whales Market and Polymarket-specific operations, but there is still visible duplication across categories.
Core market, order, position, wallet, and basic trading workflows are covered, and Whales Market has useful offer support. However, gaps remain around personal trade history/order status, order modification, funds movement, and Polymarket-specific trading lifecycle operations beyond market data and API setup.
Maintenance
Related MCP Connectors
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Let an agent trade from your Syndicate bot on Hyperliquid, Polymarket and spot, within your limits.
AI prediction market trading β real-time data, CLOB exchange, Prop Desk, 40+ tools
Sports prediction markets for AI agents β live prices, quotes, orders, and positions.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceTrade and monitor prediction markets across Polymarket, Kalshi, Opinion, Limitless, and PredictFun from any AI agent. Unified real-time data, live orderbook streaming, and order execution β one API key, one interface, five exchanges.-
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to execute prediction-market trades through a risk-control gateway that enforces signed mandates and generates proof trails for accountability.0MIT
- AlicenseBqualityDmaintenanceEnables AI agents to trade Solana prediction markets, including market creation, betting, claims, and affiliate management, all without exposing private keys.7699 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 tools, real-time WebSocket monitoring, and enterprise-grade safety features.MIT