Polymarket MCP - Prediction Market Tools
A collection of Model Context Protocol (MCP) servers for interacting with prediction markets, specifically designed to work with Claude Desktop and other AI assistants.
🌟 Features
- Real-time market data from Polymarket API
- Multiple server implementations with varying complexity
- Seamless integration with Claude Desktop
- Custom data analysis tools for prediction markets
- Synthetic data generation for testing and demonstration
📋 Project Overview
This project provides MCP server implementations for prediction market data:
- Enhanced Server (v3) - The main implementation with real-time Polymarket API integration, data analysis, and market insights.
- Core API Library - Reusable components for building custom prediction market tools.
🚀 Quick Start
Prerequisites
- Python 3.9+
- Claude Desktop (for using the tools with Claude)
Installation
-
Clone the repository:
git clone https://github.com/yourusername/Mcp-polymarket.git cd Mcp-polymarket -
Run the setup script:
./scripts/setup.shThis will:
- Create a virtual environment
- Install dependencies
- Set up configuration files
- Provide Claude Desktop configuration instructions
Running the Server
Use the provided script to start the server:
./scripts/start_server.sh
Or run it manually:
source venv/bin/activate
python3 enhanced_server_v3.py
🛠️ Available Tools
Enhanced Server (v3)
- getMarkets - Retrieve current prediction markets with filtering options
- refreshMarkets - Force refresh the market data from the API
- analyzeMarket - Get detailed analysis for a specific market
📊 Data Sources
The server can use multiple data sources:
- Polymarket API - Real-time data from the Polymarket platform
- Synthetic Data - Generated market data for testing and demonstration
- Local Cache - Stored data for faster response times
🔧 Configuration
Claude Desktop Configuration
Add the following to your Claude Desktop configuration:
{
"mcpServers": {
"polymarket-mcp": {
"command": "sh",
"args": [
"-c",
"cd /Onfinance-MCP-Polymarket && source .venv/bin/activate && PYTHONUNBUFFERED=1 python src/polymarket_mcp/server.py 2>/tmp/polymarket_server.log"
],
"restartOnExit": true,
"maxRestarts": 5
}
}
}
The configuration file can be found at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\Claude\\claude_desktop_config.json
📑 Documentation
Detailed documentation is available in the docs directory:
- Enhanced Server (v3) Documentation - Comprehensive guide to the main server implementation
📁 Project Structure
Mcp-polymarket/
├── enhanced_server_v3.py # Main server implementation
├── src/
│ └── polymarket_mcp/ # Core library components
│ ├── __init__.py
│ ├── server.py # Base MCP server functionality
│ ├── models/ # Data models
│ ├── utils/ # Utility functions
│ └── api/ # API integrations
├── docs/
│ └── enhanced_server_v3.md # Detailed documentation
├── scripts/
│ ├── setup.sh # Setup script
│ └── start_server.sh # Server startup script
├── archive/ # Archive of older versions
├── venv/ # Virtual environment (generated)
├── requirements.txt # Python dependencies
├── .env.example # Example environment variables
└── README.md # This file
📜 Available Scripts
The project includes several utility scripts in the scripts directory:
setup.sh- Sets up the project environment (virtual env, dependencies, etc.)start_server.sh- Starts the server and shows live logs- Other utility scripts for specific purposes
To run any script:
./scripts/script_name.sh
💡 Usage Examples
Querying Markets with Claude
Once the server is running and configured in Claude Desktop, you can use the tools with queries like:
Can you show me the latest prediction markets related to US elections?
Claude will use the getMarkets tool with appropriate filters.
Market Analysis
Analyze the market with ID "pm-123456" and give me your insights.
Claude will use the analyzeMarket tool to provide detailed market analysis.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgements
- Anthropic for Claude and the MCP protocol
- Polymarket for the prediction market platform
- All contributors to this project
Onfinance-MCP-Polymarket
Recommend MCP Servers 💡
NBA-stats-predictor
An MCP server that provides real-time NBA player performance forecasts using statistical modeling and real-time data analysis.
@raygun.io/mcp-server-raygun
MCP Server for Raygun's API V3 endpoints for interacting with your Crash Reporting and Real User Monitoring applications. This server provides comprehensive access to Raygun's API features through the Model Context Protocol.
@isaacphi/mcp-gdrive
Model Context Protocol (MCP) Server for reading from Google Drive and editing Google Sheets
@mindpilot/mcp
Visualize code architecture and flows for AI agents via MCP server with local processing.
@abhiz123/todoist-mcp-server
An MCP server that integrates Claude with Todoist, enabling natural language task management for creating, updating, completing, and deleting tasks.
@professional-wiki/mediawiki-mcp-server
An MCP server that enables Large Language Model (LLM) clients to interact with any MediaWiki wiki.