Polymarket

by berlinbra

13 stars
475 downloads
Not rated
GitHub

About

Integrates with PolyMarket's API to fetch and analyze prediction market data for financial insights and decision support.

Details

Author
berlinbra
Repository
berlinbra/polymarket-mcp
GitHub stars
13
Downloads
475
License
MIT License
Categories
Developer Tools, Other, Finance, API, Productivity, Design, AI, Frontend, Infrastructure
Tags
#web

- 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

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Polymarket
    Command (node, npx, python, etc.) uv
    Arguments
    • Argument 1 --directory
    • Argument 2 /Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp
    • Argument 3 run
    • Argument 4 polymarket-mcp
    Environment
    • KEY <insert poly market api key>
    • FUNDER <insert polymarket wallet address>

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

To install PolyMarket Predictions for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install polymarket_mcp --client claude

1. Clone the repository and install dependencies:

uv pip install -e .

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:

uv run src/polymarket_mcp/server.py

*if you want to run the server inspector along with the server:

npx @modelcontextprotocol/inspector uv --directory C:\\Users\\{INSERT_USER}\\YOUR\\PATH\\TO\\polymarket-mcp run src/polymarket_mcp/server.py

2. Create a .env file with your PolyMarket API key:

Key=your_api_key_here
Funder=poly market wallet address

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

get-market-info

Get detailed information about a specific prediction market. Parameters: market_id (string) - Market ID or slug.

list-markets

List available prediction markets with filtering options. Parameters: status (string) - Filter by market status ('open', 'closed', 'resolved'), limit (integer) - Number of markets to return (default 10, minimum 1, maximum 100), offset (integer) - Number of markets to skip (for pagination, default 0).

get-market-prices

Get current prices and trading information for a specific market. Parameters: market_id (string) - Market ID or slug.

get-market-history

Get historical price and volume data for a specific market. Parameters: market_id (string) - Market ID or slug, timeframe (string) - Time period for historical data ('1d', '7d', '30d', 'all', default '7d').

The server implements four tools:
- get-market-info: Get detailed information about a specific prediction market
- list-markets: List available prediction markets with filtering options
- get-market-prices: Get current prices and trading information
- get-market-history: Get historical price and volume data

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "polymarket": {
            "env": {
                "KEY": "<insert poly market api key>",
                "FUNDER": "<insert polymarket wallet address>"
            },
            "args": [
                "--directory",
                "/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp",
                "run",
                "polymarket-mcp"
            ],
            "command": "uv"
        }
    }
}

Linux

{
    "env": {
        "KEY": "<insert poly market api key>",
        "FUNDER": "<insert polymarket wallet address>"
    },
    "args": [
        "--directory",
        "/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp",
        "run",
        "polymarket-mcp"
    ],
    "command": "uv"
}

Macos

{
    "env": {
        "KEY": "<insert poly market api key>",
        "FUNDER": "<insert polymarket wallet address>"
    },
    "args": [
        "--directory",
        "/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp",
        "run",
        "polymarket-mcp"
    ],
    "command": "uv"
}

Windows

{
    "env": {
        "KEY": "<insert poly market api key>",
        "FUNDER": "<insert polymarket wallet address>"
    },
    "args": [
        "--directory",
        "C:\\Users\\{INSERT_USER}\\YOUR\\PATH\\TO\\polymarket-mcp",
        "run",
        "src/polymarket_mcp/server.py"
    ],
    "command": "uv"
}

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.

- 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

To install PolyMarket Predictions for Claude Desktop automatically viaSmithery:

npx -y @smithery/cli install polymarket_mcp --client claude

- On MacOS:~/Library/Application\ Support/Claude/claude_desktop_config.json
- On Windows:%APPDATA%/Claude/claude_desktop_config.json

"mcpServers": { "polymarket-mcp": { "command": "uv", "args": [ "--directory", "/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp", "run", "polymarket-mcp" //or src/polymarket_mcp/server.py ], "env": { "KEY": "<insert poly market api key>", "FUNDER": "<insert polymarket wallet address>" } } }

- Clone the repository and install dependencies:

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:

npx @modelcontextprotocol/inspector uv --directory C:\\Users\\{INSERT_USER}\\YOUR\\PATH\\TO\\polymarket-mcp run src/polymarket_mcp/server.py

- Create a.envfile with your PolyMarket API key:

Key=your_api_key_here Funder=poly market wallet address

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

- get-market-info: Get detailed information about a specific prediction market
- list-markets: List available prediction markets with filtering options
- get-market-prices: Get current prices and trading information
- get-market-history: Get historical price and volume data

{ "market_id": { "type": "string", "description": "Market ID or slug" } }
Title: Example Market Category: Politics Status: Open Resolution Date: 2024-12-31 Volume: $1,234,567.89 Liquidity: $98,765.43 Description: This is an example prediction market... ---
{ "status": { "type": "string", "description": "Filter by market status", "enum": ["open", "closed", "resolved"] }, "limit": { "type": "integer", "description": "Number of markets to return", "default": 10, "minimum": 1, "maximum": 100 }, "offset": { "type": "integer", "description": "Number of markets to skip (for pagination)", "default": 0, "minimum": 0 } }
Available Markets: ID: market-123 Title: US Presidential Election 2024 Status: Open Volume: $1,234,567.89 --- ID: market-124 Title: Oscar Best Picture 2024 Status: Open Volume: $234,567.89 ---
{ "market_id": { "type": "string", "description": "Market ID or slug" } }
Current Market Prices for US Presidential Election 2024 Outcome: Democratic Price: $0.6500 Probability: 65.0% --- Outcome: Republican Price: $0.3500 Probability: 35.0% ---
{ "market_id": { "type": "string", "description": "Market ID or slug" }, "timeframe": { "type": "string", "description": "Time period for historical data", "enum": ["1d", "7d", "30d", "all"], "default": "7d" } }
Historical Data for US Presidential Election 2024 Time Period: 7d Time: 2024-01-20T12:00:00Z Price: $0.6500 Volume: $123,456.78 --- Time: 2024-01-19T12:00:00Z Price: $0.6300 Volume: $98,765.43 ---

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.

- Python 3.9 or higher
- httpx>=0.24.0
- mcp-core
- python-dotenv>=1.0.0

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 is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Interact with over 100 cryptocurrency exchange APIs using the CCXT library.

Provides tools for interacting with the EDUCHAIN blockchain, including wallet, swap, and arbitrage operations on SailFish DEX.

A server for interacting with the Futarchy protocol on the Solana blockchain.

Interact with the Hyperliquid decentralized exchange by integrating its SDK.

AI-native crypto trading server with 13 tools for market data, order execution, grid strategies, and Cardano DeFi across multiple exchanges.

An MCP server for the Osmosis Agent Toolkit, enabling interactions with the Osmosis blockchain.

A FastMCP implementation of the in-house MCP servers used by Units of the Rei Network.

An MCP server for the XRP Ledger blockchain, offering tools for wallet operations, token management, NFTs, and DEX trading.

WunderTrading MCP connects AI agents to live crypto trading execution on 20+ supported exchanges through a single MCP integration. Use it to turn AI-driven signals, market analysis, sentiment, screenshots, and custom strategy logic into real trades on exchanges including Binance, Bybit, Coinbase, Bitget, OKX, KuCoin, Hyperliquid, and BingX. Supports MCP and REST API workflows for order execution, trade management, and AI-powered automation.

Manage stock and crypto portfolios, place trades, and access market data via the Alpaca Trading API.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.