Jupiter Perps MCP Server

Jupiter Perps MCP Server

Enables AI agents to trade leveraged perpetual futures on Solana's Jupiter Perpetuals while providing tools for market data and technical analysis. It supports portfolio management, fee estimation, and automated position execution for SOL, ETH, and BTC using USDC collateral.

Category
访问服务器

README

Jupiter Perps MCP Server

A Model Context Protocol server that enables AI agents to trade perpetual futures on Jupiter Perpetuals (Solana).

⚠️ DISCLAIMER This software is provided for educational and research purposes only. Trading perpetual futures involves substantial risk of loss and is not suitable for all investors. You are solely responsible for any trading decisions and losses incurred. The authors and contributors assume no liability for your use of this software. Use at your own risk with funds you can afford to lose.

Features

  • Market Data: Real-time prices, 24h statistics, and historical OHLCV candles
  • Portfolio Management: View USDC balance, open positions, PnL, and fees
  • Position Trading: Open, increase, and close leveraged positions (1.1x - 100x)
  • Fee Estimation: Calculate trading costs before execution
  • Transaction Safety: Automatic compute budget optimization and simulation

Supported assets: SOL, ETH, BTC

How It Works

Jupiter Perpetuals uses an oracle-based pricing model with a shared liquidity pool:

  • Pricing: Trades execute at oracle prices (Signal/Chainlink/Pyth), not order book prices
  • Liquidity: You trade against a pool of SOL, ETH, WBTC, USDC, USDT (not against other traders)
  • Slippage Protection: MAX_SLIPPAGE_BPS protects against oracle price movement during transaction execution
  • Fees:
    • Base trading fee + Price impact fee (protects liquidity providers)
    • Hourly borrow fees (instead of traditional funding rates)

This means large trades don't suffer from order book depth issues, but oracle price slippage can still occur if prices move during transaction confirmation.

Key Concepts

Position Model: Positions are identified by asset + side (e.g., "Long SOL"). You can only have one position per asset/side pair. The protocol automatically merges any additional opens into the existing position, increasing its size and adjusting entry price.

Collateral: All positions use USDC as collateral. For long positions, the protocol swaps USDC to the asset internally.

Fees: Trading fees (base + price impact) are paid when opening/increasing/closing positions. Borrow fees accrue hourly and are settled when modifying/closing. Use estimate_open_position before trading to understand total costs.

Trading: All trades execute at market price immediately (no limit orders). Tools return a transaction signature for logging purposes. The protocol processes positions asynchronously in a separate transaction - this may take a few seconds and can fail. Use get_account_portfolio to verify the position was successfully created.

Prerequisites

  • Node.js 18+
  • A Solana wallet with USDC for trading
  • Wallet private key (base58 encoded)

Installation

git clone <repository-url>
cd jupiter-perps-mcp
npm install
npm run build

Configuration

Create a .env file:

cp .env.example .env

Required settings:

WALLET_PRIVATE_KEY=your_base58_encoded_private_key
RPC_URL=https://api.mainnet-beta.solana.com

Optional settings:

MAX_SLIPPAGE_BPS=200                    # Default: 200 (2%)
PRIORITY_FEE_MICRO_LAMPORTS=100000      # Default: 100000

Usage

Local Testing

Quick verification with MCP inspector:

npx @modelcontextprotocol/inspector node dist/index.js

With Claude Code (Local)

Create .mcp.json in your project directory:

{
  "mcpServers": {
    "jupiter-perps": {
      "command": "node",
      "args": ["/absolute/path/to/jupiter-perps-mcp/dist/index.js"]
    }
  }
}

Or use ${workspaceFolder} for relative paths:

{
  "mcpServers": {
    "jupiter-perps": {
      "command": "node",
      "args": ["${workspaceFolder}/jupiter-perps-mcp/dist/index.js"]
    }
  }
}

Remote Setup (Sandboxed Environment)

Run the MCP server as an HTTP service to isolate sensitive wallet keys from Claude Code. The wallet private key stays on the host machine, while Claude Code runs in a separate environment and can only trade through MCP tools.

1. On the host machine (with wallet access), configure .env:

MCP_PORT=3000                           # HTTP server port (default: 3000)

2. Start in HTTP mode:

npm run start:remote

Or set MCP_MODE=http in .env for deployment/automation.

3. In your sandboxed Claude Code environment, create .mcp.json:

{
  "mcpServers": {
    "jupiter-perps": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

For different machines, replace localhost with the host IP (e.g., http://192.168.1.100:3000/mcp).

Security: The server binds to localhost by default. For remote access, use SSH tunneling, VPN, or firewall rules to control access.

4. Test the connection:

curl http://localhost:3000/health

Available Tools

Market Data & Trading

Tool Description
get_market_snapshot Current market prices, 24h stats, fees, and liquidity
get_candles Historical OHLCV data (5m, 15m, 1h, 4h, 1d, 1w)
get_account_portfolio USDC balance, positions, PnL, and fees to close
estimate_open_position Calculate fees and resulting position before trading
open_position Open or increase a leveraged position
close_position Close an existing position at market price

Technical Indicators

Tool Description
get_indicator_rsi RSI momentum oscillator (0-100, >70 overbought, <30 oversold)
get_indicator_macd MACD trend and momentum indicator
get_indicator_bollinger_bands Bollinger Bands volatility and mean reversion indicator
get_indicator_atr ATR volatility measure for stop-loss placement
get_indicator_ema Exponential Moving Average (faster than SMA)
get_indicator_sma Simple Moving Average (classic trend indicator)
get_indicator_stochastic Stochastic momentum oscillator (0-100, >80 overbought, <20 oversold)

Security

⚠️ Important Safety Notes

  • Never commit your .env file
  • Use a dedicated wallet with limited funds
  • All positions use USDC as collateral
  • Review transaction details before confirming
  • Consider using a private RPC endpoint for production

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选