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 Server show me the top 5 prediction markets by 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
A comprehensive Model Context Protocol (MCP) server for interacting with Polymarket, the world's largest prediction market platform. This server provides seamless access to Polymarket's APIs, enabling AI assistants to retrieve market data, user positions, trading history, and more.
š Features
Market Data
Get Markets: Retrieve prediction markets with filtering and pagination
Get Events: Access event data containing multiple related markets
Market Prices: Real-time and historical price data with technical analysis
Order Book: Live bid/ask data with market depth analysis
Trading & Activity
Trade History: Comprehensive trading data with statistics
User Positions: Portfolio tracking with P&L calculations
User Activity: On-chain activity including trades, splits, merges, and rewards
Market Holders: Ownership distribution and concentration analysis
Advanced Analytics
Liquidity analysis and market depth
Price trend analysis and volatility metrics
Portfolio performance tracking
Market concentration and distribution insights
Related MCP server: Polymarket MCP Server
š¦ Installation
Prerequisites
Node.js 18+
TypeScript 5.3+
npm or yarn
Setup
Clone the repository
git clone <repository-url> cd polymarket-mcpInstall dependencies
npm installBuild the project
npm run buildStart the server
npm start
š§ Configuration
Claude Desktop Integration
Method 1: Stdio Mode (Recommended for Development)
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"polymarket-mcp": {
"command": "node",
"args": ["path/to/polymarket-mcp/build/index.js"]
}
}
}Method 2: SSE Mode (Recommended for Production)
Install Supergateway
npm install -g supergatewayStart SSE server
npm run sseConfigure Claude Desktop
{ "mcpServers": { "polymarket-mcp": { "type": "sse", "url": "http://localhost:3100/sse", "timeout": 600 } } }
š ļø Available Tools
1. Get Markets
get_markets({
limit?: number, // Max results (default: 20, max: 100)
offset?: number, // Pagination offset
active?: boolean, // Filter by active status
search?: string, // Search by title/description
order?: string, // Sort by: volume, liquidity, start_date, end_date
liquidity_min?: number, // Minimum liquidity threshold
volume_min?: number // Minimum volume threshold
})2. Get Events
get_events({
limit?: number, // Max results (default: 20, max: 100)
offset?: number, // Pagination offset
active?: boolean, // Filter by active status
search?: string, // Search by title/description
order?: string // Sort by: volume, liquidity, start_date, end_date
})3. Get User Positions
get_user_positions({
user_address: string, // Required: User's wallet address
limit?: number, // Max results (default: 50, max: 100)
market_id?: string, // Filter by specific market
min_size?: number, // Minimum position size
show_zero_positions?: boolean // Include zero positions
})4. Get User Activity
get_user_activity({
user_address: string, // Required: User's wallet address
limit?: number, // Max results (default: 50, max: 100)
activity_type?: string, // TRADE, SPLIT, MERGE, REDEEM, REWARD, CONVERSION
side?: string, // BUY or SELL (for trades)
start_date?: string, // ISO 8601 date format
end_date?: string // ISO 8601 date format
})5. Get Market Prices
get_market_prices({
market_id?: string, // Market ID (required if no token_id)
token_id?: string, // Token ID (required if no market_id)
interval?: string, // 1m, 5m, 1h, 1d (default: 1h)
fidelity?: number, // Number of price points (default: 100, max: 1000)
include_orderbook?: boolean // Include current order book
})6. Get Trades
get_trades({
limit?: number, // Max results (default: 50, max: 100)
market_id?: string, // Filter by market
user_address?: string, // Filter by user
side?: string, // BUY or SELL
min_size?: number, // Minimum trade size
start_date?: string, // ISO 8601 date format
end_date?: string // ISO 8601 date format
})7. Get Order Book
get_order_book({
market_id?: string, // Market ID (required if no token_id)
token_id?: string, // Token ID (required if no market_id)
depth?: number, // Price levels to show (default: 10, max: 50)
include_spread_analysis?: boolean, // Include spread analysis
include_liquidity_analysis?: boolean // Include liquidity analysis
})8. Get Market Holders
get_market_holders({
market_id?: string, // Market ID (required if no token_id)
token_id?: string, // Token ID (required if no market_id)
limit?: number, // Max results (default: 50, max: 100)
min_balance?: number, // Minimum balance threshold
include_user_info?: boolean // Include user profiles
})š Example Usage
Get Active Markets
Show me the top 10 most liquid active prediction marketsAnalyze User Portfolio
Get positions for wallet address 0x1234... and show P&L analysisMarket Analysis
Get order book for market ID abc123 with liquidity analysisTrading History
Show recent trades for market xyz789 with volume over 1000 sharesšļø Architecture
src/
āāā index.ts # MCP server entry point
āāā lib/
ā āāā polymarketClient.ts # Polymarket API client
āāā tools/ # Business logic tools
āāā getMarkets.ts
āāā getEvents.ts
āāā getUserPositions.ts
āāā getUserActivity.ts
āāā getMarketPrices.ts
āāā getTrades.ts
āāā getOrderBook.ts
āāā getMarketHolders.tsš API Coverage
This MCP server integrates with multiple Polymarket APIs:
Gamma Markets API: Market data and metadata
CLOB API: Order book and trading data
Data API: User positions, activity, and analytics
š¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
š License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
šØāš» Author
Xingyu Chen
LinkedIn: Xingyu Chen
Email: guangxiangdebizi@gmail.com
GitHub: @guangxiangdebizi
NPM: @xingyuchen
š Acknowledgments
Polymarket for providing comprehensive APIs
Model Context Protocol for the MCP framework
The open-source community for inspiration and tools
Built with ā¤ļø for the prediction markets ecosystem
Available Tools
8 toolsget_eventsB
Retrieve Polymarket events which contain multiple related markets. Events group markets around a common theme or topic.
Inputs: limit, order, active, closed, +7 more.
get_market_holdersB
Retrieve holders and their positions for a specific market. Shows who owns shares and their holding amounts.
Inputs: limit, offset, order_by, token_id, +4 more.
get_market_pricesA
Get current market prices and trading data for specific markets or tokens. Shows bid/ask spreads, last traded prices, and market depth.
Inputs: end_ts, fidelity, interval, start_ts, +3 more.
get_marketsA
Retrieve Polymarket prediction markets with filtering and pagination options. Get market data including prices, volume, liquidity, and metadata.
Inputs: limit, order, active, closed, +7 more.
get_order_bookC
Retrieve current order book data showing bids and asks for a specific market or token. Shows market depth and liquidity.
Inputs: depth, token_id, market_id, include_spread_analysis, +1 more.
get_tradesA
Retrieve recent trades and trading history from Polymarket. Shows executed trades with prices, volumes, and market information.
Inputs: side, limit, offset, asset_id, +10 more.
get_user_activityC
Retrieve user's on-chain activity history including trades, splits, merges, redeems, rewards, and conversions.
Inputs: user_address (required), side, limit, offset, +7 more.
get_user_positionsB
Retrieve user's current positions in Polymarket prediction markets. Shows holdings, P&L, and position details.
Inputs: user_address (required), limit, offset, min_size, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 8 tools
Each tool addresses a distinct aspect of Polymarket: markets, events, user positions, user activity, prices, trades, order book, and holders. No two tools have overlapping purposes.
All tools follow a consistent 'get_' prefix with a noun, making the verb_noun pattern predictable and clear.
8 tools cover the core read-only functionalities of a prediction market API without being excessive or insufficient.
The tool set covers market data, events, user positions, activity, trading history, order book, and holders. Missing write operations (e.g., placing bets) is acceptable for a read-only server, but a search or filter across all markets could be a minor gap.
Maintenance
Related MCP Connectors
Polymarket in your AI: market rules, real fill costs, who is trading, top traders. Read-only.
Read-only Polymarket search, market details, order books, price history, and market cards.
Polymarket trader analytics for AI agents: rank wallets, read trader metrics, backtest strategies.
Trade Polymarket prediction markets from your Ask Gina wallet. Moves real funds.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables access to Polymarket's prediction markets for analyzing market probabilities, trading activity, and event outcomes across politics, sports, crypto, and other categories through natural language queries.41 npm10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query Polymarket prediction markets, accessing real-time odds, market data, price history, order books, and trending markets across categories like politics, crypto, and sports through natural language.41 npm7MIT
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Polymarket prediction markets through read-only access to market data, events, orderbooks, and user positions, plus authenticated trading capabilities for creating and managing orders.1-
- AlicenseAqualityDmaintenanceEnables AI assistants to discover prediction markets, view real-time data, execute trades (market/limit orders), and manage portfolios on Polymarket.641 npm3MIT