Quick Connect
MCP endpoint:https://mcp.nilemarkets.com/api/mcp
- Transport: Streamable HTTP (MCP spec 2025-03-26)
- Auth: None (open access during M2 testnet)
- Session: Stateless — no
initializehandshake required
- Claude Code
- Claude Desktop
- Claude.ai
- ChatGPT
- Cursor
- VS Code
Read Tools (14)
Pool and Protocol
Positions
Oracle and Pricing
Accounts and Fees
Token
Simulation
Write Tools (8)
Write tools return unsigned transaction calldata — they do not execute transactions. Your agent or wallet signs and broadcasts the returned calldata externally.Trading
Margin
Vault (Liquidity Providers)
Token Approval and Testnet
All amounts are strings in USDC smallest unit (6 decimals).
"1000000000" = 1,000 USDC.
Response Format
Every tool response includes protocol metadata:
Write tools return
TransactionCalldata in the data field:
to address is always pre-filled with the correct contract. You do not need to look up contract addresses when using write tools.
Write Tool Flow
Write tools produce calldata, not transactions. The signing and broadcasting step happens outside the MCP server.1
Pre-flight
Call
get_protocol_mode to verify the protocol is in NORMAL mode. Call get_token_balance to confirm the wallet has sufficient USDC.2
Simulate
For position opens, call
simulate_open_position to preview the required margin, trading fee, and entry strike before committing.3
Approve if needed
Call
check_allowance for the target contract. If the allowance is insufficient, call approve_token to generate approval calldata, then sign and broadcast it.4
Generate calldata
Call the write tool (
open_position, deposit_margin, etc.). The response includes to, data, value, and chainId.5
Sign and broadcast
Sign the transaction with any EVM wallet — Foundry
cast, viem, ethers.js, MetaMask, OWS, or any signing MCP server. Broadcast to Sepolia.Rate Limits
- Limit: 100 requests/minute per IP
- Exceeded: HTTP 429 with
Retry-Afterheader - No auth tokens: Rate limiting is IP-based during M2 testnet