MCP server de MarginPad SDK
Commit 25 oct 2026Permite que los agentes de IA realicen paper trading de futuros de criptomonedas y accedan a datos de mercado en tiempo real, incluyendo liquidaciones, funding y posiciones de ballenas.
También conocido como marginpad/sdk
- Stars
- 0
- Herramientas
- —
- Descargas, 30 días
- —
- Última versión
- 3.0.1
- Último commit
- 25 oct 2026
- Licencia
- MIT
¿Qué es MarginPad SDK MCP?
MarginPad SDK es un MCP server. Permite que los agentes de IA realicen paper trading de futuros de criptomonedas y accedan a datos de mercado en tiempo real, incluyendo liquidaciones, funding y posiciones de ballenas.
Resumen generado a partir del README del proyecto
Acerca del MCP server de MarginPad SDK
Este MCP server permite a desarrolladores y agentes de IA probar estrategias de trading de futuros de criptomonedas mediante paper trading. Proporciona un entorno simulado donde los usuarios pueden ejecutar órdenes limit, órdenes stop y trailing stops con datos de mercado en tiempo real sin necesidad de depositar fondos o completar procesos de KYC. El servidor funciona con clientes como Claude Desktop y Cursor, requiriendo una única API key para las funciones de trading, mientras que los datos de mercado siguen siendo accesibles sin clave.
Los usuarios pueden acceder a una variedad de métricas en tiempo real, incluyendo liquidaciones en nueve exchanges, posiciones de ballenas en Hyperliquid, tasas de funding e interés abierto. La plataforma se distingue por sus ajustes de simulación altamente personalizables, lo que permite modelar comportamientos específicos de exchanges, como los esquemas de comisiones de Bybit o incluso un entorno hostil con latencia y ejecuciones parciales. También puedes ejecutar replays históricos para probar cómo habría funcionado tu código en días de mercado pasados. El nivel gratuito admite hasta 120 solicitudes por minuto y permite hasta tres claves independientes.
Qué puedes hacer con él
- 1Simular condiciones realistas de exchangeConfigura un entorno de paper trading para replicar comisiones, slippage y ajustes de latencia específicos de un exchange.
- 2Backtesting de estrategias con datos históricosEjecuta tu lógica de trading sobre un día de actividad de mercado pasado para evaluar el rendimiento.
- 3Monitorear datos de ballenas y liquidacionesAccede a feeds en vivo de liquidaciones de mercado y posiciones de grandes holders en Hyperliquid.
- 4Automatizar el paper trading con IAConecta un agente de IA a una cuenta simulada para practicar la apertura y gestión de posiciones.
Escrito a partir del README del proyecto. Cada caso de uso se verifica con una cita del mismo.
Cómo instalar MarginPad SDK MCP
Formatos verificados el 10 nov 2026Instalar MarginPad SDK MCP en Claude Code
$ claude mcp add --transport http sdk https://marginpad.io/mcpInstalar MarginPad SDK MCP en Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"sdk": {
"url": "https://marginpad.io/mcp"
}
}
}Instalar MarginPad SDK MCP en VS Code
.vscode/mcp.json
{
"servers": {
"sdk": {
"type": "http",
"url": "https://marginpad.io/mcp"
}
}
}Instalar MarginPad SDK MCP en Codex
~/.codex/config.toml
[mcp_servers.sdk] url = "https://marginpad.io/mcp"
Instalar MarginPad SDK MCP en Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"sdk": {
"httpUrl": "https://marginpad.io/mcp"
}
}
}README
Ver en GitHubMarginPad SDK
Free crypto-futures paper trading for bots and free market data. One key, no KYC, no deposit. Test a strategy or an AI agent against live prices with real fee schedules, funding, liquidations, limit and stop orders, trailing stops, webhooks and a WebSocket stream, then take the same code to a real exchange.
- Guide: https://marginpad.io/trading-api/
- Reference (OpenAPI, try it live): https://marginpad.io/api-docs/
- Status: https://marginpad.io/status/ - Changelog: https://marginpad.io/api/changelog.xml
- MCP server for Claude, ChatGPT and Cursor: https://marginpad.io/trading-api/#mcp
What the data behind it is
The market data these clients read is measured by MarginPad itself and published free, with no key, as pages and JSON:
- Liquidations across nine exchanges, from our own collector: https://marginpad.io/liquidations/ · live feed https://marginpad.io/rekt/ · per-coin maps such as https://marginpad.io/btc-liquidation-map/ · live heatmap https://marginpad.io/heatmap
- Hyperliquid whale positions read from the chain, with exact liquidation prices: https://marginpad.io/hyperliquid-whales/
- Funding, open interest and long/short: https://marginpad.io/funding/ · https://marginpad.io/open-interest/ · https://marginpad.io/long-short/
- One question, one measured answer: https://marginpad.io/how-many-traders-liquidated-today/ · https://marginpad.io/biggest-liquidation-today/ · https://marginpad.io/what-leverage-should-a-beginner-use/ · https://marginpad.io/where-can-i-test-a-trading-bot/
- The practice terminal the engine behind this API also runs: https://marginpad.io/paper-trade (no sign-up) and the season competition https://marginpad.io/trading-competition/
Install
pip install marginpad # Python 3.8+, no dependencies (pip install "marginpad[stream]" for the WebSocket)
npm install marginpad # Node 18+, zero dependencies
Python
from marginpad import MarginPad
mp = MarginPad("mpb_...") # key from https://marginpad.io/trading-api/
print(mp.price("BTC")) # keyless market data
pos = mp.open("BTC", "long", margin_usd=100, leverage=10, sl=58000, tp=66000,
client_order_id="sig-2026-09-12-1403") # idempotent: a retry returns the same position
mp.sltp(pos["id"], trail_pct=1.5) # trailing stop, ratcheted server-side
print(mp.account())
JavaScript
const { MarginPad } = require('marginpad');
const mp = new MarginPad('mpb_...');
const { position } = await mp.open({ symbol: 'BTC', side: 'long', margin_usd: 100, leverage: 10, client_order_id: 'sig-1' });
mp.stream(ev => console.log(ev.type, ev.data)); // positions pushed on change, prices each tick
Books, reset, equity, replay (2.5 / 2.6)
mp.accounts() # every book of the account with lifetime numbers
mp.reset() # this key's book back to $10,000 (archived, never deleted)
mp.equity(days=30, step_min=60) # equity curve + max drawdown
mp.replay_start("BTC", "2026-09-11", speed=120) # run the same code through a past day, 12 minutes per day
mp.replay(interval=5, bars=120) # cursor, price, candles up to the cursor
mp.replay_stop() # summary: closes, win rate, P&L, return, liquidations
A key minted with book ({"act":"create","name":"rsi","book":"rsi"} on POST /api/bot/key) trades a separate journal: one strategy, one key, one clean result. During a replay every trading call of that key acts on a replay journal priced from the candle under the cursor; stops, targets and liquidations are checked on every candle between two calls.
The simulation is yours to set
Eighteen fields and eight presets, so the paper venue can be the one you will actually trade. The defaults are deliberately frictionless, and nothing you have already built moves until you change them.
mp.sim() # your profile, every field with its range, the presets
mp.sim(preset="realistic") # the honest middle, in one call
mp.sim(preset="bybit") # Bybit's published taker fee and maintenance margin
mp.sim(preset="brutal") # refusals, partial fills, a second of latency
mp.sim(start_balance_usd=2500, margin_enforced=True, slippage_bps=8, latency_ms=250)
mp.sim(reset=True) # back to the defaults
await mp.sim({ preset: 'realistic' });
await mp.sim({ start_balance_usd: 2500, margin_enforced: true, reject_rate_pct: 2 });
The book (start_balance_usd, margin_enforced, leverage_max, max_notional_usd), the fill (slippage, slippage_bps, impact_bps_per_100k, exit_slippage, latency_ms, partial_fills, min_fill_pct, reject_rate_pct), the cost (taker_bps, funding, funding_mult) and the liquidation (margin_venue, margin_tiers, mmr_pct).
Out-of-range values are refused, never clamped, and a position keeps the simulation it was filled under for life. margin_enforced turns the balance into a real budget: size past it and the open comes back 402, which is the failure a live bot has to handle and a frictionless simulator never shows you. reject_rate_pct is the one a retry loop is worth writing for.
Every field with its range: https://marginpad.io/trading-api/#sim
Examples
examples/agent_loop.py: a signal loop that opens, manages and closes positions once a minute without polling storms.examples/webhook_server.js: receiveposition.closed/order.filledevents with signature verification.examples/mcp.md: let Claude Desktop or Cursor trade on your paper account through the MCP server.
Limits
| Plan | Requests/min | Keys | Open positions | Books | Webhooks |
|---|---|---|---|---|---|
| Free $0 | 120 | 3 | 50 | 1 | - |
| Pro $27 | 600 | 10 | 200 | 5 | 3 |
| Max $69 | 2000 | 30 | 500 | 20 | 15 |
| Business $139 | 5000 | 100 | 1000 | 50 | 50 |
An API plan is its own product: a MarginPad Premium subscription buys nothing here, and an API plan buys nothing on the site. Every market-data endpoint is free and keyless, with no account and no trial. The paper-trading engine, the simulation, books, replay and the WebSocket stream are free for 7 days from the day the first key is minted (since 2026-10-13); after that they need a paid plan, and only webhooks and the AI read are gated by tier within it. Trade history is 30 days on the trial and 90 on a paid plan.
Measured in production: the busiest bot peaks at 66 requests a minute against the Free ceiling of 120, and no key has ever been rate-limited on any plan. Choose on keys and history, not on throughput.
Every response carries X-RateLimit-Limit / Remaining / Reset; on 429 both clients wait Retry-After and retry once. Out-of-range input is refused with a named error (leverage_max carries the market's cap), never silently clamped.
Honesty note
This is a simulator. Fees, funding and liquidation maths mirror real exchanges and every fill condition above is yours to set - but there is no order book behind impact_bps_per_100k, so market impact is modelled rather than measured on depth, and a stop, target or liquidation fills at its own level without paying the crossing cost. A bot that passes here still needs a small live test. Educational use, not financial advice.
MIT licensed.
Preguntas sobre MarginPad SDK MCP
¿Cómo agrego MarginPad SDK MCP a Claude Code?
Ejecuta claude mcp add --transport http sdk https://marginpad.io/mcp en tu terminal. Añade --scope user para que esté disponible en todos los proyectos.
¿Cómo agrego MarginPad SDK MCP a Cursor?
Abre ~/.cursor/mcp.json y añade el servidor en mcpServers, usando la configuración de Cursor que se muestra en la sección de instalación de arriba.
¿Necesito una API key para acceder a los datos del mercado?
No, los datos del mercado se publican de forma gratuita y no requieren ninguna clave.
¿Puedo probar mi estrategia de trading con datos históricos?
Sí, puedes usar la función de replay para ejecutar tu código sobre un día pasado a velocidades ajustables.
¿Qué tan realista es la simulación de paper trading?
La simulación te permite configurar comisiones, funding, slippage, latencia y parámetros de liquidación para replicar exchanges reales.
¿Tiene algún costo usar el motor de paper trading?
El motor de paper trading, la simulación, los libros, el replay y el stream de WebSocket son gratuitos durante 7 días a partir del día en que se genera la primera clave.