Pariflow Agent MCP

Official stdio MCP server and DEMO-first CLI (19 tools) for Pariflow prediction markets, 211 perpetual futures (crypto, 24/7 equities/gold, Pre-IPO SpaceX/Anthropic/OpenAI), whale-flow screening, trade previews, and bounded DEMO-only 30-day scheduled strategies.

Documentation

Pariflow Agent MCP Server & CLI

License: MIT Node.js >= 20 Pariflow Agent MCP server

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)

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 StageAlerts CutRemaining
Raw 30-day Polymarket whale-alert window—26,885
Buy side only−6,56120,324
Trade size ≥ $70,000−17,8172,507
Maps cleanly to 1 exact outcome−1,1441,363
Resolves within 7 days−681682
No earlier opposite ≥$70k whale in same event−346336
Fits bankroll/daily/exposure risk caps−27660 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.

CategoryMCP ToolPermissionPurpose
Onboardingget_startedlocal readReturns safe flow, starter prompts, and response rules
Accountget_account_summaryreadBalances (DEMO/LIVE), active mode, and account risk limits
Discoveryget_top_tradesreadLargest mapped trades (date, limit, source, accountType, minAmount)
Discoverysearch_marketsreadSearch prediction events and perps (q, type: ALL|PREDICTION|PERP, limit)
Discoveryresolve_marketreadResolve external title/whale print to exact Pariflow event/outcome IDs
Discoveryprepare_trade_targettradeMap a missing outcome for a trusted high-confidence signal (never executes)
Predictionspreview_tradereadEstimated fill price (LIVE returns short-lived quoteId + quoteExpiresAt)
Predictionsplace_tradetradeExecute DEMO or LIVE order (requires confirm: true + idempotencyKey)
Predictionslist_ordersreadInspect recent orders (status, eventId, accountType, limit, offset)
Perpslist_perpsreadList 211 perp instruments with live mark prices, hourly funding, max leverage
Perpsget_perp_marketreadLive market bounds, fees, and funding for one perp symbol (e.g., SPCX, BTC)
Perpspreview_perp_orderreadPreview fill price, required isolated margin, est. liquidation price, fee
Perpsplace_perp_ordertradeExecute DEMO/LIVE perp order (confirm: true, idempotencyKey, reduceOnly)
Perpslist_perp_positionsreadList open perp positions (entry, mark, leverage, unrealized P&L)
Strategiescreate_strategytradeSave a persistent DEMO-only strategy draft (DRAFT state)
Strategiesstart_strategytradeActivate draft (confirm: true, runNow default true); runs server-side
Strategiespause_strategytradeStop future scans while keeping run history
Strategiesget_strategy_statusreadInspect lifecycle state, latest run totals, end date, and next scan
Strategieslist_strategiesreadList 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.


Glama MCP Directory

This server is listed on the Glama MCP Server Directory, where you can browse all 19 tools, inspect quality checks, and test the server online with MCP Inspector:

Pariflow Agent MCP server

Documentation & Links