MCP · Streamable HTTP · 19 tools

Deterministic futures risk & funding
for AI agents

TradingCalc is the computation layer your agent calls for exact futures math — not AI, not estimates. Same inputs always produce the same outputs. Every formula is traceable to exchange documentation and regression-tested.

https://tradingcalc.io/api/mcp

19 MCP tools·4 workflow suites·7 exchanges normalized·self-verification available

Why deterministic matters

LLM asked directly
Gives a plausible number. May be wrong. Cannot be audited. Changes between calls.
TradingCalc MCP call
Exact number from a verified formula. Same inputs, same output. Fully traceable.

We are not AI. We are the computation layer that AI calls.

19 MCP tools across 4 suites

Trade Planning
workflow.run_pnl_planningNet PnL, ROE, fees and gross P&L for a futures trade
workflow.run_breakeven_planningBreak-even price accounting for entry and exit fees
workflow.run_exit_targetExit price required to hit a target PnL or ROE
workflow.run_position_sizingPosition size from account balance and max risk %
primitive.average_entryAverage entry price after DCA into a position
workflow.run_scenario_planningMulti-scenario P&L table across price targets
workflow.run_dca_entryWeighted average entry, breakeven, and per-level contribution from multiple fills
workflow.run_scale_outP&L, ROI, and cumulative P&L for each partial exit level
Risk & Margin
workflow.run_liquidation_safetyLiquidation price for long/short with cross or isolated margin
workflow.run_max_leverageMaximum safe leverage given account size and volatility
primitive.hedge_ratioShort perp size to fully hedge a spot position, including funding cost
workflow.run_risk_rewardFull R:R analysis: position size, liquidation, breakeven, P&L at stop and target. Returns verdict.
Funding & Carry
workflow.run_funding_costCumulative funding cost over a holding period
workflow.run_funding_arbitrageAnnualized funding arbitrage yield between two exchanges
workflow.run_compound_fundingCompound funding cost with position size decay
workflow.run_carry_tradeDelta-neutral carry: net yield, gross/net profit, breakeven days. Returns verdict.
workflow.run_funding_breakevenPrice move needed to cover funding cost + fees over a holding period
Integrated Decision
workflow.run_pre_trade_checkFull pre-trade risk analysis: position size, liquidation price, breakeven, funding cost, and safety classification in one call

Built for

AI agents & assistants
Call exact futures math instead of improvising calculations in natural language.
Trading bots
Verify risk, sizing, and target structure with deterministic calls before every order.
Risk management systems
Embed into internal risk rails where same inputs must always produce the same outputs.
Multi-agent pipelines
Use as the deterministic layer inside analyst → risk → execution workflows.
Dashboards & analytics
Surface exact outputs inside operator dashboards and decision-support interfaces.
Algo trading strategies
Reusable computation substrate across planning, carry, hedge, and decision safety.

Example agent workflows

Pre-trade risk check
  1. 1.Call `workflow.run_risk_reward` → R:R ratio, position size, liquidation, P&L at stop and target, verdict
  2. 2.Call `workflow.run_funding_cost` → cumulative funding cost over hold period
  3. 3.Call `workflow.run_pre_trade_check` → full decision: sizing + liquidation + breakeven + funding in one call
DCA and scale-out
  1. 1.Call `workflow.run_dca_entry` with fill levels → avg entry, breakeven, per-level contribution
  2. 2.Call `workflow.run_liquidation_safety` → liquidation distance from averaged entry
  3. 3.Call `workflow.run_scale_out` with exit levels → P&L per exit, weighted avg exit, overall ROI
Funding carry analysis
  1. 1.Call `workflow.run_carry_trade` → net yield, gross/net profit, breakeven days, verdict
  2. 2.Call `workflow.run_funding_breakeven` → price move needed to cover funding + fees
  3. 3.Call `workflow.run_funding_arbitrage` → annualized arb yield between two exchanges
Scenario planning
  1. 1.Call `workflow.run_scenario_planning` with price targets → full P&L table
  2. 2.Call `workflow.run_exit_target` → exact price to hit target ROE
  3. 3.Call `primitive.hedge_ratio` → perp short size to hedge the position

Examples — request & response

PnL on a BTC longworkflow.run_pnl_planning
Request
curl -X POST https://tradingcalc.io/api/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0", "id": 1,
    "method": "tools/call",
    "params": {
      "name": "workflow.run_pnl_planning",
      "arguments": {
        "side": "long",
        "entryPrice": 83000,
        "exitPrice": 85000,
        "size": 0.1,
        "feeOpenPct": 0.0002,
        "feeClosePct": 0.0005
      }
    }
  }'
Response (result)
{
  "pnl": 194.09,
  "pnlPct": 0.02339,
  "fees": 5.91,
  "gross": 200.00
}
Position size from risk %workflow.run_position_sizing
Request
curl -X POST https://tradingcalc.io/api/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0", "id": 1,
    "method": "tools/call",
    "params": {
      "name": "workflow.run_position_sizing",
      "arguments": {
        "side": "long",
        "entryPrice": 83000,
        "stopLoss": 81000,
        "riskUsdt": 100,
        "leverage": 5
      }
    }
  }'
