Solana MCP server

Integrates with Solana's blockchain to enable querying account data, managing tokens, and analyzing transactions using a Rust-based abstraction layer over the RPC API.
Back to servers
Setup instructions
Provider
openSVM
Release date
Jan 14, 2025
Language
Rust
Stats
31 stars

The Solana MCP Server provides a comprehensive interface to Solana blockchain data through the Model Context Protocol. It allows you to query blockchain information directly using natural language conversations with Claude.

Installation Options

Using Pre-built Binaries

  1. Download the appropriate binary from the Releases page:

    • Linux: solana-mcp-server-linux-amd64
    • macOS Intel: solana-mcp-server-macos-amd64
    • macOS Apple Silicon: solana-mcp-server-macos-arm64
    • Windows: solana-mcp-server-windows-amd64.exe
  2. Make the binary executable (Linux/macOS):

    chmod +x solana-mcp-server-*
    
  3. Configure Claude Desktop:

    CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/claude"
    mkdir -p "$CONFIG_DIR"
    echo "{\"mcpServers\":{\"solana\":{\"command\":\"$PWD/solana-mcp-server-*\",\"env\":{\"SOLANA_RPC_URL\":\"https://api.mainnet-beta.solana.com\"}}}}" > "$CONFIG_DIR/config.json"
    

Building from Source

You can build and configure the server from source with this single command:

TEMP_DIR=$(mktemp -d) && cd "$TEMP_DIR" && git clone https://github.com/opensvm/solana-mcp-server.git . && cargo build --release && CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/claude" && mkdir -p "$CONFIG_DIR" && echo "{\"mcpServers\":{\"solana\":{\"command\":\"$PWD/target/release/solana-mcp-server\",\"env\":{\"SOLANA_RPC_URL\":\"https://api.mainnet-beta.solana.com\"}}}}" > "$CONFIG_DIR/config.json" || { rm -rf "$TEMP_DIR"; exit 1; }

Quick Deployment

The server can be deployed to various environments using provided scripts:

# Local development
./scripts/deploy-local.sh

# Docker container
./scripts/deploy-docker.sh

# Kubernetes
./scripts/deploy-k8s.sh

# AWS Lambda
./scripts/deploy-lambda.sh

# Google Cloud Functions  
./scripts/deploy-gcf.sh

# Vercel Edge Functions
./scripts/deploy-vercel.sh

Environment Variables

Configure the server using these environment variables:

  • SOLANA_RPC_URL: (Optional) Solana RPC endpoint. Defaults to "https://api.mainnet-beta.solana.com"
  • SOLANA_COMMITMENT: (Optional) Commitment level (processed|confirmed|finalized). Defaults to "confirmed"
  • SOLANA_PROTOCOL_VERSION: (Optional) MCP protocol version. Defaults to latest

Available RPC Methods

Account Methods

  • getAccountInfo: Returns account information for a given Pubkey

    • Input: pubkey (string) - Base-58 encoded Pubkey
    • Returns: Account data, balance, owner, and metadata
  • getMultipleAccounts: Returns information for multiple Pubkeys

    • Input: pubkeys (array of strings) - List of Pubkeys
    • Returns: Array of account information
  • getProgramAccounts: Returns accounts owned by a program

    • Input: programId (string) - Program Pubkey
    • Returns: Array of owned accounts with data
  • getBalance: Returns SOL balance of an account

    • Input: pubkey (string) - Account Pubkey
    • Returns: Balance in lamports (1 SOL = 1,000,000,000 lamports)
  • getLargestAccounts: Returns 20 largest accounts by balance

    • Input: Optional filter (string) - "circulating" or "nonCirculating"
    • Returns: Array of accounts with balances
  • getMinimumBalanceForRentExemption: Returns minimum balance for rent exemption

    • Input: dataSize (integer) - Size of account data in bytes
    • Returns: Minimum lamports required

