Polymarket MCP Bot Analyst
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 Bot Analyst Show me the top 10 traders in the last 7 days"
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 Bot Analyst
MCP server for analyzing successful trading bots on Polymarket ā discover top traders, classify their strategies with AI, and detect bots on the world's largest prediction market.
š Table of Contents
Related MCP server: polymarket-mcp
Overview
This project implements a Model Context Protocol (MCP) server that exposes three powerful tools for analyzing trading activity on Polymarket. It combines real-time leaderboard data from Polymarket's Data API with LLM-powered strategy classification via OpenAI.
Key Features
š Top Trader Discovery ā Fetch leaderboard rankings by timeframe
š§ AI Strategy Analysis ā Classify strategies (arbitrage, market-making, etc.) using GPT-4o-mini
š¤ Bot Detection ā Heuristic + LLM-based identification of automated traders
š Batch Reporting ā Concurrent analysis of multiple profiles
š Resilient API Layer ā Exponential backoff, rate-limit handling (429 + Retry-After), graceful fallbacks
graph TD
subgraph Client ["Client Layer"]
MCP_Client["MCP Client (e.g., Claude Desktop)"]
end
subgraph Server ["MCP Server Layer"]
index["index.ts (McpServer)"]
Validation["Zod Validation"]
end
subgraph Tools ["Tool Handlers"]
Traders["traders.ts (find_top_traders)"]
Analysis["analysis.ts (analyze_trader_strategy)"]
Reports["reports.ts (generate_batch_report)"]
end
subgraph Services ["External Services & Utils"]
PAPI["api/polymarket.ts (Polymarket Data API)"]
LLM["utils/llm.ts (OpenAI GPT-4o-mini)"]
end
MCP_Client -- "stdio (JSON-RPC)" --> index
index --> Validation
Validation --> Traders
Validation --> Analysis
Validation --> Reports
Traders --> PAPI
Analysis --> PAPI
Analysis --> LLM
Reports --> Analysis
Reports --> PAPI
style Client fill:#f9f,stroke:#333,stroke-width:2px
style Server fill:#bbf,stroke:#333,stroke-width:2px
style Tools fill:#dfd,stroke:#333,stroke-width:2px
style Services fill:#ffd,stroke:#333,stroke-width:2pxTool Execution Flow
sequenceDiagram
participant C as MCP Client
participant S as MCP Server
participant T as Tool Handler
participant P as Polymarket API
participant L as OpenAI LLM
C->>S: Call "analyze_trader_strategy"
S->>S: Validate Input (Zod)
S->>T: handleAnalyzeStrategy(profile_id)
T->>P: Fetch Profile Data & PnL
P-->>T: User Data
T->>P: Fetch Trade History
P-->>T: Trade History
T->>L: Classify strategy (history)
L-->>T: strategy_analysis (JSON)
T-->>S: strategy_result
S-->>C: Tool Response (JSON)Tools
1. find_top_traders
Fetch top-performing traders from the Polymarket leaderboard with bot detection.
Parameter | Type | Description |
| integer | Number of traders (1ā50) |
| string |
|
Output: Array<{ profile_id, pnl, is_bot }>
2. analyze_trader_strategy
Deep-dive analysis of a single trader using trade history + LLM classification.
Parameter | Type | Description |
| string | Wallet address ( |
Output: { strategy_description, risk_level, risk_justification, success_score, is_bot }
3. generate_batch_report
Concurrent analysis of multiple profiles with error-resilient execution.
Parameter | Type | Description |
| string[] | Array of profile IDs (1ā50) |
Output: Array<{ profile_id, pnl, strategy_description, risk_level, risk_justification, success_score, is_bot }>
Getting Started
Prerequisites
Node.js ā„ 22
npm ā„ 10
OpenAI API key (for strategy analysis)
Installation
# Clone the repository
git clone <your-repo-url>
cd polymarket-mcp-bot-analyst
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEYBuild & Run
# Build TypeScript
npm run build
# Start the MCP server (stdio transport)
npm start
# Or run directly with tsx (development)
npm run devConnect to Claude Desktop
Add this server to your Claude Desktop configuration:
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"polymarket-bot-analyst": {
"command": "node",
"args": ["/absolute/path/to/polymarket-mcp-bot-analyst/dist/index.js"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"polymarket-bot-analyst": {
"command": "node",
"args": ["C:\\path\\to\\polymarket-mcp-bot-analyst\\dist\\index.js"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}After saving, restart Claude Desktop. The three tools will appear in the tools menu (šØ icon).
Run the Test Suite
The test runner executes all three tools against the live Polymarket API and generates the required JSON artifacts:
npm run test:runThis produces:
File | Description |
| Full execution log with data for 3+ traders |
| Latency metrics for each endpoint |
| Architectural description of each endpoint |
Project Structure
polymarket-mcp-bot-analyst/
āāā src/
ā āāā index.ts # MCP server entry point
ā āāā types.ts # Shared interfaces & config
ā āāā api/
ā ā āāā polymarket.ts # Polymarket Data API wrapper
ā āāā tools/
ā ā āāā traders.ts # find_top_traders handler
ā ā āāā analysis.ts # analyze_trader_strategy handler
ā ā āāā reports.ts # generate_batch_report handler
ā āāā utils/
ā ā āāā llm.ts # OpenAI LLM integration
ā āāā test-run.ts # Artifact generator script
āāā test_run.json # Generated test run log
āāā performance_report.json # Generated latency metrics
āāā my_report.json # Generated architecture report
āāā package.json
āāā tsconfig.json
āāā .env.example
āāā .gitignoreConfiguration
Environment Variable | Required | Description |
| Yes | OpenAI API key for GPT-4o-mini |
Internal Constants (in src/types.ts)
Constant | Default | Description |
|
| API base URL |
|
| HTTP request timeout |
|
| Max retry attempts per request |
|
| Base delay for exponential backoff |
|
| Min trades to flag as bot |
|
| Min trades/hour for bot flag |
License
MIT
Available Tools
3 toolsanalyze_trader_strategyA
Analyze a trader's strategy using trade history and LLM classification. Returns strategy type, risk level, success score, and bot detection.
Inputs: profile_id (required).
find_top_tradersA
Fetch top traders from the Polymarket leaderboard. Detects bots based on trade frequency and volume.
Inputs: limit (required), timeframe (required).
generate_batch_reportA
Concurrently analyze multiple trader profiles and generate a combined report with PnL, risk, score, and bot status.
Inputs: profile_ids (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: finding top traders, analyzing a single trader's strategy, and generating batch reports. No overlap in functionality.
All tool names follow the verb_noun pattern (find_top_traders, analyze_trader_strategy, generate_batch_report), providing a predictable and consistent naming convention.
Three tools are perfectly scoped for this niche domain of trader analysis and bot detection. Each tool earns its place, and the count is neither too thin nor excessive.
The tool set covers the full workflow: discovering traders via the leaderboard, deep-diving into individual strategies, and scaling to batch analysis. No critical gaps or dead ends.
Maintenance
Related MCP Connectors
Research-only MCP server: your AI as a quant research desk. 90 tools, no trades, no brokers.
Read-only MCP server for live Polymarket, Kalshi, Limitless odds; Manifold sentiment.
MCP server for Gainium ā manage trading bots, deals, and balances via AI assistants
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn 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
- AlicenseNot gradedqualityBmaintenanceAn MCP server and Python toolkit that provides AI agents with real-time tools for Polymarket prediction markets, including liquidity scanning, arbitrage detection, and slippage estimation. It also offers advanced wallet intelligence, portfolio risk calculation, and probabilistic reasoning to enhance market analysis and strategy.76 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that classifies Polymarket wallets as human or bot, scores their trading edge from 0ā10, and streams current open positions.15 PyPIMIT
- AlicenseBqualityDmaintenanceMCP server to query Polymarket prediction market data via The Graph subgraphs and REST APIs, enabling AI agents to search markets, get live prices, order books, on-chain analytics, and trader profiles.32116 npmMIT