ClaudeCodeMod

All shelves / MCP servers

Polymarket

caiovicentino/polymarket-mcp-server · 500 stars · Python · MIT

MCP server 🤖 AI-Powered MCP Server for Polymarket - Enable Claude to trade prediction markets with 45 tools, real-time monitoring, and enterprise-grade safety features

Install

The repo has no one-line install. Follow its README.

Open the repo

Files

README.md

🤖 Polymarket MCP Server

Complete AI-Powered Trading Platform for Polymarket Prediction Markets

Enable Claude to autonomously trade, analyze, and manage positions on Polymarket with 45 comprehensive tools, real-time WebSocket monitoring, and enterprise-grade safety features.

👨‍💻 Created By

Caio Vicentino

Developed in collaboration with:

Powered by Claude Code from Anthropic

⭐ Key Features

🎯 45 Comprehensive Tools Across 5 Categories

#### 🔍 Market Discovery (8 tools)

  • Search and filter markets by keywords, categories, events
  • Trending markets by volume (24h, 7d, 30d)
  • Category-specific markets (Politics, Sports, Crypto)
  • Markets closing soon alerts
  • Featured and promoted markets
  • Sports markets (NBA, NFL, etc.)
  • Crypto prediction markets

#### 📊 Market Analysis (10 tools)

  • Real-time prices and spreads
  • Complete orderbook depth analysis
  • Liquidity and volume metrics
  • Historical price data
  • AI-powered opportunity analysis with BUY/SELL/HOLD recommendations
  • Multi-market comparison
  • Top holders analysis
  • Risk assessment and scoring
  • Spread calculation and monitoring

#### 💼 Trading (12 tools)

  • Limit orders (GTC, GTD, FOK, FAK)
  • Market orders (immediate execution)
  • Batch order submission
  • AI-suggested pricing (aggressive/passive/mid strategies)
  • Order status tracking and history
  • Open orders management
  • Single and bulk order cancellation
  • Smart trade execution (natural language → automated strategy)
  • Position rebalancing with slippage protection
  • Order book integration

#### 📈 Portfolio Management (8 tools)

  • Real-time position tracking
  • P&L calculation (realized/unrealized)
  • Portfolio value aggregation
  • Risk analysis (concentration, liquidity, diversification)
  • Trade history with filters
  • On-chain activity log
  • Performance metrics
  • AI-powered portfolio optimization (conservative/balanced/aggressive)

#### ⚡ Real-time Monitoring (7 tools)

  • Live price updates via WebSocket
  • Orderbook depth streaming
  • User order status notifications
  • Trade execution alerts
  • Market resolution notifications
  • Subscription management
  • System health monitoring
  • Auto-reconnect with exponential backoff

🛡️ Enterprise-Grade Safety & Risk Management

  • ✅ Order Size Limits - Configurable maximum per order
  • ✅ Exposure Caps - Total portfolio exposure limits
  • ✅ Position Limits - Per-market position caps
  • ✅ Liquidity Validation - Minimum liquidity requirements
  • ✅ Spread Tolerance - Maximum spread checks before execution
  • ✅ Confirmation Flow - User confirmation for large orders
  • ✅ Pre-trade Validation - Comprehensive safety checks

⚙️ Production-Ready Infrastructure

  • ✅ L1 & L2 Authentication - Wallet (private key) + API key auth
  • ✅ Advanced Rate Limiting - Token bucket algorithm respecting all Polymarket API limits
  • ✅ EIP-712 Signing - Secure order signatures
  • ✅ Auto-reconnect WebSockets - Resilient real-time connections
  • ✅ Comprehensive Error Handling - User-friendly error messages
  • ✅ No Mocks - Real Polymarket API integration throughout
  • ✅ Full Test Coverage - Production-grade testing with real APIs

🌐 Web Dashboard

NEW: Manage and monitor your Polymarket MCP Server with a modern web interface!

# Start the web dashboard
polymarket-web

# Or use the quick start script
./start_web_dashboard.sh

Access at: http://localhost:8080

