prediction-market-mcp
Unified real-time prediction market data via MCP.
Key Features
Use Cases
README
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:
git clone <repository-url>
cd prediction-markets-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
Usage
Running the Server
Start the MCP server:
node build/index.js
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 markets- Maximum length: 50 characters
- Examples: "trump", "election", "supreme court"
Example Queries
// Search for Trump-related markets
{
"keyword": "trump"
}
// Search for election markets
{
"keyword": "election"
}
// Search for Supreme Court markets
{
"keyword": "supreme court"
}
Response Format
The server returns prediction market data in the following format:
Polymarket Markets
**Polymarket: Will Trump win the 2024 election?**
Yes: 45.2% | No: 54.8%
PredictIt Markets
**PredictIt: Which party will win the 2025 gubernatorial election in Virginia?**
Democratic: 89.0% | Republican: 11.0%
Data Sources
Polymarket API
- Base URL:
https://clob.polymarket.com/markets - Format: 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
prediction-markets-mcp/
├── src/
│ └── index.ts # Main server implementation
├── build/ # Compiled JavaScript output
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Key Components
Type Definitions
// Polymarket types
type Market = {
question: string;
active: boolean;
archived: boolean;
tokens: Token[];
};
// PredictIt types
type PredictItMarket = {
id: number;
name: string;
shortName: string;
contracts: PredictItContract[];
status: string;
};
Core Functions
getPolymarketPredictionData(): Fetches and processes Polymarket datagetPredictItMarkets(): Fetches all PredictIt marketsmakeApiRequest(): Handles HTTP requests with proper headers
Building
# Development build
npm run build
# Watch mode (if needed)
npm run dev
Testing
To test the server manually:
- Start the server:
node build/index.js
- 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
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
Star History
Repository Owner
User
Repository Details
Programming Languages
Tags
Topics
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
Hive Intelligence MCP Server
Unified MCP server delivering advanced cryptocurrency and Web3 analytics.
Hive Intelligence MCP Server provides comprehensive cryptocurrency, DeFi, and Web3 analytics via the Model Context Protocol. It enables AI assistants to access and orchestrate over 200 specialized tools covering market data, on-chain analytics, portfolio tracking, and security analysis. The server offers both dynamic and category-specific analytics through a unified MCP interface, facilitating intelligent tool orchestration for diverse crypto data needs.
- ⭐ 7
- MCP
- hive-intel/hive-crypto-mcp
Graphlit MCP Server
Integrate and unify knowledge sources for RAG-ready AI context with the Graphlit MCP Server.
Graphlit MCP Server provides a Model Context Protocol interface, enabling seamless integration between MCP clients and the Graphlit platform. It supports ingestion from a wide array of sources such as Slack, Discord, Google Drive, email, Jira, and GitHub, turning them into a searchable, RAG-ready knowledge base. Built-in tools allow for document, media extraction, web crawling, and web search, as well as advanced retrieval and publishing functionalities. The server facilitates easy configuration, sophisticated data operations, and automated notifications for diverse workflows.
- ⭐ 369
- MCP
- graphlit/graphlit-mcp-server
Bitcoin MCP Server
Real-time Bitcoin blockchain data server for MCP clients.
Provides tools to deliver real-time Bitcoin blockchain data for use with Model Context Protocol (MCP) clients. Offers specialized endpoints for querying blockchain addresses, transactions, UTXOs, and block information by interfacing with the mempool.space API. Supports easy installation and integration with popular MCP clients, enabling seamless access to blockchain analytics.
- ⭐ 0
- MCP
- JamesANZ/bitcoin-mcp
Fantasy Premier League MCP Server
Enables rich access to Fantasy Premier League data via the Model Context Protocol.
Fantasy Premier League MCP Server is a Model Context Protocol (MCP) server that provides streamlined access to Fantasy Premier League (FPL) data, including player statistics, team information, and gameweek details. It allows users to interact with and compare FPL player data, search teams and players, and integrate seamlessly with Claude Desktop and other MCP-compatible clients. Designed for both quick CLI usage and deep AI integration, it ensures comprehensive coverage for FPL enthusiasts and AI-powered desktop tools.
- ⭐ 65
- MCP
- rishijatia/fantasy-pl-mcp
Octagon Deep Research MCP
AI-powered, enterprise-grade deep research server for MCP clients.
Octagon Deep Research MCP provides specialized AI-driven research and analysis via seamless integration with MCP-enabled applications. It offers comprehensive multi-source data aggregation, advanced analysis tools, and generates in-depth reports across various domains. The solution emphasizes high performance with no rate limits, enterprise-grade speed, and universal compatibility for teams needing thorough research capabilities.
- ⭐ 70
- MCP
- OctagonAI/octagon-deep-research-mcp
Godot MCP
A Model Context Protocol (MCP) server implementation using Godot and Node.js.
Godot MCP implements the Model Context Protocol (MCP) as a server, leveraging the Godot game engine along with Node.js and TypeScript technologies. Designed for seamless integration and efficient context management, it aims to facilitate standardized communication between AI models and applications. This project offers a ready-to-use MCP server for developers utilizing Godot and modern JavaScript stacks.
- ⭐ 1,071
- MCP
- Coding-Solo/godot-mcp
Didn't find tool you were looking for?