An MCP server that enables AI agents to interact with PumpSwap for real-time token swaps and automated on-chain trading. - Buy Tokens: Purchase tokens using SOL with customizable slippage and priority fees. - Sell Tokens: Sell tokens for SOL with configurable parameters. - Token Price Query: Retrieve current token prices in SOL. - Pool Data Retrieval: Fetch and display detailed pool information fo
Add this skill
npx mdskills install kukapay/pumpswap-mcpWell-documented Solana token swap server with clear setup and usage examples
1# PumpSwap MCP Server23An MCP server that enables AI agents to interact with [PumpSwap](https://swap.pump.fun/) for real-time token swaps and automated on-chain trading.45678910## Features1112- **Buy Tokens**: Purchase tokens using SOL with customizable slippage and priority fees.13- **Sell Tokens**: Sell tokens for SOL with configurable parameters.14- **Token Price Query**: Retrieve current token prices in SOL.15- **Pool Data Retrieval**: Fetch and display detailed pool information for a given token mint.1617## Prerequisites1819- Python 3.13 or higher20- [uv](https://github.com/astral-sh/uv) for dependency management and script execution21- Solana RPC endpoint (e.g., `https://api.mainnet-beta.solana.com`)22- A valid Solana private key for transaction signing2324## Installation25261. **Clone the Repository**:27 ```bash28 git clone https://github.com/kukapay/pumpswap-mcp.git29 cd pumpswap-mcp30 ```31322. **Install uv**:33 If `uv` is not installed, follow the official [uv installation guide](https://github.com/astral-sh/uv#installation). For example:34 ```bash35 curl -LsSf https://astral.sh/uv/install.sh | sh36 ```37383. **Set Up Dependencies**:39 Use `uv` to install dependencies:40 ```bash41 uv sync42 ```43444. **Configure Environment Variables**:45 Create a `.env.private` filein the project root with the following variables:46 ```plaintext47 HTTPS_RPC_ENDPOINT=https://api.mainnet-beta.solana.com48 BUY_SLIPPAGE=0.349 SELL_SLIPPAGE=0.150 SWAP_PRIORITY_FEE=150000051 PRIVATE_KEY=your-solana-private-key52 ```5354 Replace `your-solana-private-key` with your actual Solana private key.5556## Usage5758### Run the MCP Server59 Use `uv` to run the server:60 ```bash61 uv run main.py62 ```6364 The server will listen for MCP commands and expose the following tools:65 - `buy_token(mint: str, sol_amount: float, user_private_key: str)`: Buy tokens with SOL.66 - `sell_token(mint: str, token_amount: float, user_private_key: str)`: Sell tokens for SOL.67 - `get_token_price(mint: str)`: Fetch the current token price in SOL.68 - `get_pool_data(mint: str)`: Retrieve formatted pool data for a token.6970### Buy Tokens7172**Prompt**:73```74Buy 0.1 SOL worth of tokens with mint address FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump.75```7677This triggers `buy_token("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump", 0.1)`.7879**Expected Output**:80```81Buy successful for 0.1 SOL of token FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump82Transaction ID: <transaction-id>83Amount: <token-amount>84Token Price (SOL): <price>85```8687### Sell Tokens88**Prompt**:89```90Sell 1000 tokens of FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump.91```9293This triggers `sell_token("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump", 1000)`.9495**Expected Output**:96```97Sell successful for 1000 tokens of FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump98Transaction ID: <transaction-id>99Amount: <sol-amount>100Token Price (SOL): <price>101```102103### Get Token Price104**Prompt**:105```106What is the current price of the token with mint FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump?107```108This triggers `get_token_price("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump")`.109110**Expected Output**:111```112The current price of token FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump is <price> SOL.113```114115### Get Pool Data116**Prompt**:117```118Show me the pool data for the token with mint FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump.119```120This triggers `get_pool_data("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump")`.121122**Expected Output**:123```124PumpPool Data for mint FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump:125Pool Bump: <bump>126Index: <index>127Creator: <creator-pubkey>128Base Mint: <base-mint>129Quote Mint: <quote-mint>130LP Mint: <lp-mint>131Pool Base Token Account: <base-account>132Pool Quote Token Account: <quote-account>133LP Supply: <supply>134```135136## Environment Variables137138The server uses the following environment variables, loaded from `.env.private`:139140| Variable | Description | Default Value |141|-----------------------|--------------------------------------------------|-------------------------------------|142| `HTTPS_RPC_ENDPOINT` | Solana RPC endpoint URL | https://api.mainnet-beta.solana.com |143| `BUY_SLIPPAGE` | Slippage tolerance for buy transactions | 0.3 (30%) |144| `SELL_SLIPPAGE` | Slippage tolerance for sell transactions | 0.1 (10%) |145| `SWAP_PRIORITY_FEE` | Priority fee for transactions (in lamports) | 1500000 |146| `PRIVATE_KEY` | Solana private key for signing transactions | None (required) |147148Ensure `PRIVATE_KEY` is set, as the server will raise an error if it's missing.149150151## License152153This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.154155## Disclaimer156157This software interacts with decentralized finance (DeFi) protocols and handles sensitive data like private keys. Use it at your own risk. Ensure your `.env.private` file is secure and never share your private key. The authors are not responsible for any financial losses or security issues arising from the use of this software.158159
Full transparency — inspect the skill content before installing.