Solana区块链MCP服务器

Solana MCP服务器通过自然语言为AI代理提供Solana区块链数据查询、代币分析、交易追踪和风险评估服务,适用于需要链上数据访问的AI应用与开发场景。

  • by dynamolabs
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 dynamolabs/solana-mcp

使用说明

🌐 Solana MCP Server

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

🤔 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

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

2. Configure

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 — free tier is plenty for personal use.

3. Build

npm run build

🔌 Integration

Claude Desktop

Add to your claude_desktop_config.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:

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

Clawdbot

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

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

Test Standalone

# 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 Solana RPC, transactions, token data Free tier available
DexScreener Prices, trending tokens Free, no key needed

🛠️ Development

# 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.


Built with ☕ by Dynamo