sdk
Free crypto-futures paper trading and live market data for AI agents. 29 tools; no key for data.
¿Debería usar esto?
Calidad y seguridad
Hallazgos (4)
- LOWen get_price
- LOWen get_funding
- LOWen get_fear_greed
- LOWen calc_liquidation
Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.
Costo de contexto
Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.
Instalar
Instalación con un clic
Agrega esto a tu archivo `claude_desktop_config.json`:
{
"mcpServers": {
"sdk": {
"url": "https://marginpad.io/mcp"
}
}
}Puntos de conexión remotos
https://marginpad.io/mcpstreamable-httpQué puede hacer
Inventario de herramientas
Herramientas (29)
🟡get_price(symbol)
Live price and 24h change for a crypto perp, stock, index, forex pair or metal. No API key needed.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Symbol without the USDT suffix, e.g. BTC, ETH, AAPL, EURUSD, XAU"
}
},
"required": [
"symbol"
]
}🟢get_klines(symbol, interval)
OHLC candles for a symbol. Use this to compute indicators or check a setup before trading.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"interval": {
"type": "string",
"description": "Minutes: 1, 5, 15, 60, 240, 1440, 10080",
"default": "60"
}
},
"required": [
"symbol"
]
}🟢get_markets(asset_class)
Every tradable symbol with its asset class, maximum leverage and taker fee. Call this before sizing a trade.
Esquema de entrada
{
"type": "object",
"properties": {
"asset_class": {
"type": "string",
"enum": [
"crypto",
"stock",
"forex",
"metal",
"index"
]
}
}
}🟢get_screener
Scored trade setups across top USDT perps: 0-100 technical score, RSI, MACD, funding and open interest.
Esquema de entrada
{
"type": "object",
"properties": {}
}🟢get_funding(symbol)
Current funding rates across exchanges - who pays whom to hold a perp position.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
}
}
}🟢get_open_interest(symbol)
Open interest per symbol - how much leveraged money is committed.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
}
}
}🟢get_liquidations(symbol)
Recent real liquidation events aggregated from nine exchanges.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
}
}
}🟢get_fear_greed
Crypto Fear and Greed index, current value and classification.
Esquema de entrada
{
"type": "object",
"properties": {}
}🟢get_economic_calendar
Upcoming macro events that move crypto (FOMC, CPI, NFP). Always check this before answering questions about dates - never answer those from memory.
Esquema de entrada
{
"type": "object",
"properties": {}
}⚪calc_liquidation(entry, leverage, side)
Liquidation price for a position: entry, leverage, side.
Esquema de entrada
{
"type": "object",
"properties": {
"entry": {
"type": "number"
},
"leverage": {
"type": "number"
},
"side": {
"type": "string",
"enum": [
"long",
"short"
]
}
},
"required": [
"entry",
"leverage",
"side"
]
}⚪calc_position_size(balance, risk_pct, entry, stop)
Risk-based position size from account balance, risk percent, entry and stop.
Esquema de entrada
{
"type": "object",
"properties": {
"balance": {
"type": "number"
},
"risk_pct": {
"type": "number"
},
"entry": {
"type": "number"
},
"stop": {
"type": "number"
}
},
"required": [
"balance",
"risk_pct",
"entry",
"stop"
]
}⚪paper_balance
Your paper account: balance, equity, free margin, unrealized P&L. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {}
}⚪paper_positions(status)
Your paper positions with live mark price and P&L net of fees; status "open" for just the open ones. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"open",
"closed"
],
"description": "Omit for both"
}
}
}⚪paper_trades(limit, before)
Closed-trade ledger with paging - the full record for measuring a strategy. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"limit": {
"type": "number",
"default": 100
},
"before": {
"type": "number",
"description": "Epoch ms cursor from next_before"
}
}
}⚪paper_open(symbol, side, margin_usd, leverage, sl, ...)
Open a simulated position at the live price. Simulated money only - no real funds are ever at risk. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"side": {
"type": "string",
"enum": [
"long",
"short"
]
},
"margin_usd": {
"type": "number",
"description": "1 to 100000"
},
"leverage": {
"type": "number",
"description": "1 to the symbol cap from get_markets"
},
"sl": {
"type": [
"number",
"null"
]
},
"tp": {
"type": [
"number",
"null"
]
},
"trail_pct": {
"type": [
"number",
"null"
],
"description": "Trailing stop distance in percent (0.05-50): the stop follows the best price seen, server-side, even while the bot is offline"
},
"dry_run": {
"type": "boolean",
"description": "true = validate and price the trade (entry, liquidation, quantity, fees) and write NOTHING"
},
"client_order_id": {
"type": "string",
"description": "Your own id - retrying with the same one returns the first position instead of opening a second"
}
},
"required": [
"symbol",
"side",
"margin_usd",
"leverage"
]
}⚪paper_close(id, pct)
Close a simulated position, fully or partially. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"pct": {
"type": "number",
"description": "Percent to close, 1-100. Omit for the whole position."
}
},
"required": [
"id"
]
}⚪paper_sltp(id, sl, tp, trail_pct)
Move the stop-loss, take-profit or trailing stop on an open simulated position. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"sl": {
"type": [
"number",
"null"
]
},
"tp": {
"type": [
"number",
"null"
]
},
"trail_pct": {
"type": [
"number",
"null"
],
"description": "Trailing stop distance in percent (0.05-50); null switches trailing off"
}
},
"required": [
"id"
]
}🟡paper_modify_order(order_id, limit_price, sl, tp, margin_usd, ...)
Change a resting limit or stop order in place: its price, stop-loss, take-profit, margin, leverage or trailing stop. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"order_id": {
"type": "string"
},
"limit_price": {
"type": "number"
},
"sl": {
"type": [
"number",
"null"
]
},
"tp": {
"type": [
"number",
"null"
]
},
"margin_usd": {
"type": "number"
},
"leverage": {
"type": "number"
},
"trail_pct": {
"type": [
"number",
"null"
]
}
},
"required": [
"order_id"
]
}🟡paper_fees(set)
Which exchange fee schedule your paper fills are charged at: lists the venues we model (Bybit, Binance, OKX, Bitget, MEXC, Gate, KuCoin, Kraken, Hyperliquid) with their taker rate and the referral discount a MarginPad sign-up gets, and your current default. Pass set to change the default (a venue key, or "marginpad" for the default rate). Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"set": {
"type": "string",
"description": "Omit to read. A venue key from the list, or \"marginpad\" to reset."
}
}
}⚪paper_sim(preset, reset, start_balance_usd, margin_enforced, leverage_max, ...)
The whole paper-trading simulation, configurable. By default this engine is deliberately easy: a market order fills whole at the live price, maintenance margin is a flat 0.5%, the balance is a scorecard that never refuses an open, and there is no latency, no size impact and no partial fill. That is right for learning and optimistic for proving out a bot. This sets any of it: the book size your results are measured against and whether it is a real budget (margin_enforced), what crossing the book costs on entry and exit (slippage, slippage_bps, impact_bps_per_100k), how long your order is in flight (latency_ms), whether orders fill part-way (partial_fills, min_fill_pct), how often the venue refuses (reject_rate_pct), your own fee (taker_bps), funding (funding, funding_mult) and where liquidation sits (margin_venue, margin_tiers, mmr_pct). Easiest route: pass a preset - frictionless, realistic, binance, bybit, okx, hyperliquid, thin_book or brutal. Reading returns every field with its range, its default and what it changes, the presets, and what a fill would look like right now. Out-of-range values are refused, never clamped. Positions keep the simulation they were filled under. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"preset": {
"type": "string",
"description": "frictionless | realistic | binance | bybit | okx | hyperliquid | thin_book | brutal. A preset starts from the defaults, so it is a clean slate plus that configuration. Omit every field to READ."
},
"reset": {
"type": "boolean",
"description": "true = back to the engine defaults."
},
"start_balance_usd": {
"type": "number",
"description": "100 to 10,000,000. The book return_pct, the equity curve and max drawdown are measured against."
},
"margin_enforced": {
"type": "boolean",
"description": "true = an open needing more than free margin is refused 402, as a venue refuses it. Free margin is balance minus committed margin; unrealized profit is not collateral, because every position is isolated."
},
"leverage_max": {
"type": "number",
"description": "Your own leverage ceiling below the market cap. 0 = the market cap."
},
"max_notional_usd": {
"type": "number",
"description": "Your own ceiling on one position’s notional. 0 = none."
},
"slippage": {
"type": "boolean",
"description": "Fill against yourself the way a real book does: 0.01% crypto majors, 0.05% other crypto, 0.005% forex, 0.02% stocks/metals/indices."
},
"slippage_bps": {
"type": "number",
"description": "0-500. Your own crossing cost in basis points instead of that table. 10 = 0.10%."
},
"impact_bps_per_100k": {
"type": "number",
"description": "0-500. Extra basis points per $100,000 of notional, because size walks further down the book."
},
"exit_slippage": {
"type": "boolean",
"description": "Pay the crossing cost on the way out too (default true). A stop, take-profit or liquidation still fills at its level."
},
"latency_ms": {
"type": "number",
"description": "0-2000. Your order is in flight this long and the price is re-read afterwards."
},
"partial_fills": {
"type": "boolean",
"description": "Allow a market order to fill less than it asked for."
},
"min_fill_pct": {
"type": "number",
"description": "10-100. The worst fill ratio with partial_fills on."
},
"reject_rate_pct": {
"type": "number",
"description": "0-50. Share of opens refused 503 venue_rejected on purpose."
},
"taker_bps": {
"type": "number",
"description": "0-100. Your own per-side fee in basis points. 5.5 = 0.055%."
},
"funding": {
"type": "boolean",
"description": "false = never charge funding, which is how you separate an execution edge from a carry edge."
},
"funding_mult": {
"type": "number",
"description": "0-5. Scale the real 8-hourly funding rate."
},
"margin_venue": {
"type": "string",
"description": "binance | bybit | okx | bitget | mexc | kucoin | gate | kraken | hyperliquid | coinbase, or \"marginpad\". Moves ONLY where liquidation sits."
},
"margin_tiers": {
"type": "boolean",
"description": "Raise maintenance margin with size, as a risk-limit ladder does, so a large position liquidates sooner."
},
"mmr_pct": {
"type": "number",
"description": "0.05-10. Your own maintenance margin, beating margin_venue."
}
}
}⚪paper_realism(slippage, margin_tiers, margin_venue)
How honestly your paper fills are simulated. By default a market order fills at the live price with no slippage and maintenance margin is a flat 0.5%, which is easier than a real exchange and increasingly so as a position grows. Pass slippage and/or margin_tiers to turn either on, and margin_venue to build on a named venue’s published maintenance-margin rate (Binance 0.40%, Bybit 0.50%, MEXC 0.10%, Kraken 0.60%, Hyperliquid 1.25%, Coinbase 1.33%). Reading returns your setting, every venue rate and the whole size-tier ladder, so a liquidation price never has to be reverse-engineered. Positions keep the margin they were filled with. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"slippage": {
"type": "boolean",
"description": "Fill against yourself the way a real order book does: 0.01% crypto majors, 0.05% other crypto, 0.005% forex, 0.02% stocks/metals/indices."
},
"margin_tiers": {
"type": "boolean",
"description": "Raise maintenance margin with position size, as an exchange risk-limit table does, so a large position is liquidated sooner."
},
"margin_venue": {
"type": "string",
"description": "binance | bybit | okx | bitget | mexc | kucoin | gate | kraken | hyperliquid | coinbase, or \"marginpad\" to reset. Omit every field to read."
}
}
}⚪paper_report(days)
The 30-day trading report for this account, measured from its own closed trades: totals and a skill score (free), win rate and return by coin, leverage band, side, hour and day plus written findings (API Pro and above). Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"days": {
"type": "number",
"description": "1-30, default 30"
}
}
}⚪paper_accounts
Every book (sub-account) of this account with lifetime numbers and the keys bound to it. A book is a separate journal, balance and report; a key minted with a book name trades that book. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {}
}⚪paper_reset
Restart this key’s book at $10,000: closed trades are archived (never deleted), resting orders cancelled, the report and equity curve start from now. Refused while positions are open - close them first. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {}
}⚪paper_equity(days, step_min)
The equity curve of this key’s book: starting balance + realized P&L per bucket from the ledger, the live unrealized point at the end, and max drawdown. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"days": {
"type": "number",
"description": "1-90, default 30"
},
"step_min": {
"type": "number",
"description": "Bucket minutes, 5-1440"
}
}
}⚪paper_replay(symbol, day, speed, act)
Backtest with the real routes: replay one past UTC day on MarginPad’s 1-minute candles. With symbol+day it STARTS a replay (speed = market seconds per real second, 1-600, default 60): from then on paper_open / paper_positions / paper_close act on a separate replay journal priced at the candle under the cursor, with stops, targets and liquidations checked on every candle. With no arguments it reads the status (cursor, price, progress, candles up to the cursor). With act "stop" it closes everything at the cursor and returns the summary. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Start: the market, e.g. BTC"
},
"day": {
"type": "string",
"description": "Start: a complete past UTC day, YYYY-MM-DD"
},
"speed": {
"type": "number",
"description": "Start: 1-600, default 60"
},
"act": {
"type": "string",
"enum": [
"stop"
],
"description": "\"stop\" ends the replay and returns the summary"
}
}
}⚪paper_limit_order(symbol, side, limit_price, margin_usd, leverage, ...)
Place a resting order that fills only when the market reaches your price, and fills AT that price. type "limit" = a pullback entry (long below the market, short above); type "stop" = a breakout entry (long above the market, short below). To open right now use paper_open instead. Simulated money only. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"side": {
"type": "string",
"enum": [
"long",
"short"
]
},
"limit_price": {
"type": "number",
"description": "Below the market for a long, above it for a short"
},
"margin_usd": {
"type": "number",
"description": "1 to 100000"
},
"leverage": {
"type": "number"
},
"sl": {
"type": [
"number",
"null"
]
},
"tp": {
"type": [
"number",
"null"
]
},
"client_order_id": {
"type": "string"
}
},
"required": [
"symbol",
"side",
"limit_price",
"margin_usd",
"leverage"
]
}⚪paper_orders
Your resting limit orders, plus the last 20 that filled, expired or were cancelled. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {}
}🔴paper_cancel_order(order_id)
Cancel a resting limit order. Requires an API key.
Esquema de entrada
{
"type": "object",
"properties": {
"order_id": {
"type": "string"
}
},
"required": [
"order_id"
]
}Comunidad
Evidencia