Metadata-Version: 2.4
Name: solana-snipe-bot-mcp
Version: 1.0.2
Summary: Solana Sniper Bot MCP Server — control an autonomous Solana meme-coin sniper bot via 32+ MCP tools.
Author-email: Solara Snipe Bot <solara-snipe-bot@example.com>
License: MIT
Project-URL: Homepage, https://github.com/Solara-Snipe-Bot/Solara-Snipe-Bot
Project-URL: Repository, https://github.com/Solara-Snipe-Bot/Solara-Snipe-Bot
Project-URL: Issues, https://github.com/Solara-Snipe-Bot/Solara-Snipe-Bot/issues
Keywords: solana,sniper,mcp,model-context-protocol,trading,bot,pumpfun,meme-coin
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp<3.0.0,>=1.0.0

<!-- mcp-name: io.github.Solara-Snipe-Bot/solana-snipe-bot-mcp -->

<p align="center">
  <img src="https://files.catbox.moe/poqqq0.png" alt="Solana Sniper Bot" width="500">
</p>

<p align="center">
  <strong>Autonomous Solana meme-coin sniper — controlled by Claude, Cursor, Devin, or any MCP-compatible AI.</strong>
</p>

<p align="center">
  <strong>32+ MCP tools. Pump.fun + Jupiter execution. Built-in safety, trend matching, take-profit ladders, and P&L tracking.</strong>
</p>

---

## What Is This?

**Solana Snipe Bot MCP** is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that gives AI assistants full control over the Solana Sniper Bot. It exposes **32+ tools** for starting and stopping the bot, buying and selling tokens, tuning every strategy setting, querying positions and P&L, monitoring Pulse trends, managing wallets, and more.

### How It Works

```
Your AI Assistant (Claude, Cursor, Devin, etc.)
       │
       │  talks MCP (stdio)
       ▼
  solana_snipe_bot_mcp/server.py  ← runs on your machine
       │
       │  reads/writes JSON state files in your snipe-bot directory
       ▼
  SolanaSniperBot.exe (optional)  ← the Windows GUI / bot executable
       │
       ▼
  Helius Solana RPC / WebSocket   ← scans new launches and executes transactions
       │
       ▼
  Pump.fun bonding curve          ← direct buy/sell instructions
  Jupiter Aggregator              ← graduated-token swaps
```

The MCP server runs as a separate process and communicates with the running bot through a `command_queue.json` file. It also reads `config.json`, `open_positions.json`, `trade_history.json`, `pnl_tally.json`, `positions_status.json`, and `pulse_data.json` to give your AI assistant a complete, real-time view of the bot's state.

---

## Quick Start

### Prerequisites

- **Windows 10/11**
- **Python 3.10+**
- **A funded Solana wallet** (trading wallet + savings wallet keypairs)
- **Helius RPC endpoint** with API key
- An MCP-compatible AI assistant (Claude Desktop, Cursor, Devin, Codex, etc.)

### Step 1 — Install the MCP Server

From PyPI:

```bash
pip install solana-snipe-bot-mcp
```

Or run it directly from the repo:

```bash
git clone https://github.com/Solara-Snipe-Bot/Solara-Snipe-Bot.git
cd Solara-Snipe-Bot
python -m solana_snipe_bot_mcp
```

### Step 2 — Configure Your AI Assistant

Set the project directory so the MCP server can find your bot's state files:

```bash
# Windows
set SOLANA_SNIPER_BOT_DIR=P:\snipe-bot

# Or on the command line when launching
python -m solana_snipe_bot_mcp
```

#### Claude Desktop

Edit `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "solana-snipe-bot": {
      "command": "python",
      "args": ["-m", "solana_snipe_bot_mcp"],
      "env": {
        "SOLANA_SNIPER_BOT_DIR": "P:\\snipe-bot"
      }
    }
  }
}
```

#### Cursor

Edit `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "solana-snipe-bot": {
      "command": "python",
      "args": ["-m", "solana_snipe_bot_mcp"],
      "env": {
        "SOLANA_SNIPER_BOT_DIR": "P:\\snipe-bot"
      }
    }
  }
}
```

#### Devin

Add to `mcp_config.json`:

```json
{
  "mcpServers": {
    "snipe-bot": {
      "command": "python",
      "args": ["P:\\snipe-bot\\mcp_server.py"]
    }
  }
}
```

#### Claude Code

```bash
claude mcp add solana-snipe-bot -- python -m solana_snipe_bot_mcp
```

#### Any MCP Client (generic)

The server uses **stdio transport**. Launch it with:

```bash
set SOLANA_SNIPER_BOT_DIR=P:\snipe-bot
python -m solana_snipe_bot_mcp
```

### Step 3 — Start the Bot

Ask your AI assistant:

> "Start the Solana sniper bot"

The assistant calls `start_bot`. Then try:

> "What is my wallet balance and open positions?"

---

## Architecture

### MCP Server (`solana_snipe_bot_mcp/server.py`)

A standalone FastMCP server that:

