prediction-market-mcp

prediction-market-mcp

Unified real-time prediction market data via MCP.

10
Stars
5
Forks
10
Watchers
0
Issues
prediction-market-mcp is a Model Context Protocol (MCP) server that aggregates real-time prediction market data from multiple platforms, including Polymarket, PredictIt, and Kalshi. It enables users to query prediction markets for live odds, prices, and market information through a consistent and unified API interface. The server provides robust error handling, keyword filtering, and type-safe TypeScript implementation for seamless integration with MCP-compatible clients.

Key Features

Multi-platform prediction market integration
Real-time market odds and price data retrieval
Keyword-based market search and filtering
Consistent data format across platforms
Robust error handling for API and network issues
Type-safe TypeScript implementation
Unified API interface for market data access
Supports both crypto and traditional prediction markets
Extensible to additional prediction market platforms
Runs as an MCP server over stdio

Use Cases

Aggregating market odds for analytics dashboards
Integrating prediction market data into financial applications
Researching event probabilities via market forecasts
Building chatbots or assistants with access to market data
Developing automated trading or alert systems for prediction markets
Monitoring political or financial events via market sentiment
Providing data feeds to academic or data science projects
Supporting market-based forecasting tools
Creating web or mobile applications displaying aggregated market insights
Benchmarking and comparing market odds across platforms

README

prediction-markets-mcp

Trust Score

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

  1. Clone the repository:
bash
git clone <repository-url>
cd prediction-markets-mcp
  1. Install dependencies:
bash
npm install
  1. Build the project:
bash
npm run build

Usage

Running the Server

Start the MCP server:

bash
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

typescript
// 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 data
  • getPredictItMarkets(): Fetches all PredictIt markets
  • makeApiRequest(): Handles HTTP requests with proper headers

Building

bash
# Development build
npm run build

# Watch mode (if needed)
npm run dev

Testing

To test the server manually:

  1. Start the server:
bash
node build/index.js
  1. 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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:

  1. Check the troubleshooting section
  2. Review existing GitHub issues
  3. Create a new issue with detailed information

Star History

Star History Chart

Repository Owner

JamesANZ
JamesANZ

User

Repository Details

Language TypeScript
Default Branch main
Size 49 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
69.34%
JavaScript
30.66%

Tags

Topics

llms mcp-server

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Hive Intelligence MCP Server

    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

    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

    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

    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

    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

    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?

    Be as detailed as possible for better results