An MCP (Model Context Protocol) server that provides access to Polymarket's prediction market APIs with full trading capabilities.
This server exposes 40+ tools across Polymarket APIs:
get_events- Fetch prediction market eventsget_event_by_id- Get event by IDget_event_by_slug- Get event by URL slugget_markets- Fetch prediction marketsget_market_by_id- Get market by IDget_market_by_slug- Get market by URL slugget_tags- Get available market tags/categoriessearch_markets- Search markets by text query
get_price- Get current market price for a tokenget_prices- Get prices for multiple tokensget_midpoint- Get midpoint priceget_orderbook- Get order book for a tokenget_spread- Get bid-ask spreadget_last_trade_price- Get last trade priceget_price_history- Get historical price dataget_clob_markets- Get all CLOB marketsget_clob_market- Get CLOB market by condition IDget_tick_size- Get minimum tick size for a tokenget_neg_risk- Get negative risk flag for a token
create_order- Create and submit a limit ordercreate_market_order- Create and submit a market ordercancel_order- Cancel a specific ordercancel_orders- Cancel multiple orderscancel_all_orders- Cancel all open orderscancel_market_orders- Cancel all orders for a marketget_open_orders- Get all open ordersget_order- Get a specific order by IDget_user_trades- Get trade history for authenticated user
get_balance_allowance- Get balance and allowance infoupdate_balance_allowance- Update/refresh trading allowancederive_api_key- Derive API credentials from walletget_api_keys- Get all API keys
get_earnings_for_day- Get earnings breakdown for a dayget_reward_percentages- Get liquidity reward tiers
get_positions- Get user positionsget_trades- Get trades for user/marketget_activity- Get user on-chain activityget_holders- Get top position holdersget_position_value- Get total position valueget_closed_positions- Get user's closed positionsget_leaderboard- Get trader leaderboardget_open_interest- Get open interest dataget_event_volume- Get event trading volume
get_gamma_status- Check Gamma API healthget_clob_status- Check CLOB API healthget_data_status- Check Data API healthget_server_time- Get CLOB server time
npm install
npm run buildFor trading functionality, set these environment variables:
# Required for trading
POLYMARKET_PRIVATE_KEY=your_wallet_private_key
POLYMARKET_FUNDER_ADDRESS=your_polymarket_profile_address
# Optional (defaults to 0)
POLYMARKET_SIGNATURE_TYPE=0 # 0=EOA wallet, 1=Magic/email loginNote: The funder address is your Polymarket profile address where you deposit USDC, not your wallet address. You can find this in your Polymarket account settings.
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"polymarket": {
"command": "node",
"args": ["/path/to/polymarket-mcp-server/dist/index.js"],
"env": {
"POLYMARKET_PRIVATE_KEY": "your_private_key",
"POLYMARKET_FUNDER_ADDRESS": "your_funder_address"
}
}
}
}If you don't provide the environment variables, the server will still work for all read-only operations (market data, prices, orderbooks, etc.). Trading tools will return an error if called.
npm run dev- Gamma API:
https://gamma-api.polymarket.com - CLOB API:
https://clob.polymarket.com - Data API:
https://data-api.polymarket.com
Get active political events:
get_events(tag_id: "politics", closed: false, limit: 10)
Get current price for a market:
get_price(token_id: "...", side: "BUY")
Get top traders:
get_leaderboard(period: "weekly", limit: 10)
Place a limit order to buy at $0.45:
create_order(token_id: "...", price: 0.45, size: 10, side: "BUY")
Place a market order:
create_market_order(token_id: "...", amount: 50, side: "BUY")
Check your open orders:
get_open_orders()
Cancel all orders:
cancel_all_orders()
Check USDC balance:
get_balance_allowance(asset_type: "USDC")
MIT