Execute Solana Token Swaps via Jupiter API
An MCP server executing Solana token swaps via Jupiter's Ultra API - fetches an optimal-price order, then executes it with slippage/fee handling.
Maintainer of this project? Claim this page to edit the listing.
1.0.0Add to Favorites
Why it matters
Automate token swaps on the Solana blockchain by leveraging the Jupiter Ultra API. This asset integrates DEX routing and RFQ for optimal pricing and executes transactions securely.
Outcomes
What it gets done
Retrieve optimal swap orders using Jupiter's DEX routing and RFQ.
Execute token swap transactions on Solana with slippage and priority fee handling.
Securely manage Solana RPC URLs and private keys for transaction signing.
Integrate with Jupiter's API for efficient and cost-effective token exchanges.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-jupiter-mcp | bash Capabilities
Tools your agent gets
Retrieves a swap order from Jupiter Ultra API using DEX routing and RFQ for optimal pricing.
Executes a swap transaction on Solana via Jupiter Ultra API with slippage handling and priority fees.
Overview
jupiter-mcp server
An MCP server for Solana token swaps via Jupiter's Ultra API, exposing a two-step get-then-execute flow that handles DEX routing, RFQ pricing, slippage, priority fees, and transaction landing. Use when an AI agent needs to quote or execute a real Solana token swap on behalf of a wallet - only in an environment trusted to hold the signing private key.
What it does
Executes token swaps on the Solana blockchain through Jupiter's Ultra API, exposing exactly two tools that mirror the API's own two-step swap flow. get-ultra-order fetches a swap order given an input mint, an output mint, an amount, and a slippage tolerance in basis points, combining DEX routing and RFQ (Request for Quote) for optimal pricing, and returns a request ID, a base64-encoded unsigned transaction, and the resolved input and output amounts and price. execute-ultra-order then takes that request ID and transaction back and asks Jupiter to actually execute the swap on behalf of the wallet, handling slippage, priority fees, and transaction landing itself, returning a status, a transaction signature, the slot it landed in, and the resulting swap events. A worked example shows a natural-language request to trade 1.23 SOL for USDC resolving to a concrete get-ultra-order call and JSON response, followed by an execute-ultra-order call using that same request ID and transaction to complete the trade.
When to use - and when NOT to
Use it when an AI agent needs to quote or execute a real Solana token swap on behalf of a wallet. It requires Node.js 18 or higher for native fetch support, a base58-encoded Solana private key for signing transactions, and access to a Solana RPC endpoint. Setup clones the repository, installs dependencies with npm install, and configures the MCP client with the server's entry point plus the RPC URL and private key as environment variables:
{
"mcpServers": {
"Jupiter-MCP": {
"command": "node",
"args": ["path/to/jupiter-mcp/server/index.js"],
"env": {
"SOLANA_RPC_URL": "solana rpc url you can access",
"PRIVATE_KEY": "your private key"
}
}
}
}
Because the private key signs real transactions, this should only be wired up in an environment the user trusts to hold that key.
Capabilities
Two-step swap execution via Jupiter's Ultra API: fetching a priced, RFQ-and-DEX-routed order, then executing that exact order with slippage, priority fees, and transaction landing handled automatically.
How to install
Clone the repo, run npm install, and configure the MCP client with the server entry point plus a SOLANA_RPC_URL and a PRIVATE_KEY environment variable for the wallet doing the signing.
Who it's for
Agents or users who want to quote and execute Solana token swaps conversationally, through Jupiter's own routing and RFQ pricing, rather than calling the Ultra API or a DEX interface directly. The project is MIT-licensed and targets Node.js 18.x, marked as an actively maintained server rather than an experimental prototype.
Source README
Jupiter MCP Server
An MCP server for executing token swaps on the Solana blockchain using Jupiter's new Ultra API.
Features
- Fetch swap orders from Jupiter's Ultra API, combining DEX routing and RFQ (Request for Quote) for optimal pricing.
- Execute swaps via Jupiter's Ultra API, handling slippage, priority fees, and transaction landing.
Prerequisites
- Node.js: Version 18 or higher (for native
fetchsupport). - Solana Wallet: A private key (base58-encoded) for signing transactions.
- RPC Endpoint: Access to a Solana RPC node (e.g.,
https://api.mainnet-beta.solana.com).
Installation
Clone the Repository:
git clone https://github.com/kukapay/jupiter-mcp.git cd jupiter-mcpInstall Dependencies:
Ensure you have the MCP Server package installed along with other required dependencies:npm installClient Configuration:
{
"mcpServers": {
"Jupiter-MCP": {
"command": "node",
"args": ["path/to/jupiter-mcp/server/index.js"],
"env": {
"SOLANA_RPC_URL": "solana rpc url you can access",
"PRIVATE_KEY": "your private key"
}
}
}
}
Tools
Ultra API Tools
get-ultra-order:- Description: Fetches a swap order from Jupiter's Ultra API, leveraging both DEX routing and RFQ for optimal pricing.
- Inputs:
inputMint: Input token mint address (e.g., SOL or token pubkey).outputMint: Output token mint address (e.g., USDC or token pubkey).amount: Input amount as a string (e.g., "1.23").slippageBps: Slippage tolerance in basis points (e.g., 50 for 0.5%).
- Output: JSON with
requestId,transaction(base64-encoded),inputMint,outputMint,inAmount,outAmount,price.
execute-ultra-order:- Description: Requests Jupiter to execute the swap transaction on behalf of the wallet owner, handling slippage, priority fees, and transaction landing.
- Inputs:
requestId: Unique identifier fromget-ultra-order.transaction: Base64-encoded transaction fromget-ultra-order.
- Output: JSON with
status,transactionId,slot,inputAmountResult,outputAmountResult,swapEvents.
Example Interaction
Below are examples of interacting with the server using natural language prompts and expected responses:
Fetching a Swap Order
- Prompt: "Get a swap order to trade 1.23 SOL for USDC."
- Input:
- Tool:
get-ultra-order - Arguments:
inputMint: "So11111111111111111111111111111111111111112" (SOL)outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" (USDC)amount: "1.23"slippageBps: 50
- Tool:
- Response:
{ "requestId": "a770110b-82c9-46c8-ba61-09d955b27503", "transaction": "AQAAAA...base64-encoded-transaction...==", "inputMint": "So11111111111111111111111111111111111111112", "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "inAmount": "1230000000", "outAmount": "19950000", "price": 0.01621951219512195 }
Executing a Swap
- Prompt: "Execute the swap order with request ID 'a770110b-82c9-46c8-ba61-09d955b27503' using the transaction provided."
- Input:
- Tool:
execute-ultra-order - Arguments:
requestId: "a770110b-82c9-46c8-ba61-09d955b27503"transaction: "AQAAAA...base64-encoded-transaction...=="
- Tool:
- Response:
{ "status": "Success", "transactionId": "5x...solana-transaction-signature...", "slot": 299283763, "inputAmountResult": "1230000000", "outputAmountResult": "19950000", "swapEvents": [ { "type": "swap", "inputMint": "So11111111111111111111111111111111111111112", "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "inAmount": "1230000000", "outAmount": "19950000" } ] }
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.