This MCP server provides real-time prediction market data from multiple platforms (Polymarket, PredictIt, and Kalshi) through a unified interface.
Key capabilities:
• Search markets by keyword - Query across all platforms using search terms (max 50 characters) like "trump", "election", or "supreme court"
• Get current odds and prices - Retrieve real-time market data displayed as percentages (Polymarket) or dollar amounts (PredictIt)
• Access multi-platform data - Query crypto-based markets (Polymarket), traditional prediction markets (PredictIt), and regulated US markets (Kalshi) simultaneously
• Unified data format - Receive consistent data structure across platforms including market questions, contract names, active status, and current prices
• Single tool interface - Use get-prediction-markets to access all platforms with built-in error handling
• TypeScript support - Comprehensive type definitions for type-safe development
Built on Node.js runtime environment for server execution and JavaScript/TypeScript implementation
Uses npm package manager for dependency management and project build processes
Implemented in TypeScript with full type safety and comprehensive type definitions for prediction market data structures
Alternative package manager option for dependency installation and project management
prediction-markets-mcp
A Model Context Protocol (MCP) server that provides real-time prediction market data from multiple platforms. This server allows you to query prediction markets for current odds, prices, and market information through a unified interface.
Supported Platforms
Polymarket - Crypto-based prediction markets with percentage-based odds
PredictIt - Traditional prediction markets with dollar-based prices
Kalshi - Regulated US prediction markets
Features
Multi-platform Support: Query both crypto and traditional prediction markets
Real-time Data: Get current odds and prices from live markets
Keyword Search: Filter markets by specific keywords or topics
Unified Interface: Consistent data format across different platforms
Error Handling: Graceful handling of API failures and network issues
Type Safety: Full TypeScript support with comprehensive type definitions
Installation
Prerequisites
Node.js (v18 or higher)
npm or yarn
Setup
Clone the repository:
Install dependencies:
Build the project:
Usage
Running the Server
Start the MCP server:
The server runs on stdio and can be integrated with MCP-compatible clients.
API Endpoints
The server provides a single tool: get-prediction-markets
Parameters
keyword(string, required): Search term to filter marketsMaximum length: 50 characters
Examples: "trump", "election", "supreme court"
Example Queries
Response Format
The server returns prediction market data in the following format:
Polymarket Markets
PredictIt Markets
Data Sources
Polymarket API
Base URL:
https://clob.polymarket.com/marketsFormat: JSON
Odds Display: Percentages (e.g., 65.2%)
Data: Market questions, active status, token prices
PredictIt API
Base URL:
https://www.predictit.org/api/marketdata/all/Format: JSON
Odds Display: Dollar amounts (e.g., $0.65)
Data: Market names, contracts, trade prices, status
Development
Project Structure
Key Components
Type Definitions
Core Functions
getPolymarketPredictionData(): Fetches and processes Polymarket datagetPredictItMarkets(): Fetches all PredictIt marketsmakeApiRequest(): Handles HTTP requests with proper headers
Building
Testing
To test the server manually:
Start the server:
Send test requests through an MCP client or test the API endpoints directly.
Troubleshooting
Common Issues
No Markets Found
Cause: Keyword too specific or no matching markets
Solution: Try broader keywords or check market availability
Example: Use "election" instead of "specific candidate name"
Development Setup
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Code Style
Use TypeScript for all new code
Follow existing naming conventions
Add JSDoc comments for public functions
Ensure all builds pass before submitting
Donate
If you find this project useful, consider supporting it with Bitcoin:
⚡ Lightning Network
lnbc1pjhhsqepp5mjgwnvg0z53shm22hfe9us289lnaqkwv8rn2s0rtekg5vvj56xnqdqqcqzzsxqyz5vqsp5gu6vh9hyp94c7t3tkpqrp2r059t4vrw7ps78a4n0a2u52678c7yq9qyyssq7zcferywka50wcy75skjfrdrk930cuyx24rg55cwfuzxs49rc9c53mpz6zug5y2544pt8y9jflnq0ltlha26ed846jh0y7n4gm8jd3qqaautqa
₿ On-Chain
bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp
Ξ Ethereum / EVM Networks
0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f
Donations from any EVM-compatible network (Ethereum, Polygon, Arbitrum, Optimism, BSC, Avalanche, etc.) will work perfectly! You can also send tokens like USDT, USDC, DAI, and other ERC-20 tokens to this address.
License
MIT License - see LICENSE file for details
Support
For issues and questions:
Check the troubleshooting section
Review existing GitHub issues
Create a new issue with detailed information