Skip to main content

Bitcoin-native prediction market data provider for AI agents

Project description

Predyx MCP Server

[!NOTE] Bitcoin-native prediction market data provider. Real-time market data, AI-powered analysis, and Lightning Network integration for AI agents.

๐ŸŒŸ Features

  • ๐Ÿ“Š Real-time Market Data: Live prices, trends, and market consensus from Polymarket
  • ๐Ÿค– AI-Powered Analysis: Advanced market analysis and price predictions
  • โšก Lightning Native: Bitcoin-native payments via NWC (Nostr Wallet Connect)
  • ๐Ÿ”„ Standard MCP Interface: Resources, Tools, and Prompts for AI agents
  • ๐ŸŽฏ Freemium Model: Free tier available, premium features at affordable rates

๐Ÿ“ฆ Installation

Option 1: Docker (Recommended)

docker run -i --rm \
  -e POLYMARKET_API_URL="https://gamma-api.polymarket.com" \
  -e NWC_CONNECTION_STRING="your_nwc_string" \
  diaai/predyx-mcp-server

Option 2: NPX (Coming Soon)

npx predyx-mcp-server \
  --polymarket-api-url "https://gamma-api.polymarket.com" \
  --nwc-connection-string "your_nwc_string"

Option 3: Claude Desktop Config

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "predyx": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "POLYMARKET_API_URL",
        "-e", "NWC_CONNECTION_STRING",
        "diaai/predyx-mcp-server"
      ],
      "env": {
        "POLYMARKET_API_URL": "https://gamma-api.polymarket.com",
        "NWC_CONNECTION_STRING": "your_nwc_string_here"
      }
    }
  }
}

Option 4: Smithery (Coming Soon)

One-click installation via Smithery:

# Coming soon

Option 5: VS Code Integration (Coming Soon)

Click the button below to install directly:

Install in VS Code

๐Ÿ› ๏ธ Available Tools

analyze_market

Analyze a prediction market with AI-powered insights.

Parameters:

  • market_id (string, required): Unique market identifier
  • include_history (boolean, optional): Include price history (default: true)
  • include_sentiment (boolean, optional): Include sentiment analysis (default: false, Premium only)

Cost: 10 sats per call (~$0.005)

Example:

{
  "market_id": "bitcoin-100k-2026",
  "include_history": true
}

Returns:

{
  "market_id": "bitcoin-100k-2026",
  "title": "Will Bitcoin reach $100K in 2026?",
  "current_probability": 0.6966,
  "volume": "44,520 sats",
  "analysis": {
    "trend": "bullish",
    "confidence": 0.75,
    "key_factors": [
      "Institutional adoption increasing",
      "Regulatory clarity improving",
      "Market sentiment positive"
    ]
  },
  "price_history": [
    {"date": "2026-03-01", "probability": 0.65},
    {"date": "2026-03-15", "probability": 0.68},
    {"date": "2026-03-28", "probability": 0.6966}
  ]
}

track_user_positions

Track a user's positions across multiple markets.

Parameters:

  • pubkey (string, required): User's Nostr public key (npub format)
  • markets (array of strings, optional): Filter by specific markets (default: all)
  • include_pnl (boolean, optional): Include profit/loss calculation (default: true, Premium only)

Cost: 20 sats per call (~$0.01)

Example:

{
  "pubkey": "npub1...",
  "markets": ["bitcoin-100k-2026", "nba-champion-2026"],
  "include_pnl": true
}

get_price_prediction

Get AI-powered price predictions for a market.

Parameters:

  • market_id (string, required): Unique market identifier
  • horizon_days (number, optional): Prediction horizon in days (1-90, default: 7)
  • confidence_interval (number, optional): Confidence interval (0.8-0.99, default: 0.95)

Cost: 50 sats per call (~$0.025)

Example:

{
  "market_id": "bitcoin-150k-2026",
  "horizon_days": 30,
  "confidence_interval": 0.95
}

๐Ÿ“š Resources

predyx://markets

List all active prediction markets.

Returns: Array of market objects with:

  • Market ID, title, description
  • Current price (YES/NO)
  • Volume, liquidity
  • Categories, tags

