MCP HubMCP Hub
noahgsolomon

pumpfun-mcp-server

by: noahgsolomon

pumpfun mcp server

8created 14/03/2025
Visit
pumpfun
server

📌Overview

Purpose: The pumpfun-mcp framework serves as a Model Context Protocol server, enabling AI assistants to interact with the Pump.fun platform on Solana for creating, buying, and selling tokens.

Overview: This server facilitates seamless integration with Pump.fun, allowing users to manage token transactions efficiently. By leveraging Solana's blockchain, it provides a secure and straightforward interface for executing token operations.

Key Features:

  • Token Management: The framework offers tools to create new tokens, retrieve token information, buy or sell tokens, and manage account balances, simplifying the overall user experience.

  • Account Management: It automatically manages Solana keypairs and provides functionalities for listing accounts and checking balances, ensuring users can easily oversee their assets.

  • Standalone Scripts: A set of executable scripts allows users to perform specific actions like creating or managing tokens directly from the command line without additional coding.


pumpfun-mcp

A Model Context Protocol (MCP) server for interacting with the Pump.fun platform on Solana. This server allows AI assistants to create, buy, and sell tokens on the platform.

Usage

To use this server with Claude or other MCP-compatible AI assistants, add the following configuration to your MCP client:

For MacOS users, modify the ~/Library/Application Support/Claude/claude_desktop_config.json as follows:

{
  "mcpServers": {
    "pumpfun": {
      "command": "node",
      "args": ["/path/to/your/pumpfun-mcp/build/index.js"],
      "env": {
        "HELIUS_RPC_URL": "https://your-helius-rpc-url.com"
      }
    }
  }
}

Replace https://your-helius-rpc-url.com with your Helius RPC URL.

Installation

  1. Clone the repository:

    git clone https://github.com/noahgsolomon/pumpfun-mcp.git
    cd pumpfun-mcp
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file with your Solana RPC URL:

    HELIUS_RPC_URL=https://your-helius-rpc-url.com
    

    Optionally, add your private key for an existing Solana wallet:

    PRIVATE_KEY=your-base58-encoded-private-key
    

    Run the conversion script to create a keypair file:

    node convert-key.js
    
  4. Build the project:

    npm run build
    
  5. Run the MCP server:

    node build/index.js
    

Components

Tools

  • get-token-info: Retrieves information about a Pump.fun token.

    • Parameters: tokenAddress (required)
  • create-token: Creates a new Pump.fun token.

    • Parameters: name, symbol, description, initialBuyAmount (required), imageUrl (optional), accountName (optional)
  • buy-token: Buys a Pump.fun token.

    • Parameters: tokenAddress, buyAmount (required), accountName (optional), slippageBasisPoints (optional)
  • sell-token: Sells a Pump.fun token.

    • Parameters: tokenAddress, sellAmount (required), accountName (optional), slippageBasisPoints (optional)
  • list-accounts: Lists all accounts in the keys folder.

  • get-account-balance: Gets SOL and token balances for an account.

    • Parameters: accountName (optional), tokenAddress (optional)

Account Management

The MCP manages Solana keypairs in the .keys folder. Each keypair is stored as a JSON file. For custom accounts, add your private key to the .env file and ensure you have sufficient SOL.

Standalone Scripts

The project includes standalone scripts:

  • Get Token Info: node build/get-token-info.js <token_address>
  • Create Token: node build/create-token.js <name> <symbol> <description> <initial_buy_amount> [account_name]
  • Buy Token: node build/buy-token.js <token_address> <buy_amount_sol> [account_name]
  • Sell Token: node build/sell-token.js <token_address> <sell_amount> [account_name]
  • List Accounts: node build/list-accounts.js
  • Get Account Balance: node build/get-token-balance.js <account_name> [token_address]

Important Notes

  • Security: Keypairs are stored unencrypted. Secure the .keys folder.
  • Fees: Transactions require SOL for fees; ensure accounts have sufficient SOL.
  • Slippage: Default slippage tolerance is 1% (100 basis points).
  • Images: When creating tokens with images, local file paths are required.

Development

Project Structure

  • src/index.ts: Main entry point
  • Other source files manage token functions, account management, and utilities.

Building

To build the project:

npm run build