Solana MCP server

Integrates Solana blockchain with natural language commands to enable querying balances, handling transactions, and retrieving blockchain data.
Back to servers
Setup instructions
Provider
Tywen Kelly
Release date
Jan 26, 2025
Language
Python
Stats
3 stars

This MCP Server for Solana allows Claude to interact with the Solana blockchain directly. It provides access to numerous Solana RPC methods, letting you retrieve blockchain data, check balances, and perform various chain operations through Claude's interface.

Installation

Prerequisites

Before installing the MCP server, ensure you have:

  • Git
  • Python
  • uv (Python package manager)
  • Claude Desktop application

Installation Steps

  1. Clone the repository:

    git clone [email protected]:tywenk/mcp-sol.git
    
  2. Navigate to the project directory:

    cd mcp-sol
    
  3. Install dependencies:

    uv sync
    
  4. Install the MCP server:

    mcp install src/server.py
    

Configure Claude Desktop

On macOS, you need to modify the Claude Desktop configuration file located at: /Users/{user}/Library/Application Support/Claude

Edit the JSON configuration to include the MCP server with absolute paths:

{
  "globalShortcut": "Alt+Space",
  "mcpServers": {
    "Solana Client": {
      "command": "/Users/yourusername/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/yourusername/Developer/mcp-sol",
        "run",
        "--with",
        "mcp",
        "mcp",
        "run",
        "/Users/yourusername/Developer/mcp-sol/src/server.py"
      ]
    }
  }
}

Make sure to replace yourusername with your actual username and adjust any paths as needed.

Quick Install via Smithery (Alternative)

For an automated installation process, you can use Smithery:

npx -y @smithery/cli install @tywenk/mcp-solana --client claude

Available Tools

The Solana MCP Server provides access to numerous Solana RPC methods, including:

Account and Token Information

  • get_balance - Get the balance of an account
  • get_account_info - Get all information associated with an account
  • get_token_account_balance - Get token balance for a specific account
  • get_token_accounts_by_delegate - Get token accounts by delegate
  • get_token_accounts_by_owner - Get token accounts by owner
  • get_token_largest_accounts - Get largest token accounts
  • get_token_supply - Get total supply of a token

Block and Transaction Information

  • get_transaction - Get transaction details
  • get_block - Get block details
  • get_block_height - Get current block height
  • get_block_time - Get block time
  • get_blocks - Get a range of blocks
  • get_latest_blockhash - Get the most recent blockhash
  • get_signatures_for_address - Get signatures for transactions involving an address
  • get_signature_statuses - Check statuses of signatures
  • confirm_transaction - Confirm if a transaction is processed

Network Information

  • get_cluster_nodes - Get information about the nodes in the cluster
  • get_epoch_info - Get current epoch information
  • get_epoch_schedule - Get epoch schedule information
  • get_identity - Get the identity of the node
  • get_inflation_governor - Get inflation parameters
  • get_inflation_rate - Get current inflation rate
  • get_largest_accounts - Get accounts with largest balances
  • get_recent_performance_samples - Get recent performance samples
  • get_slot - Get current slot
  • get_slot_leader - Get leader for current slot
  • get_supply - Get information about circulating supply
  • get_version - Get node software version
  • get_vote_accounts - Get vote accounts
  • is_connected - Check if connected to the network

Transactions

  • request_airdrop - Request an airdrop of SOL
  • send_transaction - Send a transaction to the network
  • get_fee_for_message - Calculate the fee for a message

Usage Examples

To use the Solana client in Claude Desktop:

  1. Start Claude Desktop application
  2. Access the MCP Solana server tools through Claude's interface
  3. Use natural language to ask Claude to perform Solana operations, such as:
    • "Check the balance of wallet address 5YNmX..."
    • "Get the latest block information"
    • "Show me recent transactions for address 8UBxL..."

Claude will use the appropriate Solana RPC methods to fetch the requested information and display it to you.

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-Client" '{"command":"/Users/tywen/.local/bin/uv","args":["--directory","/Users/tywen/Developer/mcp-sol","run","--with","mcp","mcp","run","/Users/tywen/Developer/mcp-sol/src/server.py"]}'

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 Client": {
            "command": "/Users/tywen/.local/bin/uv",
            "args": [
                "--directory",
                "/Users/tywen/Developer/mcp-sol",
                "run",
                "--with",
                "mcp",
                "mcp",
                "run",
                "/Users/tywen/Developer/mcp-sol/src/server.py"
            ]
        }
    }
}

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 Client": {
            "command": "/Users/tywen/.local/bin/uv",
            "args": [
                "--directory",
                "/Users/tywen/Developer/mcp-sol",
                "run",
                "--with",
                "mcp",
                "mcp",
                "run",
                "/Users/tywen/Developer/mcp-sol/src/server.py"
            ]
        }
    }
}

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