Polymarket Agent MCP Server provides MCP tooling for Polymarket trading, market discovery, copy trading, and backtesting. It exposes 48 MCP tools under the Model Context Protocol, with a focus on prediction markets and trading workflows. The project is associated with TypeScript/Node and related to web and blockchain integrations.
🛠️ Key Features
Trading
Market discovery
Copy trading
Backtesting
48 MCP tools
🚀 Use Cases
Discover Polymarket markets for analysis
Run copy-trading workflows
Perform historical backtesting
Support prediction-market trading agents
⚡ Developer Benefits
MCP server for Model Context Protocol
Tool set covering trading, discovery, copy trading, and backtesting
Written for TypeScript ecosystems
Includes developer-oriented categories such as websockets and blockchain
⚠️ Limitations
Limited to the scope described: Polymarket trading, discovery, copy trading, and backtesting
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
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
bash
# Flag
node dist/index.js --http
# Or set PORT (defaults to 3000)
PORT=8080 node dist/index.js
Endpoints
Path
Method
Description
/mcp
POST
MCP protocol endpoint (Streamable HTTP transport)
/health
GET
Health check — returns { status, version, db }
/.well-known/mcp/server-card.json
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:
Or build it yourself from the included Dockerfile:
bash
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
COPY_MODE
No
preview
preview (simulated) or live (real orders)
DAILY_BUDGET
No
20
Max daily spend in USDC
MIN_CONVICTION
No
3
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 clob.polymarket.com (see PERMISSIONS.md for exact names)
Single SQLite database file + .env read at startup — nothing else
Environment
API credentials (live mode only, in memory only), budget config, mode selection
Processes
None — no child processes, no shell commands, no eval/Function
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
bash
git clone https://github.com/demwick/polymarket-agent-mcp.git
cd polymarket-agent-mcp
npm install
npm run build
npm test# 200+ tests
Execution mode: 'preview' simulates trades in a local SQLite DB (default, safe for inspection); 'live' places real orders on Polymarket and requires all POLY_* credentials.
POLY_PRIVATE_KEYsecret
Polygon wallet private key used to sign CLOB orders. Required only when COPY_MODE=live. Never logged, persisted, or transmitted outside signed order bodies.
POLY_API_KEYsecret
Polymarket CLOB API key. Required only when COPY_MODE=live.
POLY_API_SECRETsecret
Polymarket CLOB API secret. Required only when COPY_MODE=live.
POLY_API_PASSPHRASEsecret
Polymarket CLOB API passphrase. Required only when COPY_MODE=live.
POLY_FUNDER_ADDRESS
Polymarket funder wallet address (proxy wallet) used for live trading.
DAILY_BUDGETdefault 20
Maximum USDC the agent may spend per day. Used by BudgetManager to cap copy-trading exposure.
MIN_CONVICTIONdefault 3
Minimum conviction score (0–100) required before a copy trade is executed.
CHAIN_IDdefault 137
EVM chain ID for Polymarket (137 = Polygon mainnet).
DB_PATH
Optional override for the SQLite database path. Defaults to a package-local file.