Skip to main content

A production-ready MCP server for Solana blockchain trading operations using PumpPortal Lightning API

Project description

Pump Portal MCP Server 🚀

A production-ready Model Context Protocol (MCP) server that provides Solana blockchain trading operations through PumpPortal Lightning API. Create wallets, launch tokens, and execute trades with reliable transaction handling.

✨ Features

  • 🏦 Wallet Management: Create secure trading wallets with API keys
  • 🪙 Token Creation: Launch new SPL tokens with metadata and social links
  • 💰 Trading Operations: Buy and sell tokens across multiple DEXs
  • 💸 Fee Collection: Claim creator fees from token trading activity
  • 🔄 Lightning API: Reliable transaction execution via PumpPortal infrastructure
  • 🛡️ Production Ready: Comprehensive error handling, logging, and validation
  • 📊 Trading Resources: Access wallet info and trading status via MCP resources

🚀 Quick Start

Prerequisites

  1. PumpPortal API Key - Create a wallet using the create_wallet tool
  2. Python 3.11+ (for development only)

Installation

Option 1: From Source

git clone https://github.com/pump-portal/pump-portal-mcp-server.git
cd pump-portal-mcp-server
uv sync

Option 2: Using uvx (when published)

uvx pump-portal-mcp-server@latest

🔧 Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "pump-portal": {
      "command": "python",
      "args": ["-m", "pump_portal_mcp_server.server"],
      "cwd": "/path/to/pump-portal-mcp-server",
      "env": {
        "API_KEY": "your-pumpportal-api-key-here"
      }
    }
  }
}

Getting your API key:

You have three options to get your API key:

Option 1: Use the create_wallet tool (Recommended)

  1. Start the server temporarily without an API key
  2. Use the create_wallet tool to generate a new wallet
  3. Copy the apiKey from the response
  4. Update your configuration with the API key
  5. Restart the server

Option 2: Use PumpPortal web interface

  1. Visit https://pumpportal.fun/trading-api/setup
  2. Click 'Create Wallet'
  3. Copy the apiKey from the response
  4. Update your configuration with the API key

Option 3: Use curl command

curl 'https://pumpportal.fun/api/create-wallet'

Copy the apiKey from the response and update your configuration.

Configuration file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Claude Code (VS Code Extension)

Install and configure in VS Code:

  1. Install the Claude Code extension
  2. Open Command Palette (Cmd/Ctrl + Shift + P)
  3. Run "Claude Code: Add MCP Server"
  4. Configure:
    {
      "name": "pump-portal",
      "command": "python",
      "args": ["-m", "pump_portal_mcp_server.server"],
      "cwd": "/path/to/pump-portal-mcp-server",
      "env": {
        "API_KEY": "your-pumpportal-api-key-here"
      }
    }
    

🛠️ Available Tools

Wallet Operations

create_wallet

Create a new trading wallet and API key.

Returns:

  • apiKey: For Lightning API operations
  • walletPublicKey: Public key for receiving funds
  • privateKey: Keep secure for wallet access

Token Operations

create_token

Launch a new SPL token on PumpPortal.

Parameters:

  • name: Token name
  • symbol: Token ticker (1-10 chars)
  • description: Token description
  • dev_buy_amount: SOL amount for initial buy (min 0.01)
  • image_base64: Token icon (base64 encoded, optional)
  • twitter: Twitter URL (optional)
  • telegram: Telegram URL (optional)
  • website: Website URL (optional)
  • slippage: Slippage percentage (default: 10)
  • priority_fee: Priority fee in SOL (default: 0.0005)

Example:

create_token(
    name="My Token",
    symbol="MTK",
    description="A revolutionary token",
    dev_buy_amount=0.1,
    twitter="https://twitter.com/mytoken",
    website="https://mytoken.com"
)

Trading Operations

buy_token

Buy tokens using Lightning API.

Parameters:

  • mint: Token contract address
  • amount: Amount to trade
  • denominated_in_sol: "true" for SOL amount, "false" for token count
  • slippage: Slippage percentage (default: 10)
  • priority_fee: Priority fee in SOL (default: 0.0005)
  • pool: Exchange pool (pump, raydium, pump-amm, launchlab, raydium-cpmm, bonk, auto)

sell_token

Sell tokens using Lightning API.