- Reads `config.json` and all bot state files from `SOLANA_SNIPER_BOT_DIR`
- Writes commands to `command_queue.json` for the running bot to poll
- Exposes 32+ tools grouped by function
- Returns JSON summaries for config, positions, P&L, Pulse, wallet, fees, and log

### Bot (`snipe_bot.py`)

The Windows bot that:

- Subscribes to Solana WebSocket for new token launches
- Runs safety and market filters
- Executes Pump.fun bonding-curve or Jupiter swaps
- Monitors open positions with take-profit, stop-loss, and rug signals
- Writes state files that the MCP server reads

---

## All 32+ Tools

### Bot Control (6 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `start_bot` | — | Start the snipe bot (equivalent to the GUI 'Start Bot' button) |
| `stop_bot` | — | Stop the snipe bot gracefully |
| `sell_all` | — | Panic-sell ALL open positions immediately |
| `sell_position` | `mint` | Sell a single position by mint address |
| `buy_mint` | `mint` | Buy a specific token by mint address after safety checks |
| `get_bot_stats` | — | Get operational statistics from the bot log |

### Configuration (3 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_config` | — | Get the current `config.json` as JSON |
| `update_config` | `key`, `value` | Update a single config key; some settings require a restart |
| `save_settings` | — | Persist current settings to `config.json` |

### Positions & Status (5 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_open_positions` | — | List all unsold (open) positions |
| `get_positions_status` | — | Real-time P&L, portfolio value, SOL price, active count |
| `get_graduation_status` | `mint` (optional) | Check if a token graduated from Pump.fun to Raydium |
| `close_position` | `mint` | Manually close a position without executing an on-chain sell |
| `get_bot_status` | — | Summary of open positions, wallet, and P&L |

### Trade History & P&L (4 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_trade_history` | `limit` | Get recent BUY/SELL records |
| `clear_trade_history` | — | Clear `trade_history.json` (irreversible) |
| `get_pnl_tally` | — | Get the persistent all-time P&L tally |
| `reset_pnl_tally` | — | Reset the P&L tally to zero |

### P&L, Fees & Wallet (4 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_wallet_balances` | — | Trading wallet, savings wallet, and open-position values |
| `transfer_sol` | `direction`, `amount_sol` | Move SOL between trading and savings wallets |
| `move_all_sol` | `direction` | Move ALL SOL between wallets |
| `get_fee_summary` | — | Transaction fees, ATA rent locked/recoverable |

### P&L Refresh (1 tool)

| Tool | Parameters | Description |
|------|------------|-------------|
| `refresh_pnl` | — | Force a full P&L recompute from history and balances |

### Pulse Trend Matching (4 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_pulse_results` | — | Get tokens that matched current Google/X trending topics |
| `set_pulse_match_mode` | `mode` | Set match mode: `exact`, `word`, or `fuzzy` |
| `clear_pulse_results` | — | Clear `pulse_data.json` |
| `get_pulse_price_history` | `mint` | Get price-at-match, current price, and price history |

### Log (2 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_log` | `tail_lines` | Read the last N lines of `snipe_bot.log` |
| `clear_log` | — | Clear the log file |

### Command Queue (2 tools)

| Tool | Parameters | Description |
|------|------------|-------------|
| `get_pending_commands` | — | View the current `command_queue.json` |
| `clear_commands` | — | Clear the command queue |

### ATA Rent (1 tool)

| Tool | Parameters | Description |
|------|------------|-------------|
| `close_empty_token_accounts` | — | Close all empty token accounts and reclaim ~0.002 SOL each |

---

## Example Conversations with Your AI

> "Start the bot"

→ `start_bot`

> "What are my open positions and what is the current P&L?"

→ `get_open_positions` + `get_positions_status`

> "Buy this mint: 6EF8rBh8gKQj6n5hX2P9Yq3wL4ZmN7vK8xT5fD1sQ2aR"

→ `buy_mint`

> "Sell half of my MEMRA position"

→ Note: partial sells are not yet a standalone tool; use the GUI or queue a custom command.

> "How much have I paid in fees and ATA rent?"

→ `get_fee_summary`

> "Show me the last 50 log lines"

→ `get_log(50)`

---

## Safety & Risk

This is a live-trading tool. The included filters reduce but do not eliminate risk. Use only funds you can afford to lose. All MCP actions execute immediately with no confirmation unless the client itself asks for one.

---

## License & Support

This project is freeware for personal use. If it helps you, tips are appreciated.

<p align="center">
  <a href="https://buy.stripe.com/9B6eVd3vP3Et5465MI7bW05">
    <img src="https://files.catbox.moe/2twkvg.png" alt="Buy me a coffee / Tip Jar" width="280">
  </a>
</p>

<p align="center">
  <strong><a href="https://buy.stripe.com/9B6eVd3vP3Et5465MI7bW05">Leave a $5 tip via Stripe</a></strong>
</p>

---

**GitHub:** https://github.com/Solara-Snipe-Bot/Solara-Snipe-Bot  
**PyPI:** https://pypi.org/project/solana-snipe-bot-mcp/  
**Landing Page:** https://solara-snipe-bot.github.io/Solara-Snipe-Bot/
