Pariflow Agent MCP
Pariflow Agent MCP Server & CLI
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 useLIVEfunds (DEMO_ONLY_AUTOMATION).Drafts never auto-start.
create_strategyonly saves rules;start_strategyrequires explicitconfirm: true.Direct orders require explicit confirmation + idempotency key.
place_tradeandplace_perp_orderreject execution withoutconfirm: trueand a freshidempotencyKey(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
npmAccount: Free Pariflow account with
$10,000virtual 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 startOption 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-mcpConfigure MCP Clients
Claude Code (claude mcp add)
claude mcp add pariflow -- node /absolute/path/to/pariflow-agent-starter/src/pariflow-agent.mjs mcpCursor (.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,000start →$8,954.09(+79.1%), peaking at$10,284on June 24; 48 wins / 12 losses (80% win rate);$22,449total 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,000before 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.mjsComplete 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 |
| local read | Returns safe flow, starter prompts, and response rules |
Account |
|
| Balances ( |
Discovery |
|
| Largest mapped trades ( |
Discovery |
|
| Search prediction events and perps ( |
Discovery |
|
| Resolve external title/whale print to exact Pariflow event/outcome IDs |
Discovery |
|
| Map a missing outcome for a trusted high-confidence signal (never executes) |
Predictions |
|
| Estimated fill price ( |
Predictions |
|
| Execute |
Predictions |
|
| Inspect recent orders ( |
Perps |
|
| List 211 perp instruments with live mark prices, hourly funding, max leverage |
Perps |
|
| Live market bounds, fees, and funding for one perp symbol (e.g., |
Perps |
|
| Preview fill price, required isolated margin, est. liquidation price, fee |
Perps |
|
| Execute |
Perps |
|
| List open perp positions ( |
Strategies |
|
| Save a persistent DEMO-only strategy draft ( |
Strategies |
|
| Activate draft ( |
Strategies |
|
| Stop future scans while keeping run history |
Strategies |
|
| Inspect lifecycle state, latest run totals, end date, and next scan |
Strategies |
|
| List saved strategies filtered by |
CLI Safety Defaults:
preview-trade,trade,preview-perp, andtrade-perpall defaultaccountModetoDEMOunless--account-mode LIVEis passed explicitly. Both--confirmand--confirm=trueare accepted onstart-strategy.
Documentation & Links
Full Agent MCP & CLI docs: https://docs.pariflow.com/developers/agent-mcp-cli
30-Day Whale Replay Methodology: https://pariflow.com/blog/ai-trading-strategy-30-days
Free
$10KDemo Account: https://pariflow.com/trading-demoLicense: MIT — Educational and research tooling only; not financial or trading advice.
Available Tools
19 toolscreate_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 SummaryARead-onlyIdempotent
Return balances, current account mode, and agent trading limits.
Inputs: no named parameters.
get_perp_marketGet Perpetual MarketARead-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 StartedARead-onlyIdempotent
Return the recommended Pariflow Agent MCP onboarding prompts, safe flow, and response rules.
Inputs: no named parameters.
get_strategy_statusGet Strategy StatusBRead-onlyIdempotent
Return a strategy lifecycle status, latest run, totals, and next scheduled scan.
Inputs: strategyId (required).
get_top_tradesGet Top TradesCRead-onlyIdempotent
Return the largest whale-alert or Pariflow market trades for a date.
Inputs: date, limit, source, minAmount, +1 more.
list_ordersList OrdersCRead-onlyIdempotent
List the authenticated user orders visible to this agent key.
Inputs: limit, offset, status, eventId, +1 more.
list_perp_positionsList Perpetual PositionsBRead-onlyIdempotent
List the authenticated user open perpetual futures positions with entry price, mark price, leverage, and unrealized PnL.
Inputs: accountType.
list_perpsList Perpetual MarketsBRead-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 StrategiesCRead-onlyIdempotent
List the authenticated account strategies and their latest run.
Inputs: limit, status.
pause_strategyPause StrategyBIdempotent
Pause an active strategy and clear its next scheduled scan.
Inputs: strategyId (required), reason.
place_perp_orderPlace Perpetual OrderBDestructiveIdempotent
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 TradeCDestructiveIdempotent
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 OrderBRead-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 TradeCRead-onlyIdempotent
Preview a Pariflow trade without execution.
Inputs: side (required), amount (required), eventId (required), price, +8 more.
resolve_marketResolve MarketBRead-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 MarketsBRead-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 StrategyBDestructive
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
Scored across 19 tools
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.
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.
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.
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
Related MCP Connectors
Pay-per-call Polymarket intelligence for AI agents: MCP server + x402 (USDC) API
23-in-1 MCP server: EVM tx simulator, funding rate arb, macro radar, swap calldata & security.
Live prices, perps, prediction markets and a paper trading desk over one MCP.
Pay-per-call ($0.005-$0.03 USDC) market, on-chain, and prediction-market data API for AI agents and trading bots via x402 — no signup, no API key. Remote MCP server, 28 tools: token security (honeypot/liquidity/counterfeit checks), Hyperliquid oracle-gap risk, kimchi premium, funding APR, DEX slippage, Polymarket arbitrage/liquidity audits, Hyperliquid HIP-4 odds.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceSelf-hosted MCP server for trading on Kalshi prediction markets via DFlow on Solana, enabling account management, market discovery, trading, swaps, transfers, and redemption.15 npm1PolyForm Noncommercial 1.0.0
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes Polymarket prediction markets via CLI wrapper. Enables AI agents to discover markets, check prices, and place trades programmatically.-
- FlicenseNot gradedqualityDmaintenanceA 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-
- AlicenseAqualityBmaintenancePrediction-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.1448 PyPI572Apache 2.0