pumpswap-mcp
pumpswap-mcp
README
PumpSwap MCP Server
An MCP server that enables AI agents to interact with PumpSwap for real-time token swaps and automated on-chain trading.
Features
- 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 for a given token mint.
Prerequisites
- Python 3.13 or higher
- uv for dependency management and script execution
- Solana RPC endpoint (e.g.,
https://api.mainnet-beta.solana.com) - A valid Solana private key for transaction signing
Installation
-
Clone the Repository:
git clone https://github.com/kukapay/pumpswap-mcp.git cd pumpswap-mcp -
Install uv: If
uvis not installed, follow the official uv installation guide. For example:curl -LsSf https://astral.sh/uv/install.sh | sh -
Set Up Dependencies: Use
uvto install dependencies:uv sync -
Configure Environment Variables: Create a
.env.privatefilein the project root with the following variables:HTTPS_RPC_ENDPOINT=https://api.mainnet-beta.solana.com BUY_SLIPPAGE=0.3 SELL_SLIPPAGE=0.1 SWAP_PRIORITY_FEE=1500000 PRIVATE_KEY=your-solana-private-keyReplace
your-solana-private-keywith your actual Solana private key.
Usage
Run the MCP Server
Use uv to run the server:
uv run main.py
The server will listen for MCP commands and expose the following tools:
buy_token(mint: str, sol_amount: float, user_private_key: str): Buy tokens with SOL.sell_token(mint: str, token_amount: float, user_private_key: str): Sell tokens for SOL.get_token_price(mint: str): Fetch the current token price in SOL.get_pool_data(mint: str): Retrieve formatted pool data for a token.
Buy Tokens
Prompt:
Buy 0.1 SOL worth of tokens with mint address FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump.
This triggers buy_token("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump", 0.1).
Expected Output:
Buy successful for 0.1 SOL of token FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump
Transaction ID: <transaction-id>
Amount: <token-amount>
Token Price (SOL): <price>
Sell Tokens
Prompt:
Sell 1000 tokens of FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump.
This triggers sell_token("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump", 1000).
Expected Output:
Sell successful for 1000 tokens of FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump
Transaction ID: <transaction-id>
Amount: <sol-amount>
Token Price (SOL): <price>
Get Token Price
Prompt:
What is the current price of the token with mint FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump?
This triggers get_token_price("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump").
Expected Output:
The current price of token FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump is <price> SOL.
Get Pool Data
Prompt:
Show me the pool data for the token with mint FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump.
This triggers get_pool_data("FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump").
Expected Output:
PumpPool Data for mint FC988ZAKRPc26wefDAxcYWB8kgbJTH4Tg3qDvf7xpump:
Pool Bump: <bump>
Index: <index>
Creator: <creator-pubkey>
Base Mint: <base-mint>
Quote Mint: <quote-mint>
LP Mint: <lp-mint>
Pool Base Token Account: <base-account>
Pool Quote Token Account: <quote-account>
LP Supply: <supply>
Environment Variables
The server uses the following environment variables, loaded from .env.private:
| Variable | Description | Default Value |
|---|---|---|
HTTPS_RPC_ENDPOINT |
Solana RPC endpoint URL | https://api.mainnet-beta.solana.com |
BUY_SLIPPAGE |
Slippage tolerance for buy transactions | 0.3 (30%) |
SELL_SLIPPAGE |
Slippage tolerance for sell transactions | 0.1 (10%) |
SWAP_PRIORITY_FEE |
Priority fee for transactions (in lamports) | 1500000 |
PRIVATE_KEY |
Solana private key for signing transactions | None (required) |
Ensure PRIVATE_KEY is set, as the server will raise an error if it's missing.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Disclaimer
This 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。