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.
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_BPSprotects 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
.envfile - 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.