Enables autonomous trading and portfolio management on Polymarket prediction markets with 45 tools covering market discovery, analysis, trading execution, position tracking, and real-time monitoring via WebSocket connections.
๐ค 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
Developed in collaboration with:
๐พ Yield Hacker - DeFi Innovation Community
๐ฐ Renda Cripto - Crypto Trading Community
๐๏ธ Cultura Builder - Builder Culture Community
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
๐ Quick Start
Installation
Configuration
Required credentials:
Optional (recommended) - Safety Limits:
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
Restart Claude Desktop and you're ready to trade! ๐
๐ Documentation
Getting Started
Setup Guide - Detailed installation and configuration instructions
Quick Start Video - Video walkthrough (coming soon)
Developer Resources
Tools Reference - Complete API documentation for all 45 tools
Agent Integration Guide - How to integrate with your agents
Trading Architecture - System design and architecture
WebSocket Integration - Real-time data setup
Examples & Guides
Usage Examples - Code examples for all tools
Test Examples - Example test implementations
Market Analysis Scripts - Advanced analysis examples
๐ก Usage Examples
Market Discovery
Ask Claude:
Market Analysis
Autonomous Trading
Portfolio Management
Real-time Monitoring
๐งช Testing
Note: All tests use real Polymarket APIs - NO MOCKS!
๐ก๏ธ Safety & Security
โ ๏ธ Important Security Considerations
Private Key Protection: Never share or commit your private key
Start Small: Begin with small amounts ($50-100) to test
Understand Markets: Only trade in markets you understand
Monitor Positions: Check your positions regularly
Use Safety Limits: Configure appropriate limits for your risk tolerance
Never Risk More: Than you can afford to lose
Default Safety Limits
These can be customized in your .env file or Claude Desktop config.
๐ค Contributing
Contributions are welcome! We appreciate your help making this project better.
Please read CONTRIBUTING.md for details on:
How to report bugs
How to suggest features
Code standards and guidelines
Pull request process
Quick Contribution Guide
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
๐ Project Stats
Lines of Code: ~10,000+ (Python)
Tools: 45 comprehensive tools
Test Coverage: High (real API integration)
Documentation: Comprehensive (multiple guides)
Dependencies: Modern Python packages (MCP, httpx, websockets, eth-account)
๐ Community
Join Our Communities
๐พ Yield Hacker - DeFi Innovation & Yield Farming
๐ฐ Renda Cripto - Crypto Trading & Investments
๐๏ธ Cultura Builder - Builder Culture & Development
Get Support
GitHub Issues: Report bugs or request features
GitHub Discussions: Ask questions and share ideas
Telegram Communities: Get help from the community
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
This project was made possible by:
Caio Vicentino - Creator and lead developer
Yield Hacker Community - DeFi expertise and testing
Renda Cripto Community - Trading insights and validation
Cultura Builder Community - Builder culture and support
Polymarket - Amazing prediction market platform
Anthropic - Claude and the MCP protocol
py-clob-client - Official Polymarket SDK
Special thanks to all contributors and community members who have helped improve this project!
โ ๏ธ Disclaimer
This software is provided for educational and research purposes. Trading prediction markets involves financial risk.
Important Reminders:
Cryptocurrency trading carries significant risk
Only invest what you can afford to lose
Past performance does not guarantee future results
This is not financial advice
Always do your own research (DYOR)
Start with small amounts to learn the system
Understand the markets you're trading
Monitor your positions regularly
The authors and contributors are not responsible for any financial losses incurred through the use of this software.
๐ Links
GitHub Repository: github.com/caiovicentino/polymarket-mcp-server
Polymarket: polymarket.com
Polymarket Docs: docs.polymarket.com
MCP Protocol: modelcontextprotocol.io
Claude Code: claude.ai/code
๐ Roadmap
Current Version (v0.1.0)
โ 45 comprehensive tools
โ Real-time WebSocket monitoring
โ Safety limits and risk management
โ Complete test suite
โ Comprehensive documentation
Planned Features
CI/CD pipeline (GitHub Actions)
Enhanced AI analysis tools
Portfolio strategy templates
Market alerts and notifications
Performance analytics dashboard
Multi-wallet support
Advanced order types
Historical backtesting
Built with โค๏ธ for autonomous AI trading on Polymarket
Ready to make Claude your personal prediction market trader! ๐
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools including market discovery, real-time monitoring, portfolio management, and AI-powered trading recommendations with enterprise-grade safety features.