Response (result)
{
  "sizeBase": 0.04861,
  "sizeQuote": 4034.56,
  "margin": 806.91,
  "stopDistPct": 2.41
}
Full pre-trade risk checkworkflow.run_pre_trade_check
Request
curl -X POST https://tradingcalc.io/api/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0", "id": 1,
    "method": "tools/call",
    "params": {
      "name": "workflow.run_pre_trade_check",
      "arguments": {
        "side": "long",
        "entry_price": 83000,
        "stop_loss": 81000,
        "account_balance": 5000,
        "risk_pct": 2,
        "leverage": 5,
        "funding_rate": 0.0001,
        "hold_hours": 24
      }
    }
  }'
Response (result)
{
  "safety": "ok",
  "recommended_size": 0.04861,
  "notional": 4034.56,
  "margin_required": 806.91,
  "liquidation_price": 66895.00,
  "liquidation_distance_pct": 19.40,
  "breakeven_price": 83023.51,
  "funding_cost_24h": 1.21,
  "summary_a": "Notional 4034.56 USDT · margin 806.91 USDT",
  "summary_b": "Liquidation 19.4% away, stop 2.4%",
  "summary_c": "Over 24h breakeven rises: 83023.51 → 83123.51 USDT"
}

Self-verification

Agents can call system.verify before using results. Returns pass/fail for all 22 canonical test vectors. Every formula is traceable to exchange documentation — this is not a claim, it is a verifiable proof.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "system.verify", "arguments": {} }
}

// Response
{
  "status": "pass",
  "passed": 22,
  "failed": 0,
  "total": 22,
  "timestamp": "2026-03-30T..."
}

Access methods

MCP (Claude Desktop / Cursor / VS Code)
// Claude Desktop — ~/.claude/claude_desktop_config.json
{
  "mcpServers": {
    "tradingcalc": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://tradingcalc.io/api/mcp"]
    }
  }
}

// Cursor / VS Code
{
  "tradingcalc": {
    "url": "https://tradingcalc.io/api/mcp"
  }
}
REST API (direct JSON-RPC)
curl -X POST https://tradingcalc.io/api/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "liquidation",
      "arguments": {
        "side": "long",
        "entryPrice": 95000,
        "leverage": 10,
        "marginType": "isolated"
      }
    }
  }'
Authenticating with an API key
curl -X POST https://tradingcalc.io/api/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", ... }'

// MCP config with key
{
  "mcpServers": {
    "tradingcalc": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://tradingcalc.io/api/mcp",
               "--header", "Authorization: Bearer YOUR_API_KEY"]
    }
  }
}

Get a key at /request-access — free tier available, no signup required for anonymous use.

TypeScript SDK

Thin typed wrapper — same endpoint, zero dependencies.

npm install tradingcalc-sdk
import { TradingCalcClient } from 'tradingcalc-sdk';

const tc = new TradingCalcClient({ apiKey: 'tc_your_key' });

const check = await tc.workflows.preTradeCheck({
  side: 'long', entry_price: 83000, stop_loss: 81000,
  account_balance: 5000, risk_pct: 2, leverage: 5,
  funding_rate: 0.0001, hold_hours: 24,
});
// { safety: 'ok', liquidation_price: 66895, summary_b: 'Liquidation 19.4% away', ... }

// Primitives — single formula, no opinion
const avg = await tc.primitives.averageEntry({ symbol: 'BTCUSDT', input: { fills: [{ price: 83000, quantity: 0.1 }, { price: 80000, quantity: 0.2 }] } });
// { avgEntry: 81000, totalQty: 0.3, totalCost: 24300, ... }

Pricing

Credits-based. Priced by workflow class.
Sandbox
Free
Limited sandbox
Best for trying the endpoint and validating outputs
Trader
$19
250 credits / mo
Best for one active bot or light workflow automation
Builder
$79
5,000 credits / mo
Best for agents, dashboards, prototypes, and serious integration work
Team
$249
25,000 credits / mo
Best for shared infra, internal tools, and multi-agent environments

Primitive call = 1 credit · Standard workflow = 5 cr · Integrated decision = 10 cr

Limited offer

Builder plan — free for 1 month

Building a trading bot, agent workflow, dashboard, or risk tool with TradingCalc? Get full Builder access (5,000 credits/mo) free for 30 days. No credit card. No commitment. Tell us what you're building.

Frequently asked questions

Is TradingCalc an AI?
No. It’s a deterministic computation layer. Same inputs always produce the same outputs.
What does “deterministic” mean?
No randomness. No estimation. Same inputs, same outputs, every time.
Does it work in Claude Desktop / Cursor / VS Code?
Yes. Quickstarts for all three are above.
Can I use it without an API key?
Yes. 20 calls/day anonymously, no signup required.
How do I verify results are correct?
Call system.verify via MCP, or visit /verify for the live proof page.
Which exchanges are supported?
Binance, Bybit, OKX, Hyperliquid, Aster, KuCoin, MEXC.
Can I use it in an automated trading bot?
Yes. That’s a primary use case. MCP and REST both work.
What is an integrated decision tool?
A single call that orchestrates multiple primitives. pre_trade_check runs position sizing, liquidation, breakeven, and funding cost together and returns a structured safety classification.
Is there a free plan?
Yes. Sandbox tier is free with limited quota. No signup required to try.
Is there a programmatic payment option for agents?
Pay-per-call via x402 is planned for composite endpoints. Currently: API key billing.
Start in 30 seconds

No signup required. Add to Claude Desktop or Cursor using the config above, or call the endpoint directly.