Skip to main content
Glama
Solana MCP Server

Solana MCP Server

by dynamolabs
README.md
# 🌐 Solana MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
[![MCP](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/)

> Let AI agents interact with the Solana blockchain. Query wallets, track tokens, analyze trades, and assess risk — all through natural language.

<p align="center">
  <img src="assets/demo.gif" alt="Solana MCP Demo" width="600">
</p>

## šŸ¤” What is this?

**MCP (Model Context Protocol)** is the "USB-C for AI" — a standard that lets AI models (Claude, GPT, etc.) connect to external tools. This server exposes Solana blockchain data to any MCP-compatible AI.

Instead of manually checking Solscan or writing scripts, just ask your AI:
- *"What's my wallet balance?"*
- *"Show me trending Solana tokens"*
- *"Is this token safe to buy?"*

## ✨ Features

| Tool | Description |
|------|-------------|
| `get_wallet_balance` | Get SOL and token balances for any wallet |
| `get_token_info` | Full token details with price history, socials, DEX liquidity |
| `get_recent_trades` | Recent swaps/trades from a wallet (buy/sell history) |
| `get_trending_tokens` | Currently trending Solana tokens from DexScreener |
| `get_new_pairs` | Find newly launched tokens (just listed!) |
| `analyze_token` | **Full risk analysis** — see below |
| `check_bundled_launch` | šŸŽÆ Detect sniper/insider bundled buys at launch |
| `get_creator_tokens` | šŸ•µļø Find other tokens by same creator (rug history) |
| `get_whale_transactions` | šŸ‹ Track large buy/sell transactions |
| `get_swap_quote` | šŸ’± Get Jupiter swap quotes |

### šŸ“Š Enhanced Token Info

The `get_token_info` tool now includes:

- **Price Changes** — 5m, 1h, 6h, 24h price movements
- **Token Age** — How old is this token?
- **Pump.fun Detection** — Is this from pump.fun?
- **Social Links** — Twitter, Telegram, Website
- **DEX Liquidity** — Breakdown per DEX

### šŸ›”ļø Token Risk Analysis

The `analyze_token` tool performs comprehensive safety checks:

- **Mint Authority** — Can the creator mint more tokens? (rug risk)
- **Freeze Authority** — Can the creator freeze your tokens?
- **LP Status** — Is liquidity burned or locked?
- **Token Age** — Newer tokens = higher risk
- **Holder Distribution** — Who owns what percentage?
- **Concentration Risk** — Top holder & top 10 analysis
- **Social Presence** — Does it have Twitter/Telegram?

## šŸš€ Quick Start

### 1. Clone & Install

```bash
git clone https://github.com/miftarohmann/solana-mcp.git
cd solana-mcp
npm install
```

### 2. Configure

```bash
cp .env.example .env
```

Edit `.env` and add your Helius API key:
```
HELIUS_API_KEY=your-helius-api-key-here
```

> šŸ’” Get a free API key at [helius.dev](https://helius.dev) — free tier is plenty for personal use.

### 3. Build

```bash
npm run build
```

## šŸ”Œ Integration

### Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "solana": {
      "command": "node",
      "args": ["/path/to/solana-mcp/dist/index.js"],
      "env": {
        "HELIUS_API_KEY": "your-helius-api-key"
      }
    }
  }
}
```

### Cursor / VS Code

Add to your MCP settings:

```json
{
  "mcp": {
    "servers": {
      "solana": {
        "command": "node",
        "args": ["dist/index.js"],
        "cwd": "/path/to/solana-mcp"
      }
    }
  }
}
```

### Clawdbot

Add to your Clawdbot config (`~/.clawdbot/config.yml`):

```yaml
mcp:
  servers:
    - name: solana
      command: node
      args: [/path/to/solana-mcp/dist/index.js]
      env:
        HELIUS_API_KEY: your-key
```

### Test Standalone

```bash
# Run with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js
```

## šŸ’¬ Example Conversations

Once connected, you can ask your AI:

**Wallet Queries:**
> "Check the balance of wallet `7xKXtg...`"
> "What tokens does this wallet hold?"

**Token Research:**
> "Get info on token `BONK`"
> "What's the price and market cap of `JUP`?"

**Trading Analysis:**
> "Show me recent trades from wallet `abc123...`"
> "Is this wallet buying or selling more?"

**Trending & Discovery:**
> "What tokens are trending on Solana right now?"
> "Show me the top 5 movers"

**Risk Assessment:**
> "Analyze this token for risk: `[mint address]`"
> "Is this token safe? Check holder distribution"

## šŸ›”ļø Risk Analysis

The `analyze_token` tool checks for red flags:

**šŸ” Authority Checks:**
- **Mint Authority** — If NOT revoked, creator can mint infinite tokens
- **Freeze Authority** — If NOT revoked, creator can freeze your holdings

**šŸ’§ Liquidity Checks:**
- **LP Burned** — Safest option, liquidity can't be pulled
- **LP Locked** — Good, but check lock duration
- **LP Unlocked** — Risky, potential rug pull

**šŸ‘„ Holder Analysis:**
- **Top Holder %** — >50% = very risky, >20% = moderate risk
- **Top 10 Total** — >80% = concentrated
- **Holder Count** — <100 = low distribution

Returns a risk score (0-100) with detailed explanations and safety checklist.

## šŸ“” APIs Used

| API | Purpose | Cost |
|-----|---------|------|
| [Helius](https://helius.dev) | Solana RPC, transactions, token data | Free tier available |
| [DexScreener](https://dexscreener.com) | Prices, trending tokens | Free, no key needed |

## šŸ› ļø Development

```bash
# Run in development mode (auto-reload)
npm run dev

# Build for production
npm run build

# Start production server
npm start
```

## šŸ“ Project Structure

```
solana-mcp/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts        # MCP server entry point
│   └── solana-api.ts   # Solana/Helius API functions
ā”œā”€ā”€ dist/               # Compiled JavaScript
ā”œā”€ā”€ .env.example        # Environment template
ā”œā”€ā”€ package.json
└── README.md
```

## šŸ¤ Contributing

Contributions welcome! Feel free to:
- Report bugs
- Suggest features
- Submit PRs

## šŸ“„ License

MIT — do whatever you want with it.

---

<p align="center">
  Built with ā˜• by <a href="https://twitter.com/callmedinamo">Dynamo</a>
</p>

TDQS

B3.4/5.0

Scored across 10 tools

Disambiguation4/5

Most tools target clearly distinct objects: wallet balance, token info, trending tokens, new pairs, swap quote, and risk/insider checks each have a unique angle. Minor overlap exists between get_recent_trades (wallet-centric) and get_whale_transactions (token-centric, size-filtered), and between get_token_info and analyze_token, but descriptions make the boundaries reasonably clear.

Naming Consistency4/5

Nine of ten tools follow a clean get_<noun> snake_case pattern (get_wallet_balance, get_token_info, get_new_pairs, etc.). The single outlier, analyze_token, drops the get_ prefix but remains readable and semantically appropriate for an analysis action.

Tool Count5/5

Ten tools is well within the ideal 3-15 range and each covers a distinct Solana analytics need (balance, token metadata, discovery, risk, whale activity, quoting). No tool feels redundant or filler.

Completeness4/5

The surface covers wallet inspection, token discovery, risk/rug analysis, whale tracking, and swap quoting — a coherent read-only analytics domain. Gaps remain at the edges: no swap execution or transaction submission, no price/OHLC history, and no direct holder-list or token-search endpoint, but agents can work around these for most analysis workflows.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues