PolyMarket MCP Server
PolyMarket MCP Server
A Model Context Protocol (MCP) server that provides access to prediction market data through the PolyMarket API. This server implements a standardized interface for retrieving market information, prices, and historical data from prediction markets.
Features
- Real-time prediction market data with current prices and probabilities
- Detailed market information including categories, resolution dates, and descriptions
- Historical price and volume data with customizable timeframes (1d, 7d, 30d, all)
- Built-in error handling and rate limit management
- Clean data formatting for easy consumption
Installation
Installing via Smithery
To install PolyMarket Predictions for Claude Desktop automatically via Smithery:
Claude Desktop
- On MacOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json
- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Running Locally
- Clone the repository and install dependencies:
Install Libraries
Running
After connecting Claude client with the MCP tool via json file and installing the packages, Claude should see the server's mcp tools:
You can run the sever yourself via: In polymarket-mcp repo:
*if you want to run the server inspector along with the server:
- Create a
.env
file with your PolyMarket API key:
After connecting Claude client with the MCP tool via json file, run the server:
In alpha-vantage-mcp repo: uv run src/polymarket_mcp/server.py
Available Tools
The server implements four tools:
get-market-info
: Get detailed information about a specific prediction marketlist-markets
: List available prediction markets with filtering optionsget-market-prices
: Get current prices and trading informationget-market-history
: Get historical price and volume data
get-market-info
Input Schema:
Example Response:
list-markets
Input Schema:
Example Response:
get-market-prices
Input Schema:
Example Response:
get-market-history
Input Schema:
Example Response:
Error Handling
The server includes comprehensive error handling for various scenarios:
- Rate limiting (429 errors)
- Invalid API keys (403 errors)
- Invalid market IDs (404 errors)
- Network connectivity issues
- API timeout conditions (30-second timeout)
- Malformed responses
Error messages are returned in a clear, human-readable format.
Prerequisites
- Python 3.9 or higher
- httpx>=0.24.0
- mcp-core
- python-dotenv>=1.0.0
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This server cannot be installed
Enables interaction with the PolyMarket API to fetch prediction market data such as market information, prices, and historical data, with robust error handling and rate limit management.