Example:

[
  {
    "id": "bitcoin-100k-2026",
    "title": "Will Bitcoin reach $100K in 2026?",
    "current_price": {
      "yes": 0.6966,
      "no": 0.3034
    },
    "volume": "44,520 sats",
    "liquidity": "2.2M sats",
    "categories": ["crypto", "bitcoin"]
  }
]

predyx://markets/{id}

Get detailed information about a specific market.

Parameters:

  • id (string): Market identifier

Returns: Complete market details including price history, order book summary, recent trades

predyx://trending

Get trending markets by volume and activity.

Returns: Top 10 trending markets

predyx://categories

Get all market categories.

Returns: Array of category objects with market counts

๐Ÿ’ก Prompts

analyze_market_prompt

Template for comprehensive market analysis.

Use case: When you need deep analysis of a prediction market

Example output:

Analyze the following prediction market:
- Market: Will Bitcoin reach $100K in 2026?
- Current Probability: 69.66%
- Volume: 44,520 sats

Consider:
1. Historical price trends
2. Market sentiment and social signals
3. External factors (regulation, adoption)
4. Risk assessment

investment_strategy_prompt

Template for developing investment strategies.

Use case: When evaluating multiple market positions

Example output:

Develop an investment strategy for the following positions:
- Position 1: Bitcoin $100K (69.66% probability)
- Position 2: NBA Champion 2026 (Lakers favored)
- Position 3: AI breakthrough by 2028

Consider:
1. Portfolio diversification
2. Risk tolerance
3. Time horizons
4. Expected value calculations

๐Ÿ”ง Configuration

Environment Variables

