Skip to main content
Sepolia Testnet Only — All data is from Ethereum Sepolia. Token balances and positions have no real-world value.

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 initialize handshake required
For additional platforms (Windsurf, JetBrains, Cline, Zed, Warp, and more), see the full connection guide at mcp.nilemarkets.com/skill.md.

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:
The 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.
For complete step-by-step workflows for every write operation, see mcp.nilemarkets.com/workflow.md.

Rate Limits

  • Limit: 100 requests/minute per IP
  • Exceeded: HTTP 429 with Retry-After header
  • No auth tokens: Rate limiting is IP-based during M2 testnet

Example Tool Calls

Check protocol status:
Query pool state:
Get EUR/USD 1-month forward price:
Simulate opening a position:
Search for open short positions above 5,000 USDC notional:
Check USDC allowance before depositing margin:
Generate approval calldata:

Numeric Conventions

Pagination

Tools that return lists support two parameters:

Debugging

Test the server directly with the MCP Inspector:
This opens a web UI where you can browse available tools, call them interactively, and inspect raw responses.