Skip to main content
Glama
Pariflow Agent MCP

Pariflow Agent MCP

Pariflow Agent MCP Server & CLI

License: MIT Node.js >= 20

Self-contained open-source Model Context Protocol (MCP) stdio server (src/pariflow-agent.mjs), CLI, and DEMO-first strategy workflows for Pariflow (pariflow.com).

Built on @modelcontextprotocol/sdk and zod, the server exposes 19 annotated MCP tools and 1 prompt directly from this repository so Claude Code, Codex, Cursor, or any MCP client can inspect prediction markets, screen whale flow, preview orders, inspect 211 perpetual futures (including Pre-IPO SpaceX/Anthropic/OpenAI and 24/7 NVDA/TSLA/Gold/S&P 500), and schedule 30-day server-side DEMO-only strategies on a free $10,000 virtual balance.

Important Safety Boundaries

  • Read-only keys cannot trade. Start with a read-only key for discovery, account checks, and order previews.

  • Scheduled strategy automation is strictly DEMO-only. Server-side strategies (create_strategy / start_strategy) cannot use LIVE funds (DEMO_ONLY_AUTOMATION).

  • Drafts never auto-start. create_strategy only saves rules; start_strategy requires explicit confirm: true.

  • Direct orders require explicit confirmation + idempotency key. place_trade and place_perp_order reject execution without confirm: true and a fresh idempotencyKey (CONFIRM_REQUIRED).

  • Not affiliated with Paraflow. Pariflow (pariflow.com) is a prediction market and perpetual futures trading platform; it is unrelated to the Paraflow AI design tool.


