> ## 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.

# AI agent developer

> Drop the Predexon MCP server into Claude, Cursor, or Codex. Five recipes for agents that read markets and place trades.

You're building agents that need prediction-market context — research assistants, trading bots, position monitors, alert systems. The Predexon MCP server gives any MCP-aware model access to 39 tools spanning every surface above, behind one drop-in package.

**You'll be ready to:**

* Install the MCP server in any major agent runtime
* Compose Predexon tools with your own
* Build the five most common agent patterns (research, monitor, alert, copy-trade, arb)

***

## 60-second install

Pick your runtime, paste the config, restart.

<Tabs>
  <Tab title="Claude Desktop">
    Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

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

    Restart Claude Desktop. Ask: *"List the top 5 Polymarket markets by volume."*
  </Tab>

  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add predexon npx predexon-mcp
    ```
  </Tab>

  <Tab title="Cursor">
    Edit `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per-project):

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

  <Tab title="Codex">
    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"
    ```
  </Tab>
</Tabs>

Full config matrix (VS Code, Cline, etc.) on the [MCP Server page](/mcp-server).

***

## The 39 tools at a glance

| Category                          | Count | What it covers                                                    |
| --------------------------------- | ----- | ----------------------------------------------------------------- |
| Cross-platform matching           | 2     | LLM-powered equivalence between venues                            |
| Polymarket markets                | 9     | Lists, events, prices, candles, volume, OI, orderbooks            |
| Polymarket trading                | 5     | Trades, activity, positions, P\&L                                 |
| Polymarket smart-money            | 12    | Profiles, leaderboards, top holders, smart-activity, cohort stats |
| Kalshi                            | 3     | Markets, trades, orderbooks                                       |
| Binance                           | 2     | Crypto reference ticks + candles                                  |
| Limitless / Opinion / Predict.Fun | 6     | Markets + orderbooks per venue                                    |

Full tool list with descriptions on the [MCP Server page](/mcp-server).

***

## Recipe 1 — Market research assistant

**Use case**: "What's happening in election markets right now?" Agent surveys, summarizes, cites.

**System prompt sketch**:

```
You are a prediction-market research assistant. When asked about a topic:
1. Use `list_polymarket_markets` to find relevant markets (filter by status="open").
2. For markets with $1M+ volume, fetch `get_polymarket_candlesticks` for the last 7 days
   to identify price moves.
3. Use `get_polymarket_smart_money` on any market where price moved >5% to check if
   profitable wallets are buying or selling.
4. Summarize: which markets matter, what's the price action, what is smart money doing,
   what events are upcoming. Always cite the market slug and source endpoint.
```

The agent will compose tools without further prompting. Add `find_matching_markets` if you want it to cite Kalshi prices side-by-side.

***

## Recipe 2 — Position monitor

**Use case**: Daily digest of how a wallet's portfolio moved overnight.

**System prompt sketch**:

```
Run daily for wallet 0x.... :
1. `get_polymarket_positions` to enumerate current positions.
2. For each position, `get_polymarket_price` to compute mark-to-market vs cost basis.
3. `get_polymarket_pnl` for the period since last run.
4. Output a digest: wins, losers, biggest mover, total P&L delta, anything that
   resolved overnight.
```

Pair with a cron tool (most agent runtimes have one) for fully autonomous reporting.

***

## Recipe 3 — Smart-money alerter

**Use case**: Real-time alert when profitable wallets enter a market you care about.

This one streams instead of polling. Agent runtimes that support background MCP tool use (Claude Code, custom builds) can call:

```
Every 5 minutes:
1. `get_polymarket_smart_activity` to see which markets smart money entered.
2. Filter to markets matching my watchlist (keywords: "election", "fed", "btc").
3. For each new entry, fetch `get_polymarket_smart_money` to see net positioning.
4. If net buy >$50k in the last hour, alert me with market name, smart-money flow,
   current price.
```

Cheaper agents can run this on a 15-min cadence with `get_polymarket_smart_activity` alone.

***

## Recipe 4 — Copy-trader

**Use case**: Mirror a high-performing wallet's trades into your own account.

Requires both Predexon MCP and a tool for your Trading API account. Sketch:

```
Watching wallet 0xSmartTrader on Polymarket:
1. `get_polymarket_wallet_profile` once at startup to verify they're still profitable.
2. Every minute: `get_polymarket_trades` filtered by user=0xSmartTrader since last check.
3. For each new trade: scale their size to my account size (e.g. 10% of theirs),
   then place a matching order via the Trading API.
4. Log every mirror attempt with success/failure and slippage.
```

The Trading API call is a separate tool — see [Copy-trade cookbook recipe](/start-here/cookbook/copy-trade-wallet) for the production version.

***

## Recipe 5 — Cross-venue arbitrage scout

**Use case**: Find live arb opportunities and quote them in chat.

```
On request:
1. `get_matched_pairs` for all active cross-venue pairs.
2. For each pair, fetch current price on each venue (`get_polymarket_price`,
   `get_kalshi_*`, etc.).
3. Compute the spread net of fees (1% Polymarket, 0% Kalshi).
4. Surface any spread >2% with: market name, prices on each venue, implied
   round-trip profit on $10k.
```

The harder version actually executes the arb. That's [Cross-Venue Arbitrage cookbook](/start-here/cookbook/cross-venue-arbitrage) — same logic, applied to live pairs.

***

## Tips for building good agents on Predexon

<AccordionGroup>
  <Accordion title="Prefer smart-money tools over raw trades">
    `get_polymarket_smart_money` and `get_polymarket_smart_activity` already filter to profitable wallets. Using them keeps your context window small and signal-to-noise high vs. paginating the raw trades endpoint.
  </Accordion>

  <Accordion title="Use matched markets, not text search, for cross-venue">
    `find_matching_markets` is LLM-curated equivalence — much more reliable than asking the agent to text-match Polymarket and Kalshi questions itself. Cite both sides when reporting.
  </Accordion>

  <Accordion title="Bound the wallet space before profile lookups">
    `get_polymarket_wallet_profiles` (batch) accepts up to 20 wallets per call. Have the agent batch lookups when summarizing a leaderboard.
  </Accordion>

  <Accordion title="Watch for stale data on resolved markets">
    Markets that resolved 2+ weeks ago may not appear in default queries. Add `archived=true` if your agent needs to reason about historical resolutions.
  </Accordion>

  <Accordion title="Don't combine wildcard WS subscriptions with the MCP server">
    The MCP server uses REST. For wildcard firehose streaming, connect to the WebSocket directly — it's not a fit for chat-loop agent runtimes.
  </Accordion>
</AccordionGroup>

***

## What you should read next

<CardGroup cols={2}>
  <Card title="Full MCP server reference" icon="brain" href="/mcp-server">
    Complete tool list with descriptions, all runtime configurations.
  </Card>

  <Card title="Cookbook" icon="book" href="/start-here/cookbook/copy-trade-wallet">
    Production-grade recipes you can crib from.
  </Card>

  <Card title="Data & Signals overview" icon="chart-line" href="/data-signals/overview">
    The REST endpoints behind every MCP tool.
  </Card>

  <Card title="Builder Architecture Guide" icon="cube" href="/start-here/builder-guide">
    If your agent places trades — account model, custody, fee monetization.
  </Card>
</CardGroup>
