> ## Documentation Index
> Fetch the complete documentation index at: https://docs.predexon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Use Predexon API with AI assistants via Model Context Protocol

Drop one config block into Claude Desktop, Cursor, or Codex and your assistant can reason about prediction markets directly — no boilerplate HTTP calls, no SDK plumbing. Try this in Claude after install:

> *"What's the smart-money flow on the top 5 Polymarket markets right now, and which wallets are driving it?"*

Claude composes the tools below — `list_polymarket_markets`, `get_polymarket_smart_money`, `get_polymarket_wallet_pnl` — to answer in one round-trip. Same key gates the same data you'd get from REST; same plan limits apply.

<Info>
  **Building an agent on top of this?** [Agent Cookbook](/start-here/agent-cookbook) walks five concrete patterns — research assistant, position monitor, smart-money alerter, copy-trade watcher, wallet analyst — with system prompts you can paste straight in.
</Info>

## What is MCP?

[Model Context Protocol (MCP)](https://modelcontextprotocol.io) is the open standard for letting AI assistants call external tools. Predexon ships an MCP server that exposes every relevant Data API endpoint as a typed tool — so models that support MCP (Claude, Cursor, Codex, Cline, VS Code Copilot) can pull live market data, wallet analytics, and smart-money signals without you writing a single fetch call. Example questions that work out of the box:

* "What are the top prediction markets by volume?"
* "Show me the price history for this market"
* "Which profitable wallets are buying this market right now?"
* "What positions does this wallet hold?"
* "What Limitless markets are open right now?"

## Installation

Install the Predexon MCP server from npm:

```bash theme={null}
npm install -g predexon-mcp
```

Or run directly with npx (no installation required):

```bash theme={null}
npx predexon-mcp
```

## Configuration

<Tabs>
  <Tab title="Claude Desktop">
    Edit your Claude Desktop configuration file:

    **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`

    **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

    ```json theme={null}
    {
      "mcpServers": {
        "predexon": {
          "command": "npx",
          "args": ["-y", "predexon-mcp"],
          "env": {
            "PREDEXON_API_KEY": "your-key"
          }
        }
      }
    }
    ```

    Restart Claude Desktop after saving.
  </Tab>

  <Tab title="Claude Code">
    Add the MCP server via CLI:

    ```bash theme={null}
    claude mcp add predexon npx predexon-mcp
    ```

    Or manually edit `~/.claude.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "predexon": {
          "command": "npx",
          "args": ["-y", "predexon-mcp"],
          "env": {
            "PREDEXON_API_KEY": "your-key"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Cursor">
    Cursor supports both global and project-specific MCP configuration.

    **Global** (all projects): `~/.cursor/mcp.json`

    **Project-specific**: `.cursor/mcp.json` in your project root

    ```json theme={null}
    {
      "mcpServers": {
        "predexon": {
          "command": "npx",
          "args": ["-y", "predexon-mcp"],
          "env": {
            "PREDEXON_API_KEY": "your-key"
          }
        }
      }
    }
    ```

    Verify the connection in **Settings > Cursor Settings > MCP**. A green dot indicates the server is connected.

    [Cursor MCP Docs](https://cursor.com/docs/context/mcp)
  </Tab>

  <Tab title="VS Code">
    VS Code supports MCP servers through GitHub Copilot.

    **Global**: Open your user `mcp.json` via Command Palette

    **Project-specific**: `.vscode/mcp.json` in your workspace

    ```json theme={null}
    {
      "servers": {
        "predexon": {
          "command": "npx",
          "args": ["-y", "predexon-mcp"],
          "env": {
            "PREDEXON_API_KEY": "your-key"
          }
        }
      }
    }
    ```

    Or add via CLI:

    ```bash theme={null}
    code --add-mcp '{"name":"predexon","command":"npx","args":["-y","predexon-mcp"],"env":{"PREDEXON_API_KEY":"your-key"}}'
    ```

    [VS Code MCP Docs](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)
  </Tab>

  <Tab title="Cline">
    In Cline, click the **MCP Servers** icon in the sidebar, then click **Edit MCP Settings** to open the configuration file. Add:

    ```json theme={null}
    {
      "mcpServers": {
        "predexon": {
          "command": "npx",
          "args": ["-y", "predexon-mcp"],
          "env": {
            "PREDEXON_API_KEY": "your-key"
          }
        }
      }
    }
    ```

    [Cline MCP Docs](https://docs.cline.bot/mcp/configuring-mcp-servers)
  </Tab>

  <Tab title="Codex">
    OpenAI Codex CLI uses TOML configuration. Edit `~/.codex/config.toml`:

    ```toml theme={null}
    [mcp_servers.predexon]
    command = "npx"
    args = ["-y", "predexon-mcp"]

    [mcp_servers.predexon.env]
    PREDEXON_API_KEY = "your-key"
    ```

    Or add via CLI:

    ```bash theme={null}
    codex mcp add predexon -- npx -y predexon-mcp
    ```

    [Codex MCP Docs](https://developers.openai.com/codex/mcp/)
  </Tab>
</Tabs>

## Available Tools

The MCP server exposes tools covering market data, smart-wallet analytics, and trading insights across six platforms.

### Polymarket - Market Data

| Tool                           | Description                                                                  |
| ------------------------------ | ---------------------------------------------------------------------------- |
| `list_polymarket_markets`      | List markets with filtering and sorting                                      |
| `get_polymarket_events`        | List events (top-level groupings of markets)                                 |
| `get_polymarket_crypto_updown` | List crypto up/down prediction markets (BTC, ETH, SOL, XRP, HYPE, DOGE, BNB) |
| `get_polymarket_price`         | Get current or historical price for a token                                  |
| `get_polymarket_candlesticks`  | Get OHLCV candlestick data                                                   |
| `get_polymarket_volume`        | Get cumulative volume time series                                            |
| `get_polymarket_volume_chart`  | Get per-period volume with YES/NO side split                                 |
| `get_polymarket_open_interest` | Get historical open interest                                                 |
| `get_polymarket_orderbooks`    | Get historical orderbook snapshots                                           |

### Polymarket - Trading

| Tool                           | Description                                              |
| ------------------------------ | -------------------------------------------------------- |
| `get_polymarket_trades`        | Query historical trade data                              |
| `get_polymarket_activity`      | Get on-chain activity (split/merge/redeem events)        |
| `get_polymarket_positions`     | Get positions for a wallet                               |
| `get_polymarket_all_positions` | Fetch positions across all wallets (analytics/streaming) |
| `get_polymarket_pnl`           | Get realized P\&L history for a wallet                   |

### Polymarket - Smart Wallet Analytics

<Note>
  Smart wallet tools require a **Dev plan** API key or higher.
</Note>

| Tool                                 | Description                                                         |
| ------------------------------------ | ------------------------------------------------------------------- |
| `get_polymarket_wallet_profile`      | Get complete wallet profile with metrics and style classifications  |
| `get_polymarket_wallet_profiles`     | Batch wallet profiles - fetch up to 20 profiles in a single request |
| `get_polymarket_leaderboard`         | Global leaderboard of smart wallets                                 |
| `get_polymarket_market_leaderboard`  | Wallet rankings for a specific market                               |
| `get_polymarket_top_holders`         | Top token holders for a market by position size                     |
| `get_polymarket_wallet_markets`      | Per-market performance breakdown for a wallet                       |
| `get_polymarket_wallet_volume_chart` | Per-period volume with BUY/SELL breakdown for a wallet              |
| `get_polymarket_wallets_filter`      | Filter wallets by market trades with AND/OR logic                   |
| `get_polymarket_smart_activity`      | Discover markets where high-performing wallets are active           |
| `get_polymarket_smart_money`         | Net buyers vs sellers among smart wallets for a market              |
| `get_polymarket_similar_wallets`     | Find wallets with similar portfolios (copy-trade detection)         |
| `get_polymarket_cohort_stats`        | Compare performance across trading style cohorts                    |

### Kalshi

| Tool                    | Description                             |
| ----------------------- | --------------------------------------- |
| `list_kalshi_markets`   | List markets with filtering and sorting |
| `get_kalshi_trades`     | Fetch historical trade data             |
| `get_kalshi_orderbooks` | Fetch historical orderbook snapshots    |

### Binance

<Note>
  Binance tools require a **Dev plan** API key or higher. Supported symbols: BTCUSDT, ETHUSDT, SOLUSDT, XRPUSDT.
</Note>

| Tool                  | Description                                            |
| --------------------- | ------------------------------------------------------ |
| `get_binance_ticks`   | Get raw book ticker data at microsecond granularity    |
| `get_binance_candles` | Get OHLCV candlestick data from book ticker mid-prices |

### Limitless

| Tool                       | Description                             |
| -------------------------- | --------------------------------------- |
| `list_limitless_markets`   | List markets with filtering and sorting |
| `get_limitless_orderbooks` | Fetch historical orderbook snapshots    |

### Opinion

| Tool                     | Description                             |
| ------------------------ | --------------------------------------- |
| `list_opinion_markets`   | List markets with filtering and sorting |
| `get_opinion_orderbooks` | Fetch historical orderbook snapshots    |

### Predict.Fun

| Tool                        | Description                             |
| --------------------------- | --------------------------------------- |
| `list_predictfun_markets`   | List markets with filtering and sorting |
| `get_predictfun_orderbooks` | Fetch historical orderbook snapshots    |

## Example Usage

Once configured, you can ask your AI assistant questions naturally:

<CodeGroup>
  ```text Query Markets theme={null}
  "What are the top 5 Polymarket markets by volume right now?"
  ```

  ```text Price History theme={null}
  "Show me the price history for the Trump 2024 election market over the last week"
  ```

  ```text Cross-Platform theme={null}
  "Find the Kalshi equivalent of this Polymarket market: will-bitcoin-hit-100k-in-2024"
  ```

  ```text Wallet Analysis theme={null}
  "What positions does wallet 0x1234... hold on Polymarket?"
  ```

  ```text Limitless theme={null}
  "Show me the highest volume Limitless markets"
  ```

  ```text Predict.Fun theme={null}
  "What Predict.Fun sports markets are open?"
  ```
</CodeGroup>

## Authentication

Set your API key via the `PREDEXON_API_KEY` environment variable in your MCP configuration (see the config examples above). The server reads this automatically on startup.

As a fallback, you can also pass `api_key` as a parameter on individual tool calls, but the env var approach is recommended - it keeps your key out of conversation text and works across all tools automatically.

<Tip>
  Get your free API key at [dashboard.predexon.com](https://dashboard.predexon.com)
</Tip>

## Source Code

The MCP server is open source:

* **npm**: [npmjs.com/package/predexon-mcp](https://www.npmjs.com/package/predexon-mcp)

## Next Steps

<CardGroup cols={2}>
  <Card title="Data & Signals" icon="book" href="/data-signals/overview">
    Explore every endpoint with interactive playground
  </Card>

  <Card title="Get API Key" icon="key" href="https://dashboard.predexon.com">
    Sign up for free access
  </Card>
</CardGroup>
