polymarket-agent-mcp — Claude Code MCP server: features and setup
Connect an AI agent to Polymarket market research, trading, and portfolio tools. Use it to review markets, track traders, or manage positions.
claude mcp add --env COPY_MODE=<COPY_MODE> --env POLY_PRIVATE_KEY=<POLY_PRIVATE_KEY> --env POLY_API_KEY=<POLY_API_KEY> --env POLY_API_SECRET=<POLY_API_SECRET> --env POLY_API_PASSPHRASE=<POLY_API_PASSPHRASE> --transport stdio polymarket-agent-mcp -- npx -y polymarket-agent-mcpWhat polymarket-agent-mcp does
The server exposes 48 tools for finding markets and traders, comparing prices, reviewing positions, and spotting gaps between YES and NO prices. It can place or cancel orders, maintain a trader watchlist, and simulate copying a trader based on past trades.
Portfolio tools cover balances, positions, risk checks, and stop-loss or take-profit levels. The server also supports automatic copy trading and a switch from preview to live mode. Set POLY_PRIVATE_KEY, POLY_API_KEY, POLY_API_SECRET, and POLY_API_PASSPHRASE before connecting; the second Claude Code setup command also takes COPY_MODE. Live orders affect the trading account, so check the mode and safety limits before placing one.
What it helps with
- find Polymarket markets by topic
- compare prices and quality across markets
- assess a trader before copying their trades
- review portfolio risk and set exit levels
- spot price gaps between YES and NO
Example prompts for the agent
- Find Polymarket markets about Bitcoin and compare their prices.
- Assess this trader and simulate copying their past trades.
- Review my portfolio risk and set a stop-loss for this position.
How to install polymarket-agent-mcp
Platform CLI
claude mcp add --env COPY_MODE=<COPY_MODE> --env POLY_PRIVATE_KEY=<POLY_PRIVATE_KEY> --env POLY_API_KEY=<POLY_API_KEY> --env POLY_API_SECRET=<POLY_API_SECRET> --env POLY_API_PASSPHRASE=<POLY_API_PASSPHRASE> --transport stdio polymarket-agent-mcp -- npx -y polymarket-agent-mcpReplace <…> with your own values. 5 more environment variables are in the server README
Platform CLI
codex mcp add polymarket-agent-mcp --env COPY_MODE=<COPY_MODE> --env POLY_PRIVATE_KEY=<POLY_PRIVATE_KEY> --env POLY_API_KEY=<POLY_API_KEY> --env POLY_API_SECRET=<POLY_API_SECRET> --env POLY_API_PASSPHRASE=<POLY_API_PASSPHRASE> -- npx -y polymarket-agent-mcpReplace <…> with your own values. 5 more environment variables are in the server README
Config file
{
"mcpServers": {
"polymarket-agent-mcp": {
"command": "npx",
"args": [
"-y",
"polymarket-agent-mcp"
],
"env": {
"COPY_MODE": "<COPY_MODE>",
"POLY_PRIVATE_KEY": "<POLY_PRIVATE_KEY>",
"POLY_API_KEY": "<POLY_API_KEY>",
"POLY_API_SECRET": "<POLY_API_SECRET>",
"POLY_API_PASSPHRASE": "<POLY_API_PASSPHRASE>"
}
}
}
}Replace <…> with your own values. 5 more environment variables are in the server README
Config file
{
"servers": {
"polymarket-agent-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"polymarket-agent-mcp"
],
"env": {
"COPY_MODE": "<COPY_MODE>",
"POLY_PRIVATE_KEY": "<POLY_PRIVATE_KEY>",
"POLY_API_KEY": "<POLY_API_KEY>",
"POLY_API_SECRET": "<POLY_API_SECRET>",
"POLY_API_PASSPHRASE": "<POLY_API_PASSPHRASE>"
}
}
}
}Replace <…> with your own values. 5 more environment variables are in the server README
Platform CLI
gemini mcp add -e COPY_MODE=<COPY_MODE> -e POLY_PRIVATE_KEY=<POLY_PRIVATE_KEY> -e POLY_API_KEY=<POLY_API_KEY> -e POLY_API_SECRET=<POLY_API_SECRET> -e POLY_API_PASSPHRASE=<POLY_API_PASSPHRASE> polymarket-agent-mcp npx -y polymarket-agent-mcpReplace <…> with your own values. 5 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about polymarket-agent-mcp
How do I install polymarket-agent-mcp in Claude Code?
Run `claude mcp add polymarket-agent-mcp -e POLY_PRIVATE_KEY=<POLY_PRIVATE_KEY> -e POLY_API_KEY=<POLY_API_KEY> -e POLY_API_SECRET=<POLY_API_SECRET> -e POLY_API_PASSPHRASE=<POLY_API_PASSPHRASE> -- npx -y polymarket-agent-mcp`.
What does polymarket-agent-mcp do?
It gives an AI client tools to find and analyze Polymarket markets, place trades, manage a portfolio, and copy traders. The server provides 48 tools.
What credentials does the Claude Code setup need?
The install command uses POLY_PRIVATE_KEY, POLY_API_KEY, POLY_API_SECRET, and POLY_API_PASSPHRASE. The alternate Claude Code command also accepts COPY_MODE.