
Jupiter
STDIOMCP server enabling Claude to perform token swaps on Solana using Jupiter API
MCP server enabling Claude to perform token swaps on Solana using Jupiter API
This repository contains a Model Context Protocol (MCP) server that provides Claude with access to Jupiter's swap API. The server enables Claude to perform operations like getting quotes, building swap transactions, and sending swap transactions on the Solana blockchain using Jupiter.
The MCP server exposes several tools to Claude:
jupiter_get_quote
: Get a quote for swapping tokens on Jupiterjupiter_build_swap_transaction
: Build a swap transaction on Jupiterjupiter_send_swap_transaction
: Send a swap transaction on Jupiterjupiter_execute_swap
: Execute a complete swap using a wallet private key from environment variablesThis server uses Jupiter APIs:
https://lite-api.jup.ag/swap/v1
) for executing swapsThe Lite API provides a simplified interface for building and executing swaps in a single request, which improves reliability.
# Install globally npm install -g jupiter-mcp-server # Or use with npx npx jupiter-mcp-server
Clone this repository:
git clone https://github.com/quanghuynguyen1902/jupiter-mcp-server.git cd jupiter-mcp-server
Install dependencies:
npm ci
Build the project:
npm run build
Install globally (optional):
npm install -g ./
To configure Claude Desktop to use this MCP server with environment variables for automatic swap execution:
Open Claude Desktop
Navigate to the Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\\Claude\\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
Add the MCP server configuration with environment variables:
{ "mcpServers": { "jupiter-mcp-server": { "command": "npx", "args": ["jupiter-mcp-server"], "env": { "SOLANA_PRIVATE_KEY": "your_private_key_in_base58_format", "SOLANA_RPC_ENDPOINT": "https://api.mainnet-beta.solana.com", "SOLANA_NETWORK": "mainnet-beta", "LOG_LEVEL": "info" } } } }
If you've installed from source and want to run the local version, use:
{ "mcpServers": { "jupiter-mcp-server": { "command": "node", "args": [ "/path/to/your/jupiter-mcp-server/build/index.js" ], "env": { "SOLANA_PRIVATE_KEY": "your_private_key_in_base58_format", "SOLANA_RPC_ENDPOINT": "https://api.mainnet-beta.solana.com", "SOLANA_NETWORK": "mainnet-beta", "LOG_LEVEL": "info" } } } }
If you're running the server directly (not through Claude Desktop), you can create a .env
file in the root directory with the same variables:
SOLANA_PRIVATE_KEY=your_private_key_in_base58_format
SOLANA_RPC_ENDPOINT=https://api.mainnet-beta.solana.com
SOLANA_NETWORK=mainnet-beta
LOG_LEVEL=info
# If installed globally jupiter-mcp-server # If installed from source node build/index.js # Using npx npx jupiter-mcp-server
Once configured, restart Claude Desktop. Claude will now have access to the Jupiter swap tools. You can ask Claude to:
Get a quote for swapping tokens:
What's the quote for swapping 1 SOL to USDC?
Build a swap transaction:
Build a swap transaction for the quote I just got.
Send a swap transaction:
Send the swap transaction I just built.
Execute a swap automatically (if you've provided a private key):
Execute a swap of 0.1 SOL to USDC.
If you've configured your environment with a Solana private key, Claude can now execute swaps directly without requiring you to sign transactions manually. This feature uses the private key from your environment to:
All in one step!
If you encounter errors during swap execution:
LOG_LEVEL=debug
in your environment variables to get detailed logsTo add new tools to the MCP server:
src/tools.ts
handlers
object in src/tools.ts
npm run build
npm test
Make sure you're logged in to npm:
npm login
Then publish the package:
npm publish
To publish a new version, first update the version in package.json:
npm version patch # or minor, or major npm publish
MIT