Jupiter MCP Server provides a streamlined way to execute token swaps on the Solana blockchain using Jupiter's Ultra API. It combines DEX routing and Request for Quote (RFQ) functionality to ensure optimal pricing for your token swaps.
fetch
support)Clone the repository:
git clone https://github.com/your-username/jupiter-mcp.git
cd jupiter-mcp
Install dependencies:
npm install
Configure your MCP client to connect to the Jupiter MCP server by adding the following to your client 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"
}
}
}
}
The Jupiter MCP server provides two main tools for token swaps:
Use the get-ultra-order
tool to fetch swap quotes:
Required Parameters:
inputMint
: Input token mint address (e.g., SOL mint address)outputMint
: Output token mint address (e.g., USDC mint address)amount
: Input amount as a string (e.g., "1.23")slippageBps
: Slippage tolerance in basis points (e.g., 50 for 0.5%)Example:
Tool: get-ultra-order
Arguments:
inputMint: "So11111111111111111111111111111111111111112" (SOL)
outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" (USDC)
amount: "1.23"
slippageBps: 50
Response:
{
"requestId": "a770110b-82c9-46c8-ba61-09d955b27503",
"transaction": "AQAAAA...base64-encoded-transaction...==",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "1230000000",
"outAmount": "19950000",
"price": 0.01621951219512195
}
After obtaining a swap order, use the execute-ultra-order
tool to execute the transaction:
Required Parameters:
requestId
: Unique identifier from the get-ultra-order
responsetransaction
: Base64-encoded transaction from the get-ultra-order
responseExample:
Tool: execute-ultra-order
Arguments:
requestId: "a770110b-82c9-46c8-ba61-09d955b27503"
transaction: "AQAAAA...base64-encoded-transaction...=="
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"
}
]
}
For convenience, here are some common Solana token mint addresses:
So11111111111111111111111111111111111111112
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Remember to always verify mint addresses before executing swaps, as using incorrect addresses could result in unintended token swaps.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.