polymarket-trader-mcp
The Polymarket Trader MCP Server provides 48 tools for trading, analyzing, and automating Polymarket prediction markets through AI, across six areas:
Market Discovery: Search by keyword, browse trending/featured markets by category, find related markets, browse event groups, detect arbitrage opportunities, and track smart money flow.
Market Analysis: AI-powered BUY/SELL/HOLD recommendations, live bid/ask/spread prices, historical OHLC data, market quality evaluation (spread, depth), side-by-side market comparison, and top position holders.
Trading & Order Management: Buy/sell outcome shares, batch orders (up to 10), stink bid limit orders, cancel open orders, view order status, and switch between preview (simulated) and live trading modes.
Copy Trading: Discover and score top traders (0–100 conviction score), manage a watchlist, auto-monitor and copy trades, backtest historical performance, rebalance the watchlist by removing underperformers, and view other traders' open positions.
Portfolio & Risk Management: View open/closed positions with P&L, check account balance and daily budget, set stop-loss/take-profit rules, scan exit conditions, close positions manually, assess portfolio risk, optimize strategy (conservative/balanced/aggressive), and manage market price alerts.
Configuration & Utilities: Full trading dashboard, trade history with filters, bot settings (daily budget, min conviction), safety guardrails (max order size, exposure cap, spread tolerance), live WebSocket price streams, and agent cycle metric logging.
Polymarket Agent MCP Server
Trade, analyze, and automate Polymarket prediction markets through AI.
The most comprehensive MCP server for Polymarket — 48 tools spanning direct trading, market discovery, smart money tracking, copy trading, backtesting, risk management, and portfolio optimization. Works with Claude Code, Cursor, or any MCP-compatible client.
Tool Overview
Category | Count | Highlights |
Discovery | 9 | Search, trending, featured, events, related markets, smart money flow |
Analysis | 8 | AI opportunity scoring, conviction rating, price history, market quality, top holders, comparison |
Trading | 8 | Buy, sell, batch orders, limit orders, order management, safety limits |
Copy Trading | 5 | Watch traders, auto-monitor, auto-rebalance, backtest |
Portfolio | 10 | Positions, P&L, balance, risk assessment, SL/TP, optimization, market alerts |
Utilities | 8 | Dashboard, config, trade history, watchlists, agent logging |
Related MCP server: Polymarket MCP Server
Quick Start
npm Install
npm install -g polymarket-agent-mcpDocker
docker compose upClaude Code Config
Add to ~/.claude/settings.json:
{
"mcpServers": {
"polymarket": {
"command": "npx",
"args": ["polymarket-agent-mcp"]
}
}
}Usage Examples
Just talk naturally to your AI assistant:
"What are the trending markets today?"
"Search for bitcoin prediction markets"
"Buy $5 on this market"
"Score this trader — should I copy them?"
"Backtest this trader with $10 per trade"
"Show smart money flow — what are the top traders buying?"
"Set stop-loss at 0.30 on my BTC position"
"Optimize my portfolio with a balanced strategy"
"Scan for arbitrage opportunities"
"Compare these two markets side by side"
All 48 Tools
Discovery
Tool | Description |
| Search markets by keyword (bitcoin, election, UFC...) |
| Find top traders by PnL and volume |
| Find markets by end date and category |
| Top markets by 24h/7d/30d volume |
| Most liquid markets by category (politics, sports, crypto...) |
| WTA tennis markets with stink bid prices |
| Smart money signals — multiple top traders buying same market |
| Find markets related to a topic or market |
| Browse all markets under an event |
Analysis
Tool | Description |
| AI-powered BUY/SELL/HOLD recommendation |
| Detailed trader profile, win rate, P&L |
| Conviction score (0-100) across 5 dimensions |
| Market quality — spread, depth, price range |
| Live bid/ask/spread prices |
| Historical prices with sparkline (1h to 1m) |
| Biggest position holders in a market |
| Side-by-side comparison of 2-5 markets |
Trading
Tool | Description |
| Buy shares on any market |
| Sell an open position |
| Execute up to 10 orders at once |
| Place limit orders at discount |
| Cancel all open orders |
| View pending limit orders |
| Check status of a specific order |
| Switch from preview to live mode |
Copy Trading
Tool | Description |
| Add/remove traders from watchlist |
| Start automatic copy trading loop |
| Stop monitoring |
| Remove underperforming traders |
| Simulate copying a trader's past trades |
Portfolio & Risk
Tool | Description |
| Account balance, budget, and P&L |
| Multi-wallet overview with P&L per trader |
| Open/closed positions |
| Manually close a position |
| Set stop-loss and take-profit levels |
| Check positions for resolution |
| Portfolio risk scoring and warnings |
| AI-powered optimization (conservative/balanced/aggressive) |
| Market watchlist with price alerts |
| Live WebSocket price subscriptions |
| Find YES+NO price discrepancies |
Configuration
Tool | Description |
| Update bot settings |
| Max order size, exposure cap, spread tolerance |
| Terminal-formatted dashboard |
| Trade history with filters |
| Show watched wallets |
| Log agent cycle for dashboard |
| View a trader's open positions |
Architecture
Claude Code / Cursor / AI Client
|
| MCP Protocol (stdio)
v
+------------------+
| MCP Server | 48 tools registered
| (index.ts) |
+--------+---------+
|
+----+----+
| |
Tools Services
| |
v v
+-------+ +------------+
| Zod | | Backtester |
| Input | | Scorer |
| Valid. | | SmartFlow |
+-------+ | Filter |
| Tracker |
| Executor |
+-----+------+
|
+-------+-------+
| | |
Data Gamma CLOB
API API APIHTTP Transport & Deployment
The server supports two transport modes:
Mode | Activation | Use case |
stdio (default) |
| Claude Code, Cursor, local MCP clients |
HTTP |
| Self-hosted Docker, private VPS, single-user remote |
Deployment model — read this first
This server is designed for single-tenant use. Each client runs its own instance with its own SQLite database (copytrader.db), watchlist, daily budget, trade history, and monitor loop. The stdio mode is the recommended path for most users — npx polymarket-agent-mcp or the Claude Code config above gives you a fully isolated, local-only instance.
⚠️ Do not expose an HTTP instance publicly. The server has no per-user isolation: watchlist, positions, budget, and the background monitor loop are shared across every client that connects. A public HTTP deployment is effectively a shared workspace, not a multi-tenant SaaS. If you enable live trading, a public endpoint can drain your Polymarket wallet from any caller. Always configure the HTTP bearer-token env var (see PERMISSIONS.md) and keep the endpoint behind a firewall, VPN, or auth proxy.
Starting in HTTP mode
# Flag
node dist/index.js --http
# Or set PORT (defaults to 3000)
PORT=8080 node dist/index.jsEndpoints
Path | Method | Description |
| POST | MCP protocol endpoint (Streamable HTTP transport) |
| GET | Health check — returns |
| GET | MCP discovery card (tools, permissions, data handling) |
| GET | Server info with version and endpoint list |
Authentication
The HTTP transport accepts an optional bearer token gated by an environment variable — the exact name is documented in PERMISSIONS.md. When set, clients must send Authorization: Bearer <token> on requests to /mcp; when unset the endpoint is open (suitable only for local or private networks).
Docker deployment
A prebuilt multi-arch image is published to GHCR on every release:
docker pull ghcr.io/demwick/polymarket-agent-mcp:1.7.0Or build it yourself from the included Dockerfile:
docker build -t polymarket-mcp .
docker run -p 3000:3000 -v mcp-data:/app/data \
-e DAILY_BUDGET=50 \
polymarket-mcp
# To require bearer-token auth on /mcp, also pass the HTTP bearer env var
# listed in PERMISSIONS.md (e.g. `-e <VAR>=my-secret-key`).DB_PATH (default /app/data/copytrader.db) controls where SQLite data is persisted — mount a volume to keep it across restarts.
Configuration
All secrets stay in memory for the lifetime of the process — they are never written to the database, logs, or disk, and are only transmitted to their designated Polymarket API endpoint over HTTPS. The complete authoritative env var list, with per-variable sensitivity and scope, lives in PERMISSIONS.md and SECURITY.md.
Variable | Required | Default | Description |
| No |
|
|
| No |
| Max daily spend in USDC |
| No |
| Min trade size to copy ($) |
Wallet signing key | Live only | - | Locally signs CLOB order payloads, never persisted (see PERMISSIONS.md for exact env var name) |
CLOB API credentials | Live only | - | API key / secret / passphrase — sent only to |
Safety Features
Configurable order size limits
Total exposure caps
Per-market position limits
Minimum liquidity requirements
Maximum spread tolerance
Stop-loss / take-profit automation
Preview mode (default) — no real money
Permissions & Capabilities
This package has a transparent, minimal footprint. Full disclosure: PERMISSIONS.md — machine-readable version in .well-known/mcp/server-card.json.
Category | Scope |
Network (outbound) | 3 Polymarket HTTPS APIs + 1 inbound-only WSS public price stream ( |
Filesystem | Single SQLite database file + |
Environment | API credentials (live mode only, in memory only), budget config, mode selection |
Processes | None — no child processes, no shell commands, no |
Telemetry | None — no analytics, no crash reports, no update checks, no third-party data flow |
WebSocket scope: The WSS connection to Polymarket is inbound-only for public price updates. No wallet, credential, or user identity is transmitted — it carries the same public feed available to any browser client.
Secrets scope: Every secret environment variable is held in memory only, never logged, never persisted, and sent to exactly one host (see SECURITY.md).
Development
git clone https://github.com/demwick/polymarket-agent-mcp.git
cd polymarket-agent-mcp
npm install
npm run build
npm test # 200+ testsLicense
MIT - see LICENSE
Available Tools
48 toolsanalysis.arbitrageA
Scan active Polymarket markets for arbitrage opportunities where YES + NO prices don't sum to $1.00. Returns markets with the price gap and potential profit percentage.
Inputs: limit, min_spread.
analysis.compareA
Compare 2-5 Polymarket markets side by side. Shows price, spread, order book depth, volume, and quality score for each market. Useful for choosing the best market to trade among similar options.
Inputs: condition_ids (required).
analysis.flowA
Scan top leaderboard traders for smart money convergence signals. Identifies markets where multiple top traders are buying the same outcome simultaneously, indicating strong conviction. Pro feature.
Inputs: top_traders, max_age_minutes, min_traders.
analysis.holdersA
View the largest position holders in a Polymarket market by condition_id. Shows wallet address, position size, and side (YES/NO). Useful for gauging smart money sentiment on a market.
Inputs: condition_id (required), limit.
analysis.opportunityA
Generate a BUY/SELL/HOLD recommendation for a Polymarket market by analyzing price, spread, price trend, and liquidity depth. Returns a score with detailed reasoning. Read-only analysis, does not place trades.
Inputs: condition_id (required).
analysis.price_historyA
Fetch historical OHLC price data for a market token over a configurable time window (1h to 1m). Returns price points with a sparkline visualization showing the price trend. Pro feature.
Inputs: token_id (required), interval.
analysis.qualityA
Evaluate market quality by checking bid/ask spread, order book depth, and price range. Returns a pass/fail with specific reasons. Use before placing trades to avoid illiquid or wide-spread markets. Pro feature.
Inputs: token_id (required), max_spread, min_depth.
config.dashboardA
Get a comprehensive dashboard showing daily budget usage, total P&L, recent trades, watchlist status, and monitor state. No parameters needed. Use this for a quick overview of your trading activity.
Inputs: no named parameters.
config.go_liveA
Switch from preview (simulated) to live trading mode where real orders are placed on Polymarket. Requires API credentials configured in environment. This action uses real money. Pro feature.
Inputs: confirm (required).
config.historyB
Retrieve past copy trades from the database with optional filters by trader address or status. Returns trade details including entry price, P&L, and market info. Pro feature.
Inputs: limit, trader, status.
config.log_cycleA
Record an AI agent's trading cycle metrics to the database for dashboard tracking and performance analysis. Stores PnL, win rate, positions, budget usage, and notes. Call this after each automated trading cycle.
Inputs: agent_name (required), strategy (required), status, positions_open, +8 more.
config.safety_limitsA
Configure trading safety guardrails: maximum order size in USDC, total exposure cap, and maximum spread tolerance. These limits are enforced on all subsequent buy/sell operations. Changes persist in the database.
Inputs: max_order_size, max_exposure, max_per_market, min_liquidity, +2 more.
config.setA
Update bot configuration at runtime. Supports daily_budget (max USDC per day) and min_conviction (minimum trade size to copy). Changes take effect immediately and persist across restarts. Pro feature.
Inputs: key (required), value (required).
markets.discoverA
Find active Polymarket prediction markets filtered by resolution deadline and category. Returns market question, price, volume, and end date. Use ending='today' for fast-resolving markets, or 'all' to browse everything.
Inputs: ending, category, min_volume, limit.
markets.eventsA
Browse Polymarket event groups to find all markets under a single event (e.g. 'US Election', 'UFC 300', 'NBA Finals'). Returns the event with all its sub-markets and their current prices.
Inputs: slug, query, limit.
markets.featuredA
List top Polymarket markets ranked by liquidity with optional category filter (politics, sports, crypto, pop-culture, business, science). Returns the most liquid and actively traded markets.
Inputs: category, limit.
markets.priceA
Get live bid/ask/spread prices from the CLOB order book for a specific market by condition_id. If no condition_id is given and show_positions is true, returns current prices for all open positions.
Inputs: condition_id, show_positions.
markets.searchA
Search Polymarket markets by keyword query. Returns matching markets with question, price, volume, and condition_id. Use the condition_id from results with buy, get_price, or analyze_opportunity.
Inputs: query (required), limit, active_only.
markets.trendingA
List trending Polymarket markets ranked by trading volume over a configurable period (24h, 7d, or 30d). Filter by category to focus on specific topics. Returns market question, price, and volume.
Inputs: period, category, limit.
markets.watchA
Manage your market watchlist: add, remove, or list watched markets with optional price alert thresholds. When a market crosses your alert price, it shows up in check_exits.
Inputs: action, condition_id, title, alert_below, +1 more.
markets.watch_priceA
Manage live WebSocket price subscriptions for real-time market updates. Subscribe to a token_id to start streaming price changes, unsubscribe to stop, or check connection status.
Inputs: action, token_id.
monitor.startA
Start a background loop that polls watched wallets for new trades and automatically copies them. Runs continuously at the specified interval until stop_monitor is called. Requires at least one wallet on the watchlist. Pro feature.
Inputs: interval_seconds.
monitor.stopA
Stop the background wallet monitoring loop started by monitor.start. Call this to end a copy-trading session, before changing bot configuration via config.set or config.safety_limits, or when switching between preview and live modes via config.go_live. Does NOT close open positions — use positions.close or positions.set_exit_rules separately to unwind trades. Idempotent: safe to call when the monitor is not running. Returns a short confirmation string. No parameters. Pro feature.
Inputs: no named parameters.
orders.batchA
Execute multiple buy/sell orders in a single call (max 10 orders). Each order specifies a condition_id, amount, optional price, and side. Returns per-order results with success/failure status.
Inputs: orders (required).
orders.buyA
Buy outcome shares on a Polymarket market. Specify condition_id, USDC amount, and optionally a limit price. Runs a market quality check before executing. In preview mode, simulates the trade. In live mode, places a real CLOB order.
Inputs: condition_id (required), amount (required), price, outcome.
orders.cancelA
Cancel ALL open/pending limit orders on Polymarket for this account in a single call. Use as an emergency stop, before changing strategy, after a sudden price move, or when unwinding positions. Not reversible — cancelled orders must be re-placed via orders.buy, wta.bid, or orders.batch. Returns the count of cancelled orders. Call orders.list first if you want to preview what will be cancelled. Only works in live mode (no-op in preview). No parameters. Pro feature.
Inputs: no named parameters.
orders.listA
List all open (pending/unfilled) limit orders currently resting on Polymarket's order book for this account. Use after placing limit orders via orders.buy or wta.bid to confirm acceptance, or before orders.cancel to preview what will be removed. Returns each order's ID, market question, side (BUY/SELL), size, limit price, and age. For deeper detail on a single order, call orders.status with its order_id. Only works in live mode (returns an empty list in preview). No parameters. Pro feature.
Inputs: no named parameters.
orders.sellA
Sell an open position by trade_id (from get_positions) or condition_id. In live mode, places a sell order on Polymarket. In preview mode, marks the position as sold in the database and calculates realized P&L.
Inputs: trade_id, condition_id, price.
orders.statusA
Check the live state of a specific Polymarket limit order by its order_id. Use after orders.buy, orders.batch, or wta.bid to track fill progress, or to verify that an orders.cancel call succeeded. Returns the order status (OPEN, FILLED, CANCELLED, or EXPIRED), filled amount, remaining size, current limit price, and the market it was placed on. Obtain the order_id from the response of the placing tool or from orders.list. Only works in live mode.
Inputs: order_id (required).
portfolio.balanceA
View account balance summary: daily budget remaining, total invested, realized and unrealized P&L. No parameters needed. Use this to check how much budget is left before placing new trades.
Inputs: no named parameters.
portfolio.getA
Get a comprehensive portfolio overview of all open copy-trading positions, grouped by the source trader they were copied from, with per-wallet subtotals, individual market names/entry prices/sizes, active stop-loss/take-profit rules, and an aggregate total P&L. Use as a daily status check, before sizing decisions via config.set, or to identify which source wallet is carrying the portfolio. Returns a grouped markdown table. Call portfolio.balance for budget-focused numbers or portfolio.risk for concentration metrics. No parameters.
Inputs: no named parameters.
portfolio.optimizeA
Analyze your open positions and generate optimization recommendations based on your chosen strategy (conservative, balanced, or aggressive). Returns SL/TP suggestions, concentration warnings, and cut/hold/take-profit actions for each position.
Inputs: strategy.
portfolio.riskA
Assess portfolio risk across 4 dimensions: position concentration, market diversification, stop-loss/take-profit coverage, and daily budget utilization. Returns a risk score with specific warnings. No parameters needed.
Inputs: no named parameters.
positions.check_exitsA
Scan all open positions for exit conditions: market resolution, stop-loss/take-profit triggers, or the original trader exiting. Updates P&L and closes positions that meet exit criteria. No parameters needed.
Inputs: no named parameters.
positions.closeA
Manually close a copy trading position by trade ID. In live mode, places a sell order on Polymarket. In preview mode, marks the position as closed in the database. Use get_positions to find the trade_id. Pro feature.
Inputs: trade_id (required), reason.
positions.listA
View your own copy trading positions filtered by status (open, closed, or all). Returns market name, entry price, current price, P&L, and exit rules for each position.
Inputs: status.
positions.set_exit_rulesA
Set stop-loss and/or take-profit price levels on an open position. When the market price crosses these levels, check_exits will automatically close the position. Use get_positions to find trade IDs. Pro feature.
Inputs: trade_id (required), stop_loss, take_profit.
traders.analyzeA
Analyze a Polymarket trader by wallet address. Returns profile stats, active positions, win rate, volume, PnL, and recent trade activity. Use before adding a trader to your watchlist to assess their quality.
Inputs: address (required).
traders.backtestA
Simulate copying a trader's historical trades to calculate hypothetical P&L. Shows what you would have earned if you had copy-traded this wallet. Use before adding a trader to your watchlist to validate their performance. Pro feature.
Inputs: address (required), copy_budget.
traders.discoverA
Fetch top traders from the Polymarket leaderboard ranked by PnL, volume, and ROI. Use this to find profitable traders worth copying. Returns trader address, PnL, volume, and win rate. Use auto_watch to add them to your watchlist directly.
Inputs: pages, period, min_volume, min_pnl, +1 more.
traders.positionsA
View another trader's current open positions on Polymarket by their wallet address. Shows market name, outcome, size, and current price. Useful for due diligence before copy trading. Pro feature.
Inputs: address (required), limit.
traders.scoreA
Calculate a conviction score (0-100) for a trader across 5 dimensions: win rate, volume, consistency, experience, and diversity. Higher scores indicate more reliable traders for copy trading. Pro feature.
Inputs: address (required).
watchlist.addA
Add or remove an Ethereum wallet address from the copy trading watchlist. Watched wallets are monitored for new trades when the monitor is running. Use discover_traders first to find good wallets to watch.
Inputs: address (required), alias, action.
watchlist.listA
Show every wallet address currently on the copy-trading watchlist, with its alias, date added, and active/paused status. Use to review who is being copied before calling monitor.start, after watchlist.rebalance to confirm removals, or to pick a target for traders.analyze, traders.positions, or traders.score. Returns a markdown table of watched wallets. Call watchlist.add to manage entries, or traders.discover to find new wallets to watch. No parameters.
Inputs: no named parameters.
watchlist.rebalanceA
Analyze all traders on your watchlist and remove underperformers whose conviction score or win rate falls below your threshold. Use to keep your watchlist focused on high-quality traders. Pro feature.
Inputs: min_score, min_win_rate, dry_run.
wta.bidA
Place limit orders (stink bids) at a discount on WTA tennis match favorites. Orders sit in the order book until filled at your target price. In preview mode, simulates the orders. In live mode, places real CLOB orders. Pro feature.
Inputs: discount_pct, bet_size.
wta.discoverA
Find today's WTA tennis match markets on Polymarket where the favorite is available at a discount. Returns matches with current price vs fair price and the discount percentage. Use place_stink_bid to act on these opportunities. Pro feature.
Inputs: discount_pct.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 48 tools
Tools are grouped by domain (analysis, markets, orders, etc.) and each has a clearly described purpose. However, some market discovery tools (search, discover, featured, trending) have overlapping functionality that could confuse an agent, though parameters help differentiate.
All tools follow a consistent 'category.tool_name' pattern with lowercase and underscores. The naming is uniform and predictable, making it easy for an agent to infer usage.
48 tools is high, but the server aims to cover a comprehensive trading platform including analysis, market data, order execution, portfolio management, and copy trading. While each tool earns its place, the sheer number could be overwhelming for agents.
The tool set covers the full lifecycle of trading on Polymarket: market discovery, price analysis, trading (buy/sell/batch), portfolio management, risk analysis, copy trading setup, and monitoring. No obvious gaps are present for the intended domain.
Maintenance
Related MCP Connectors
Polymarket trader analytics for AI agents: rank wallets, read trader metrics, backtest strategies.
Polymarket + Hyperliquid + macro for AI agents. 38 tools, signal backtest, SSE streaming. Free tier.
Polymarket wallet intelligence for AI agents: scored wallets, insider signals, whale flow.
Polymarket in your AI: market rules, real fill costs, who is trading, top traders. Read-only.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with the PolyMarket API to fetch prediction market data such as market information, prices, and historical data, with robust error handling and rate limit management.4144MIT
- AlicenseBqualityBmaintenanceEnables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools including market discovery, real-time monitoring, portfolio management, and AI-powered trading recommendations with enterprise-grade safety features.25745MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools covering market discovery, analysis, trading execution, portfolio management, and real-time monitoring with enterprise-grade safety features.MIT
- AlicenseAqualityDmaintenancePrediction market probability oracle for AI agents. 26 tools across 500+ live markets from Kalshi and Polymarket. Cross-source arbitrage detection, structured TPF signals, Kelly Criterion sizing, agent performance tracking, and webhook alerts.986 npm1MIT