Requirements

  • OS: macOS or Linux

  • Runtime: Node.js 20+ and npm

  • Account: Free Pariflow account with $10,000 virtual demo balance (https://pariflow.com/trading-demo — email or Google sign-up, no card or deposit required)


Related MCP server: Polymarket MCP Server

Quick Setup (Run Directly From Source or Docker)

Option A — Clone and Run Locally (Node.js 20+)

git clone https://github.com/Aduersarius/pariflow-agent-starter.git
cd pariflow-agent-starter
npm install

# Verify the local MCP stdio server handshake (registers all 19 tools)
npm run test:smoke

# Configure a scoped API key from https://pariflow.com -> Settings -> Agent access
export PARIFLOW_API_KEY=YOUR_AGENT_KEY
export PARIFLOW_BASE_URL=https://pariflow.com

# Start the stdio MCP server directly from this repository
npm start

Option B — Run via Docker (Built From This Repository)

docker build -t pariflow-agent-mcp .
docker run -i --rm -e PARIFLOW_API_KEY=YOUR_AGENT_KEY pariflow-agent-mcp

Configure MCP Clients

Claude Code (claude mcp add)

claude mcp add pariflow -- node /absolute/path/to/pariflow-agent-starter/src/pariflow-agent.mjs mcp

Cursor (.cursor/mcp.json) / Claude Desktop / Generic MCP Clients

{
  "mcpServers": {
    "pariflow": {
      "command": "node",
      "args": ["/absolute/path/to/pariflow-agent-starter/src/pariflow-agent.mjs", "mcp"],
      "env": {
        "PARIFLOW_API_KEY": "YOUR_AGENT_KEY",
        "PARIFLOW_BASE_URL": "https://pariflow.com"
      }
    }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.pariflow]
command = "node"
args = ["/absolute/path/to/pariflow-agent-starter/src/pariflow-agent.mjs", "mcp"]

(You can also save credentials locally via PARIFLOW_API_KEY=YOUR_AGENT_KEY node src/pariflow-agent.mjs configure, which writes ~/.pariflow/agent.json with 0600 owner-only permissions.)

Verify the server responds by asking your agent to call get_started and get_account_summary.


Reproducing the 30-Day Whale-Tape Replay Workflow

This repo implements the exact rule set tested in Pariflow Research's 30-day paper replay (methodology & full trade log, May 29 – June 27, 2026):

Filter Stage

Alerts Cut

Remaining

Raw 30-day Polymarket whale-alert window

—

26,885

Buy side only

−6,561

20,324

Trade size ≥ $70,000

−17,817

2,507

Maps cleanly to 1 exact outcome

−1,144

1,363

Resolves within 7 days

−681

682

No earlier opposite ≥$70k whale in same event

−346

336

Fits bankroll/daily/exposure risk caps

−276

60 copied trades

Recorded Replay Metrics & Honest Caveats (Paper Only — No Live Funds):

  • Paper result: $5,000 start → $8,954.09 (+79.1%), peaking at $10,284 on June 24; 48 wins / 12 losses (80% win rate); $22,449 total staked across 37 events (all 60 resolved within 22h; 42/60 within 3h).

  • Day-1 Drawdown: The first 3 copied trades all lost (Thunder vs. Spurs $500 @ 42¢, SK Brann twice $270 @ 57¢ and $230 @ 58¢), dropping the paper account −20% to $4,000 before its first win.

  • High-Price Tail Risk (≥90¢): 11 copies entered at 90¢+ won 10 times (+$87) and lost once (Spain @ 92¢, −$479) for −$392 net.

  • Duplicate Event Concentration: 18 of 37 events were copied more than once; half of all 12 losses came from double-copied events (SK Brann, Turkiye, Korea Republic).

  • Slippage Assumption: The replay assumed flat 1¢ slippage rather than full live orderbook depth impact.

Because of those findings, scripts/run-demo-strategy.mjs adds two client-side pre-flight guardrails when reviewing live candidates: flagging entries >= 0.90 and flagging duplicate events before you confirm anything.

Run the Starter Script (Safe Read-Only Dry Run First)

# Step 1: Read-only shortlist (zero orders, zero strategy writes)
node scripts/run-demo-strategy.mjs --mode scan

# Step 2: Create a DEMO strategy DRAFT (does NOT start or place orders)
node scripts/run-demo-strategy.mjs --mode draft --config configs/whale-replay-demo.json

# Step 3: Explicitly activate the DEMO strategy after inspecting the draft ID
node scripts/run-demo-strategy.mjs --mode start --strategy-id <STRATEGY_ID>

# Step 4: Check latest scheduled run, accepted/skipped counts, and next scan time
node scripts/run-demo-strategy.mjs --mode status --strategy-id <STRATEGY_ID>

# Step 5: Pause without deleting run history
node scripts/run-demo-strategy.mjs --mode pause --strategy-id <STRATEGY_ID> --reason "Completed demo test"

Bonus: Inspect Pre-IPO & 24/7 TradFi Perpetuals via CLI

# Read-only scan of SpaceX (SPCX), Anthropic (ANT / IO-ANTH), OpenAI (IO-OAI), NVDA, GOLD, SP500
node scripts/inspect-preipo-perps.mjs

Complete MCP Tool Surface (19 Tools + 1 Prompt)

Implemented in src/pariflow-agent.mjs and verified locally by npm run test:smoke (scripts/smoke-mcp.mjs). Every tool carries standard MCP readOnlyHint / destructiveHint / idempotentHint annotations.

Category

MCP Tool

Permission

Purpose

Onboarding

get_started

local read

Returns safe flow, starter prompts, and response rules

Account

get_account_summary

read

Balances (DEMO/LIVE), active mode, and account risk limits

Discovery

get_top_trades

read

Largest mapped trades (date, limit, source, accountType, minAmount)

Discovery

search_markets

read

Search prediction events and perps (q, type: ALL|PREDICTION|PERP, limit)

Discovery

resolve_market

read

Resolve external title/whale print to exact Pariflow event/outcome IDs

Discovery

prepare_trade_target

trade

Map a missing outcome for a trusted high-confidence signal (never executes)

Predictions

preview_trade

read

Estimated fill price (LIVE returns short-lived quoteId + quoteExpiresAt)

Predictions

place_trade

trade

Execute DEMO or LIVE order (requires confirm: true + idempotencyKey)

Predictions

list_orders

read

Inspect recent orders (status, eventId, accountType, limit, offset)

Perps

list_perps

read

List 211 perp instruments with live mark prices, hourly funding, max leverage

Perps

get_perp_market

read

Live market bounds, fees, and funding for one perp symbol (e.g., SPCX, BTC)

Perps

preview_perp_order

read

Preview fill price, required isolated margin, est. liquidation price, fee

Perps

place_perp_order

trade

Execute DEMO/LIVE perp order (confirm: true, idempotencyKey, reduceOnly)

Perps

list_perp_positions

read

List open perp positions (entry, mark, leverage, unrealized P&L)

Strategies

create_strategy

trade

Save a persistent DEMO-only strategy draft (DRAFT state)

Strategies

start_strategy

trade

Activate draft (confirm: true, runNow default true); runs server-side

Strategies

pause_strategy

trade

Stop future scans while keeping run history

Strategies

get_strategy_status

read

Inspect lifecycle state, latest run totals, end date, and next scan

Strategies

list_strategies

read

List saved strategies filtered by DRAFT|ACTIVE|PAUSED|COMPLETED

CLI Safety Defaults: preview-trade, trade, preview-perp, and trade-perp all default accountMode to DEMO unless --account-mode LIVE is passed explicitly. Both --confirm and --confirm=true are accepted on start-strategy.


Available Tools

19 tools
create_strategyCreate StrategyB

Create a persistent DEMO-only strategy draft. This does not start automation or place orders.

Inputs: name, maxRiskPct, minRiskPct, accountMode, +9 more.

get_account_summaryGet Account SummaryA
Read-onlyIdempotent

Return balances, current account mode, and agent trading limits.

Inputs: no named parameters.

get_perp_marketGet Perpetual MarketA
Read-onlyIdempotent

Get real-time market data, price bounds, fees, and funding for one perpetual futures contract. Symbol is the venue coin, e.g. BTC.

Inputs: symbol (required).

get_startedGet StartedA
Read-onlyIdempotent

Return the recommended Pariflow Agent MCP onboarding prompts, safe flow, and response rules.

Inputs: no named parameters.

get_strategy_statusGet Strategy StatusB
Read-onlyIdempotent

Return a strategy lifecycle status, latest run, totals, and next scheduled scan.

Inputs: strategyId (required).

get_top_tradesGet Top TradesC
Read-onlyIdempotent

Return the largest whale-alert or Pariflow market trades for a date.

Inputs: date, limit, source, minAmount, +1 more.

list_ordersList OrdersC
Read-onlyIdempotent

List the authenticated user orders visible to this agent key.

Inputs: limit, offset, status, eventId, +1 more.

list_perp_positionsList Perpetual PositionsB
Read-onlyIdempotent

List the authenticated user open perpetual futures positions with entry price, mark price, leverage, and unrealized PnL.

Inputs: accountType.

list_perpsList Perpetual MarketsB
Read-onlyIdempotent

List every tradeable perpetual futures market (symbol is the venue coin, e.g. BTC) with live mark prices, funding rates, and max leverage.

Inputs: limit, offset, symbol, assetClass.

list_strategiesList StrategiesC
Read-onlyIdempotent

List the authenticated account strategies and their latest run.

Inputs: limit, status.

pause_strategyPause StrategyB
Idempotent

Pause an active strategy and clear its next scheduled scan.

Inputs: strategyId (required), reason.

place_perp_orderPlace Perpetual OrderB
DestructiveIdempotent

Place a confirmed perpetual futures order. Requires exact symbol, side (BUY/SELL), size, leverage, confirm=true, and fresh idempotencyKey.

Inputs: side (required), size (required), symbol (required), confirm (required), +4 more.

place_tradePlace TradeC
DestructiveIdempotent

Place a confirmed Pariflow trade. Requires exact market identifiers, confirm=true, and idempotencyKey.

Inputs: side (required), amount (required), confirm (required), eventId (required), +10 more.

prepare_trade_targetPrepare Trade TargetB

Create or map a missing Pariflow outcome for a trusted whale print or high-confidence exact event match, then return an exact preview_trade target. Requires trade permission; never executes orders.

Inputs: q, side, limit, eventId, +4 more.

preview_perp_orderPreview Perpetual OrderB
Read-onlyIdempotent

Preview a perpetual futures order (estimated fill price, required margin, est liquidation price, fee).

Inputs: side (required), size (required), symbol (required), leverage (required), +1 more.

preview_tradePreview TradeC
Read-onlyIdempotent

Preview a Pariflow trade without execution.

Inputs: side (required), amount (required), eventId (required), price, +8 more.

resolve_marketResolve MarketB
Read-onlyIdempotent

Resolve external event/outcome text to Pariflow event and outcome candidates. Returns exact ids only; never executes trades.

Inputs: q, side, limit, eventId, +4 more.

search_marketsSearch MarketsB
Read-onlyIdempotent

Search Pariflow markets (Prediction events and Perpetual futures) by team, league, symbol, slug, or market text. Returns candidates only.

Inputs: q (required), type, limit.

start_strategyStart StrategyB
Destructive

Explicitly activate a DEMO-only strategy. Runs the first scan now by default and schedules future scans.

Inputs: confirm (required), strategyId (required), runNow.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 19 tools

    Disambiguation4/5

    Most tools target a distinct resource+action: market discovery (search_markets), resolution (resolve_market), execution (place_trade), and perp/strategy operations are clearly separated by descriptions. The one soft spot is the trade-targeting chain — resolve_market, prepare_trade_target, and preview_trade overlap in intent, since prepare_trade_target both creates outcomes and returns a preview_trade target, which can make an agent pause over which entry point to use.

    Naming Consistency4/5

    Consistent snake_case verb_noun pattern throughout (get_, list_, search_, preview_, place_, create_, start_, pause_). Minor deviations: the noun for the same domain shifts between 'trade' and 'order' (place_trade vs list_orders), and perps are referred to variably as list_perps, get_perp_market, preview_perp_order, list_perp_positions.

    Tool Count4/5

    19 tools spread across three coherent sub-surfaces (prediction-market trades, perpetual futures, DEMO strategies) with roughly parallel tool sets in each, so most tools earn their place. It is on the heavy side of the ideal range, and the strategy suite plus the trade-targeting trio add some bulk.

    Completeness3/5

    Core flows (discover → resolve → preview → place, plus perp data/positions and strategy lifecycle) are covered, but there are notable gaps: no cancel-order tool, no single prediction-market detail lookup analogous to get_perp_market, and the strategy suite has create/start/pause/status/list but no update or delete/stop-with-cleanup.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Self-hosted MCP server for trading on Kalshi prediction markets via DFlow on Solana, enabling account management, market discovery, trading, swaps, transfers, and redemption.
      15 npm
      1
      PolyForm Noncommercial 1.0.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      A monetizable remote MCP server that provides prediction-market intelligence tools for AI agents, enabling discovery, evaluation, and mispricing detection across venues like Polymarket and Kalshi with per-call payment.
      1
      -
    • A
      license
      A
      quality
      B
      maintenance
      Prediction-market MCP server for Kalshi and Polymarket: market search, live order books and quotes, each venue's fee schedule, fee-aware no-arbitrage checks across related event contracts, and paper orders that walk the book.
      14
      48 PyPI
      572
      Apache 2.0