Dashboard Features

  • Real-time Monitoring: Live MCP status, WebSocket connection, and statistics
  • Configuration Management: Visual sliders for safety limits and trading controls
  • Market Discovery: Search, filter, and browse markets with live updates
  • Market Analysis: AI-powered analysis with recommendations and risk assessment
  • System Monitoring: Performance charts, rate limits, and activity logs
  • Dark Theme: Professional UI optimized for extended use

See WEB_DASHBOARD.md for complete documentation.

🚀 Quick Start

One-Command Installation (Recommended)

Try DEMO mode first (no wallet needed):

# macOS/Linux
curl -sSL https://raw.githubusercontent.com/caiovicentino/polymarket-mcp-server/main/quickstart.sh | bash

# Or clone and run locally
git clone https://github.com/caiovicentino/polymarket-mcp-server.git
cd polymarket-mcp-server
./quickstart.sh

Full installation (with trading):

# macOS/Linux
./install.sh

# Windows
install.bat

The automated installer will:

  • ✓ Check Python version (3.10+)
  • ✓ Create virtual environment
  • ✓ Install all dependencies
  • ✓ Configure environment
  • ✓ Set up Claude Desktop integration
  • ✓ Test the installation

Installation Options

DEMO Mode vs Full Mode

DEMO Mode (No wallet required):

  • ✅ Market discovery and search
  • ✅ Real-time market analysis
  • ✅ AI-powered insights
  • ✅ Price monitoring
  • ❌ Trading disabled (read-only)

Full Mode (Requires Polygon wallet):

  • ✅ Everything in DEMO mode
  • ✅ Place orders and execute trades
  • ✅ Portfolio management
  • ✅ Position tracking
  • ✅ Real-time trade notifications

Manual Installation

If you prefer manual setup:

# Clone the repository
git clone https://github.com/caiovicentino/polymarket-mcp-server.git
cd polymarket-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install the package
pip install -e .

Configuration

Option 1: DEMO Mode (easiest)

cp .env.example .env
# Edit .env and set:
DEMO_MODE=true

Option 2: Full Trading Mode

cp .env.example .env
# Edit with your Polygon wallet credentials
nano .env

Required credentials (Full Mode):

POLYGON_PRIVATE_KEY=your_private_key_without_0x_prefix
POLYGON_ADDRESS=0xYourPolygonAddress

Recommended Safety Limits:

MAX_ORDER_SIZE_USD=1000
MAX_TOTAL_EXPOSURE_USD=5000
MAX_POSITION_SIZE_PER_MARKET=2000
MIN_LIQUIDITY_REQUIRED=10000
MAX_SPREAD_TOLERANCE=0.05
ENABLE_AUTONOMOUS_TRADING=false
REQUIRE_CONFIRMATION_ABOVE_USD=500

With ENABLE_AUTONOMOUS_TRADING=false (the default), every order is held and returned as confirmation_required until you re-issue it with confirm=true. Set it to true to let orders under REQUIRE_CONFIRMATION_ABOVE_USD go through without that step.

Claude Desktop Integration

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "polymarket": {
      "command": "/path/to/your/venv/bin/python",
      "args": ["-m", "polymarket_mcp.server"],
      "cwd": "/path/to/polymarket-mcp-server",
      "env": {
        "POLYGON_PRIVATE_KEY": "your_private_key",
        "POLYGON_ADDRESS": "0xYourAddress"
      }
    }
  }
}

Restart Claude Desktop and you're ready to trade! 🎉

📖 Documentation

Getting Started

Developer Resources

Examples & Guides

Facts

Kind
MCP server
Repo
caiovicentino/polymarket-mcp-server
Group
Uncategorized
Stars
500
License
MIT
Language
Python
Last push
2026-09-20
Forks
143
Topics
ai-trading, anthropic, autonomous-trading, blockchain, claude, defi, market-analysis, mcp, polygon, polymarket, prediction-markets, python, trading, websocket

More on this shelf

  1. 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  2. 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
  3. 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
  4. 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  5. 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  6. 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k