Block Methods

  • getBlock: Returns information about a confirmed block

    • Input: slot (integer) - Slot number
    • Returns: Block data including hash, parent, and transactions
  • getBlocks: Returns list of confirmed blocks between slots

    • Input: start_slot (integer), end_slot (integer)
    • Returns: Array of block slots
  • getBlocksWithLimit: Returns list of confirmed blocks with limit

    • Input: start_slot (integer), limit (integer)
    • Returns: Array of block slots
  • getBlockTime: Returns production time of a block

    • Input: slot (integer)
    • Returns: Unix timestamp
  • getBlockHeight: Returns current block height

    • Input: None
    • Returns: Current block height
  • getBlockCommitment: Returns commitment for a block

    • Input: slot (integer)
    • Returns: Block commitment information
  • getBlockProduction: Returns block production information

    • Input: Optional identity (string), range (object)
    • Returns: Block production stats
  • getSlot: Returns current processing slot

    • Input: Optional commitment (string)
    • Returns: Current slot
  • getSlotLeaders: Returns slot leaders for a range

    • Input: startSlot (integer), limit (integer)
    • Returns: Array of validator identity pubkeys
  • getFirstAvailableBlock: Returns lowest available block

    • Input: None
    • Returns: First available block slot
  • getGenesisHash: Returns genesis hash of the ledger

    • Input: None
    • Returns: Genesis hash string

System Methods

  • getHealth: Returns node health status

    • Input: None
    • Returns: "ok" if healthy, error otherwise
  • getVersion: Returns Solana version of the node

    • Input: None
    • Returns: Version info including feature set
  • getIdentity: Returns node's identity pubkey

    • Input: None
    • Returns: Node identity pubkey
  • getClusterNodes: Returns information about all nodes

    • Input: None
    • Returns: Array of node information
  • getLeaderSchedule: Returns leader schedule for an epoch

    • Input: Optional slot (integer), identity (string)
    • Returns: Leader schedule by validator identity
  • getVoteAccounts: Returns info about voting accounts

    • Input: Optional parameters
    • Returns: Current and delinquent vote accounts

Token Methods

  • getTokenAccountBalance: Returns token balance

    • Input: accountAddress (string) - Token account
    • Returns: Token amount with decimals
  • getTokenAccountsByDelegate: Returns token accounts by delegate

    • Input: delegateAddress (string)
    • Returns: Array of token accounts
  • getTokenAccountsByOwner: Returns token accounts by owner

    • Input: ownerAddress (string)
    • Returns: Array of token accounts
  • getTokenLargestAccounts: Returns largest accounts of a token

    • Input: mint (string) - Token mint
    • Returns: Array of largest token accounts
  • getTokenSupply: Returns total supply of a token

    • Input: mint (string) - Token mint
    • Returns: Total supply with decimals

Transaction Methods

  • getTransaction: Returns transaction details

    • Input: signature (string) - Transaction signature
    • Returns: Transaction info and status
  • getSignaturesForAddress: Returns signatures for an address

    • Input: address (string), optional limit (integer)
    • Returns: Array of transaction signatures
  • getSignatureStatuses: Returns statuses of signatures

    • Input: signatures (array of strings)
    • Returns: Array of transaction statuses
  • getTransactionCount: Returns transaction count

    • Input: None
    • Returns: Transaction count
  • simulateTransaction: Simulates a transaction

    • Input: transaction (string) - Encoded transaction
    • Returns: Simulation results
  • sendTransaction: Sends a transaction

    • Input: transaction (string) - Signed encoded transaction
    • Returns: Transaction signature

Usage Examples

After configuration, you can interact with the Solana blockchain through natural language in Claude. Here are some example queries:

Basic Queries

  • "What's the SOL balance of address Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr?"
  • "Show me the current slot number"
  • "Get information about the latest block"
  • "What's the current inflation rate?"
  • "Show me the token accounts owned by address ..."

Multi-Network Queries

  • "List all available SVM networks"
  • "Enable Eclipse mainnet for queries"
  • "Check SOL balance on all enabled networks"
  • "Compare transaction counts across networks"

Advanced Operations

  • "Show me the largest USDC token accounts"
  • "Get the leader schedule for the current epoch"
  • "Find all accounts owned by the SPL Token program"
  • "Check the block production stats for a validator"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "solana" '{"command":"solana-mcp-server","env":{"SOLANA_RPC_URL":"https://api.mainnet-beta.solana.com"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "solana": {
            "command": "solana-mcp-server",
            "env": {
                "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "solana": {
            "command": "solana-mcp-server",
            "env": {
                "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later