Jupiter MCP Server

Jupiter MCP Server

Model Context Protocol server providing Claude AI with access to Jupiter's swap API on Solana

quanghuynguyen1902

Developer Tools
Visit Server

README

Jupiter MCP Server

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.

Overview

The MCP server exposes several tools to Claude:

  • jupiter_get_quote: Get a quote for swapping tokens on Jupiter
  • jupiter_build_swap_transaction: Build a swap transaction on Jupiter
  • jupiter_send_swap_transaction: Send a swap transaction on Jupiter
  • jupiter_execute_swap: Execute a complete swap using a wallet private key from environment variables

API Implementation

This server uses Jupiter APIs:

  • Lite API v1 (https://lite-api.jup.ag/swap/v1) for executing swaps

The Lite API provides a simplified interface for building and executing swaps in a single request, which improves reliability.

Prerequisites

  • Node.js (v16 or higher)
  • Claude Desktop application
  • (Optional) A Solana wallet private key for automatic swap execution

Installation

From npm (recommended)

# Install globally
npm install -g jupiter-mcp-server

# Or use with npx
npx jupiter-mcp-server

From source

  1. Clone this repository:

    git clone https://github.com/quanghuynguyen1902/jupiter-mcp-server.git
    cd jupiter-mcp-server
    
  2. Install dependencies:

    npm ci
    
  3. Build the project:

    npm run build
    
  4. Install globally (optional):

    npm install -g ./
    

Configuration

Configure Claude Desktop with Environment Variables

To configure Claude Desktop to use this MCP server with environment variables for automatic swap execution:

  1. Open Claude Desktop

  2. Navigate to the Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\\Claude\\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  3. Add the MCP server configuration with environment variables:

{
  "mcpServers": {
    "jupiter-mcp-server": {
      "command": "jupiter-mcp-server",
      "args": [],
      "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"
      }
    }
  }
}

Environment Variables Description

  • SOLANA_PRIVATE_KEY (required for automatic swap): Your Solana wallet private key in base58 format
  • SOLANA_RPC_ENDPOINT (optional): RPC endpoint URL, defaults to mainnet public endpoint
  • SOLANA_NETWORK (optional): 'mainnet-beta', 'testnet', or 'devnet', defaults to 'mainnet-beta'
  • LOG_LEVEL (optional): 'error', 'warn', 'info', or 'debug', defaults to 'info'

Alternative: Using a .env File

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

Running Locally

# If installed globally
jupiter-mcp-server

# If installed from source
node build/index.js

# Using npx
npx jupiter-mcp-server

Usage

Once configured, restart Claude Desktop. Claude will now have access to the Jupiter swap tools. You can ask Claude to:

  1. Get a quote for swapping tokens:

    What's the quote for swapping 1 SOL to USDC?
    
  2. Build a swap transaction:

    Build a swap transaction for the quote I just got.
    
  3. Send a swap transaction:

    Send the swap transaction I just built.
    
  4. Execute a swap automatically (if you've provided a private key):

    Execute a swap of 0.1 SOL to USDC.
    

Automatic Swap Execution

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:

  1. Get a quote for the swap
  2. Build the transaction
  3. Sign the transaction with your private key
  4. Send the transaction to the network

All in one step!

Troubleshooting

If you encounter errors during swap execution:

  1. Set LOG_LEVEL=debug in your environment variables to get detailed logs
  2. Check that you have provided a valid Solana private key
  3. Ensure your wallet has sufficient SOL for the swap and transaction fees
  4. Verify that you are using the correct input and output token mints

Development

Adding New Tools

To add new tools to the MCP server:

  1. Define the tool in src/tools.ts
  2. Create a handler function in the appropriate handler file
  3. Add the handler to the handlers object in src/tools.ts

Building

npm run build

Testing

npm test

Publishing to npm

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

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python