Variable Required Default Description
POLYMARKET_API_URL Yes https://gamma-api.polymarket.com Polymarket API endpoint
NWC_CONNECTION_STRING No - Nostr Wallet Connect string for payments (format: nostr+walletconnect://...)
LOG_LEVEL No info Logging level (debug/info/warning/error)
ENABLED_TOOLS No - Whitelist of enabled tools (comma-separated)
DISABLED_TOOLS No - Blacklist of disabled tools (comma-separated)
FREE_TIER_LIMIT No 5 Daily free tier limit (calls/day)
CACHE_MAX_SIZE No 100 Maximum cache entries
CACHE_DEFAULT_TTL No 300 Default cache TTL (seconds)

Command-Line Options

predyx-mcp-server [options]

Options:
  --polymarket-api-url <string>    Polymarket API endpoint
  --nwc-connection-string <string>  NWC connection string
  --log-level <string>              Logging level (debug|info|warning|error)
  --enabled-tools <string>          Comma-separated whitelist
  --disabled-tools <string>         Comma-separated blacklist
  --free-tier-limit <number>        Daily free tier limit
  --cache-max-size <number>         Maximum cache entries
  --cache-default-ttl <number>      Default cache TTL (seconds)

๐Ÿ’ฐ Pricing

Free Tier

  • 5 calls/day for all tools
  • Access to all Resources (unlimited)
  • Basic market analysis
  • Community support

Premium Tier (Coming Soon)

  • Unlimited calls
  • Advanced sentiment analysis
  • Profit/loss tracking
  • Priority support
  • Early access to new features
  • Cost: 100 sats/month (~$0.50)

Payment Methods:

  • Lightning Network (NWC)
  • L402 Protocol (HTTP 402)

๐Ÿš€ Use Cases

For AI Agents

  • Real-time data: Get live prediction market data for informed decisions
  • AI analysis: Leverage AI-powered market insights
  • Micropayments: Lightning-native payments for seamless integration

For Researchers

  • Data aggregation: Collect prediction market data at scale
  • Consensus analysis: Analyze market sentiment and accuracy
  • Trend tracking: Monitor historical trends and patterns

For Traders

  • Portfolio monitoring: Track positions across multiple markets
  • Price predictions: Get AI-powered forecasts
  • Performance tracking: Monitor portfolio performance in real-time

๐Ÿ—๏ธ Architecture

Predyx MCP Server
โ”œโ”€โ”€ Data Layer
โ”‚   โ”œโ”€โ”€ Polymarket API (stable, fast, public)
โ”‚   โ”œโ”€โ”€ Market data (prices, volumes, trends)
โ”‚   โ””โ”€โ”€ User positions (optional)
โ”œโ”€โ”€ Caching Layer
โ”‚   โ”œโ”€โ”€ In-memory cache (dict + TTL + LRU)
โ”‚   โ”œโ”€โ”€ Cache hit ratio: >90%
โ”‚   โ””โ”€โ”€ Response time: <1ms (cached), <500ms (API)
โ”œโ”€โ”€ Payment Layer
โ”‚   โ”œโ”€โ”€ NWC (Nostr Wallet Connect)
โ”‚   โ”œโ”€โ”€ L402 (HTTP 402 Protocol)
โ”‚   โ””โ”€โ”€ Lightning Network (micropayments)
โ””โ”€โ”€ Protocol Layer
    โ”œโ”€โ”€ MCP Resources (read-only data)
    โ”œโ”€โ”€ MCP Tools (pay-per-call functions)
    โ””โ”€โ”€ MCP Prompts (analysis templates)

Performance:

  • Cache hit: < 1ms response time
  • API call: 100-500ms response time
  • Throughput: 1000+ requests/second (cached)

๐Ÿ“Š Project Status

  • โœ… Core functionality complete
  • โœ… Real-time data integration (Polymarket API)
  • โœ… MCP protocol compliance
  • โœ… Caching implementation (TTL + LRU)
  • โœ… Documentation complete
  • โณ Payment integration (waiting for NWC)
  • ๐Ÿ”œ MCP Inspector testing
  • ๐Ÿ”œ PyPI package release
  • ๐Ÿ”œ Docker image release
  • ๐Ÿ”œ MCP Registry submission

Last Updated: 2026-03-28 Version: 1.0.0 License: MIT

๐Ÿค Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/dia-ai/predyx-mcp-server.git
cd predyx-mcp-server

# Install dependencies
pip install -r requirements.txt

# Run tests
python -m pytest tests/

# Start development server
python predyx_mcp_server.py

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ”— Links

๐Ÿ™ Acknowledgments

  • Polymarket: For providing excellent prediction market data API
  • Model Context Protocol: For standardizing AI agent interfaces
  • Lightning Network: For enabling seamless micropayments
  • Nostr: For decentralized identity and communication

๐Ÿ“ˆ Roadmap

Q2 2026

  • โœ… MVP release
  • โœ… Polymarket integration
  • ๐Ÿ”œ MCP Registry submission
  • ๐Ÿ”œ Payment integration (NWC)
  • ๐Ÿ”œ User growth (first 100 users)

Q3 2026

  • ๐Ÿ”œ Multi-platform support (Metaculus, Manifold Markets)
  • ๐Ÿ”œ Advanced analytics dashboard
  • ๐Ÿ”œ Mobile app integration
  • ๐Ÿ”œ API rate limiting improvements

Q4 2026

  • ๐Ÿ”œ Enterprise features
  • ๐Ÿ”œ Custom market creation
  • ๐Ÿ”œ Social trading features
  • ๐Ÿ”œ Governance token (optional)

Built with โค๏ธ by Dia AI

Bitcoin-native prediction market data for AI agents

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

predyx_mcp_server-1.0.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

predyx_mcp_server-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file predyx_mcp_server-1.0.0.tar.gz.

File metadata

  • Download URL: predyx_mcp_server-1.0.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for predyx_mcp_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a272406ab7a9bb25658db136d58bc0d2a71a1c4e5375f6df125f0da193b7b113
MD5 391ac6f18119e66f673089f8a87517ec
BLAKE2b-256 acc225d7448d105a5d7d8969c679aa06dc4a246783defa12c834c7fd7eea4090

See more details on using hashes here.

File details

Details for the file predyx_mcp_server-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for predyx_mcp_server-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8779ae35866f6549917a13bfab212882586eea6c7b32bd9b65967f238f4f40c8
MD5 df79b1e45cdefcc691fdc21c1dd33959
BLAKE2b-256 5acaf0f3aa7fb4eae66ecf192c88dfb692e226534bdd4583b8487c843e4e1841

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page