Parameters:

  • mint: Token contract address
  • amount: Amount to trade (can be "100%" to sell all)
  • denominated_in_sol: "true" for SOL amount, "false" for token count
  • slippage: Slippage percentage (default: 10)
  • priority_fee: Priority fee in SOL (default: 0.0005)
  • pool: Exchange pool (pump, raydium, pump-amm, launchlab, raydium-cpmm, bonk, auto)

claim_fees

Claim creator fees from trading activity.

Parameters:

  • pool: Pool type ("pump" or "meteora-dbc")
  • mint: Token address (required for meteora-dbc)
  • priority_fee: Priority fee in SOL (default: 0.000001)

📊 Available Resources

Wallet Information

  • pumpportal://wallet/current - Current wallet configuration and status
  • pumpportal://status/trading - Trading service capabilities and settings

💡 Available Prompts

Trading Guidance

  • token_launch_checklist - Comprehensive token launch checklist
  • trading_strategy_guide - Trading strategies and risk management
  • portfolio_management - Portfolio diversification and management

⚙️ Environment Variables

# Required
API_KEY=your-pumpportal-api-key-here

# Optional
DEFAULT_SLIPPAGE=10                    # Default slippage percentage
DEFAULT_PRIORITY_FEE=0.0005           # Default priority fee in SOL
DEFAULT_POOL=pump                      # Default exchange pool
API_TIMEOUT=30                         # API request timeout (seconds)
LOG_LEVEL=INFO                         # DEBUG, INFO, WARNING, ERROR
LOG_FORMAT=standard                    # standard, json, detailed

🔄 Pool Types

  • pump: Pump.fun tokens (high volatility, new launches)
  • raydium: Established tokens with better liquidity
  • pump-amm: Automated market maker for pump tokens
  • launchlab: LaunchLab platform tokens
  • raydium-cpmm: Raydium constant product market maker
  • bonk: Bonk ecosystem tokens
  • auto: Automatic pool selection based on best conditions

🐛 Troubleshooting

Common Issues

"API_KEY not set"

  • Use one of these methods to get your API key:
  • Add the returned apiKey to your configuration
  • Restart the MCP server

"Trading failed" errors

  • Check your wallet has sufficient SOL balance
  • Verify the token mint address is correct
  • Adjust slippage settings for volatile markets
  • Ensure priority fee is adequate for network conditions

"Token creation failed"

  • Verify dev buy amount is at least 0.01 SOL
  • Check token name and symbol are valid
  • Ensure image is properly base64 encoded if provided
  • Verify all URLs are valid and accessible

Development Setup

For local development:

# Clone repository
git clone https://github.com/pump-portal/pump-portal-mcp-server.git
cd pump-portal-mcp-server

# Install with uv
uv sync

# Set environment (create wallet first to get API key)
export API_KEY=your-api-key-here

# Run locally
uv run python -m pump_portal_mcp_server.server

⚠️ Risk Disclaimer

Trading cryptocurrencies involves substantial risk of loss and is not suitable for all investors. The Pump Portal MCP Server is a tool for executing trades and does not provide financial advice. Always:

  • Do your own research before trading
  • Never invest more than you can afford to lose
  • Understand the risks of cryptocurrency trading
  • Consider consulting with a financial advisor

📄 License

MIT License - see LICENSE for details.

🆘 Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pump_portal_mcp_server-0.1.1.tar.gz (199.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pump_portal_mcp_server-0.1.1-py3-none-any.whl (82.5 kB view details)

Uploaded Python 3

File details

Details for the file pump_portal_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: pump_portal_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 199.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pump_portal_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5a128b14e74a2852ba9324462dc463df360e46d28f273cbcad4f8d4749b3d89a
MD5 2ce2bc321317700fd57518bd1ed20c9e
BLAKE2b-256 4a68de9c244a21cb82909cfc06211c87aeb8bbb52fa02929686933aa635b178c

See more details on using hashes here.

File details

Details for the file pump_portal_mcp_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pump_portal_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b4714adb4faedb327d73a0ad1a0a2393ace077bf7b565bdbbc7d47d429447b9
MD5 87c3e048f44fb9b8bea8f4b20ef22a11
BLAKE2b-256 fa5ab1f0e392d4d4fffa602c7ef44f2c5d9bb1bff9c0bc38e80a771a2f5a796d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page