Polymarket MCP Server
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., "@Polymarket MCP Servershow me active markets with high volume"
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.
Polymarket MCP Server
MCP (Model Context Protocol) server that exposes Polymarket prediction markets via CLI wrapper.
Enables AI agents to discover markets, check prices, and place trades programmatically.
Features
Read-Only Tools (No Wallet Required)
markets_search— Search markets by keywordmarkets_get— Get specific market detailsmarkets_list— List markets with filters (active, volume, etc.)clob_price— Get current price for token IDclob_midpoint— Get midpoint priceclob_book— Get order book depthprice_history— Historical prices (1m, 1h, 1d, etc.)
Authenticated Tools (Requires Wallet)
create_order— Place limit order (buy/sell at specified price)market_order— Place market order (buy/sell at current price)cancel_order— Cancel existing orderpositions— Get portfolio positionsbalance— Get wallet balance (USDC/conditional tokens)
Related MCP server: pmxt-mcp
Installation
Prerequisites
Install Polymarket CLI:
brew tap Polymarket/polymarket-cli https://github.com/Polymarket/polymarket-cli brew install polymarketVerify CLI works:
polymarket markets list --limit 3
Install MCP Server
cd polymarket-mcp
npm install
npm run buildConfiguration
Environment Variables
Create .env file (see .env.example):
# Required for authenticated operations (trading)
POLYMARKET_PRIVATE_KEY=0x...
# Optional
CHAIN_ID=137 # Polygon mainnet
SIGNATURE_TYPE=proxy # proxy | eoa | gnosis-safe
POLYGON_RPC_URL=https://polygon-rpc.comMCP Client Config
Add to your MCP client config (e.g., Claude Desktop, mcporter, Polygent):
{
"mcpServers": {
"polymarket": {
"command": "node",
"args": ["/path/to/polymarket-mcp/dist/index.js"],
"env": {
"POLYMARKET_PRIVATE_KEY": "0x...",
"CHAIN_ID": "137",
"SIGNATURE_TYPE": "proxy"
}
}
}
}Usage Examples
Browse Markets
// Search for Bitcoin markets
markets_search({ query: "bitcoin", limit: 5 })
// Get specific market
markets_get({ market_id: "will-btc-hit-100k" })
// List active markets sorted by volume
markets_list({ active: true, order: "volume_num", limit: 10 })Check Prices
// Get buy price
clob_price({ token_id: "0xABC...", side: "buy" })
// Get midpoint (average of bid/ask)
clob_midpoint({ token_id: "0xABC..." })
// Get full order book
clob_book({ token_id: "0xABC..." })
// Get price history
price_history({ token_id: "0xABC...", interval: "1d", fidelity: 30 })Trade (Authenticated)
// Place limit order: buy 10 shares at $0.50
create_order({
token_id: "0xABC...",
side: "buy",
price: 0.50,
size: 10
})
// Place market order: buy $5 worth at current price
market_order({
token_id: "0xABC...",
side: "buy",
amount: 5
})
// Cancel order
cancel_order({ order_id: "0xORDER..." })
// Check positions
positions({ wallet_address: "0xYOUR_WALLET..." })
// Check balance
balance({ asset_type: "collateral" })Security
Wallet Key Management
Never log private keys — Keys are only used for CLI signing
Environment variables only — Keys never hardcoded
No key exposure in responses — MCP responses don't include keys
Input Validation
All inputs validated with Zod before CLI execution
Token IDs must match hex pattern (
0x[0-9a-fA-F]+)Wallet addresses validated (
0x[0-9a-fA-F]{40})Price bounds enforced (0.01 to 0.99)
Positive size/amount validation
Rate Limiting
CLI timeout: 30 seconds per command
Buffer limit: 10MB max response size
Respects Polymarket API rate limits (60 req/min)
Command Injection Protection
No shell interpolation of user input
Pre-validated arguments passed as array
Uses
child_process.execwith timeout + buffer limits
Testing
Manual Test (MCP Inspector)
npx @modelcontextprotocol/inspector node dist/index.jsTest Read-Only Tools
# List markets
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"markets_search","arguments":{"query":"bitcoin","limit":3}}}' | node dist/index.jsTest Authenticated Tools
Requires .env with POLYMARKET_PRIVATE_KEY:
# Check balance
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"balance","arguments":{"asset_type":"collateral"}}}' | node dist/index.jsIntegration with Polygent
See INTEGRATION.md for detailed integration guide.
Quick start:
Install MCP server on Polygent VPS
Configure
mcporterwith server path + env varsUpdate Polygent agents to call MCP tools
Add health checks for MCP server status
Troubleshooting
"Wallet not configured" error
Set
POLYMARKET_PRIVATE_KEYin.envor MCP client configVerify key format:
0x+ 64 hex characters
"Command not found: polymarket"
Install Polymarket CLI:
brew install polymarketVerify:
which polymarket
"Failed to parse CLI output"
Check CLI version:
polymarket --versionEnsure JSON output mode works:
polymarket -o json markets list --limit 1
Rate limit errors (429)
Respect 60 req/min limit
Add exponential backoff in agent logic
Use batch endpoints where available
Architecture
polymarket-mcp/
├── src/
│ ├── index.ts # MCP server (tool definitions)
│ └── lib/
│ ├── env.ts # Environment validation (Zod)
│ ├── cli.ts # CLI wrapper functions
│ └── types.ts # TypeScript types
├── dist/ # Compiled output
├── .env.example
├── package.json
├── tsconfig.json
└── README.mdDesign:
No database — Pure CLI wrapper
Fail-fast validation — Env vars checked at startup
Structured errors — Always return error objects, never throw
Type-safe — Full TypeScript + Zod validation
Related Projects
Polymarket CLI: https://github.com/Polymarket/polymarket-cli
MCP Specification: https://modelcontextprotocol.io
Polygent: https://polygent.market
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Your agent needs the crowd's number — live odds on elections, policy, macro prints and sport, from the venues where people put money behind the opinion. **What you can ask for** • "What are the current odds on this event?" • "List the open markets on this topic across both venues." • "Show recent trades and how the price moved." • "What is the implied probability now versus a week ago?" **How to use it** Point any MCP client at https://mcp.aisa.one/prediction-market-data/mcp and sign in with OAuth — there is no key to create or paste. 5 tools: Kalshi markets and trades, Polymarket markets, events and activity. **Why this rather than the source** Both venues in one shape, so the same question can be priced twice. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Read the odds here, then ask the same agent for the market data or the news behind them — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/finance/mcp for equities, crypto and prediction markets in one place.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Read-only MCP server for live Polymarket, Kalshi, Limitless odds; Manifold sentiment.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that gives AI agents direct access to Polymarket Crypto prediction markets, enriched with live spot prices. Discover markets, analyze order books, paper trade strategies, track activity, and execute live trades — all through natural language.1AGPL 3.0
- AlicenseCqualityCmaintenanceMCP server that provides a unified prediction market API for multiple venues like Polymarket and Kalshi, allowing AI agents to discover markets, fetch order books, and execute trades through a single interface.3246 npm8MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for querying and optionally trading across prediction markets (Polymarket, Kalshi, Limitless, Manifold) through a unified API.31MIT
- AlicenseCqualityCmaintenanceMCP server exposing 47 Polymarket API tools for AI assistants. Covers the full Gamma, CLOB, and Data APIs plus a fluent MarketBuilder for multi-source queries.4710 npm2MIT