Solana Blockchain MCP server

Enables interaction with the Solana blockchain for performing operations like querying account data, sending transactions, and interacting with smart contracts through the AgentiPy framework.
Back to servers
Setup instructions
Provider
Niceberg
Release date
Apr 09, 2025
Language
Python
Package
Stats
49.1K downloads
3 stars

This MCP server extends Claude's capabilities by enabling interaction with the Solana blockchain through a standardized interface. It provides a comprehensive set of tools for blockchain operations, including transactions, wallet management, price predictions, trading, and cross-chain actions.

Prerequisites

  • Python 3.8 or higher
  • Claude Desktop installed
  • Solana wallet with private key
  • Solana RPC URL (mainnet, testnet, or devnet)
  • OpenAI API Key (optional)
  • Allora API Key (optional)
  • CoinGecko Pro API Key (optional)

Installation

Quick Install (Recommended)

# Clone the repository
git clone https://github.com/niceberginc/agentipy-mcp
cd agentipy-mcp

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows, use `.venv\Scripts\activate`

# Install dependencies
pip install -r requirements.txt

Manual Setup

  1. Create a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows, use `.venv\Scripts\activate`
  1. Install required packages:
pip install agentipy>=2.0.8 cryptography>=3.4.7 python-dotenv>=0.17.1 web3>=7.8.0 allora_sdk>=0.2.0 mcp>=1.4.0

Configuration

Environment Setup

Create a .env file with your credentials:

# Solana Configuration
SOLANA_PRIVATE_KEY=your_private_key_here
RPC_URL=your_solana_rpc_url_here

# Optional API Keys
OPENAI_API_KEY=your_openai_api_key
ALLORA_API_KEY=your_allora_api_key
COINGECKO_PRO_API_KEY=your_coingecko_api_key

Integration with Claude Desktop

To add this MCP server to Claude Desktop:

  1. Locate the Claude Desktop 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 the Configuration

    Create or edit the configuration file and add the following JSON:

    {
      "mcpServers": {
        "agentipy": {
          "command": "/path/to/your/run_mcp.sh",
          "env": {
            "RPC_URL": "your_solana_rpc_url_here",
            "SOLANA_PRIVATE_KEY": "your_private_key_here",
            "OPENAI_API_KEY": "your_openai_api_key",
            "ALLORA_API_KEY": "your_allora_api_key",
            "COINGECKO_PRO_API_KEY": "your_coingecko_api_key"
          },
          "disabled": false,
          "autoApprove": ["GET_BALANCE", "GET_PRICE_PREDICTION"]
        }
      }
    }
    

    Note: For Windows, use .bat instead of .sh in the command path.

  3. Restart Claude Desktop

    After making these changes, restart Claude Desktop for the configuration to take effect.

Available Tools

Native Solana Actions

  • GET_BALANCE - Check wallet balance
  • TRANSFER - Transfer tokens between wallets
  • DEPLOY_TOKEN - Deploy new tokens on Solana

Allora Actions

  • GET_PRICE_PREDICTION - Get price predictions
  • GET_ALL_TOPICS - Get available topics

Jupiter Actions

  • STAKE_WITH_JUP - Stake tokens using Jupiter
  • TRADE_WITH_JUP - Trade tokens using Jupiter

DeBridge Actions

  • CREATE_DEBRIDGE_TRANSACTION - Create a cross-chain bridge transaction
  • EXECUTE_DEBRIDGE_TRANSACTION - Execute a cross-chain bridge transaction
  • CHECK_TRANSACTION_STATUS - Check the status of a cross-chain bridge transaction

Pyth Actions

  • PYTH_GET_PRICE - Get the price of a coin from Pyth

CoinGecko Actions

  • COINGECKO_GET_TOKEN_INFO - Get token information from CoinGecko
  • COINGECKO_GET_COIN_PRICE_VS - Get the price of a coin in a specific currency
  • COINGECKO_GET_TOP_GAINERS - Get the top gainers
  • COINGECTO_GET_TRENDING_POOLS - Get the trending pools
  • COINGECKO_GET_TRENDING_TOKENS - Get the trending tokens
  • COINGECKO_GET_TOKEN_PRICE_DATA - Get token price data
  • COINGECKO_GET_LATEST_POOLS - Get the latest pools

Troubleshooting

If you encounter issues:

  1. Verify your Solana private key is correct
  2. Check your RPC URL is accessible
  3. Ensure all dependencies are installed correctly
  4. Verify your .env file contains the correct credentials
  5. Check Claude Desktop logs for error messages

Security Considerations

  • Keep your private key secure and never share it
  • Use environment variables for sensitive information
  • Consider using a dedicated wallet for AI agent operations
  • Regularly monitor and audit AI agent activities
  • Test operations on devnet/testnet before mainnet

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 "agentipy" '{"command":"/path/to/your/run_mcp.sh","env":{"RPC_URL":"your_solana_rpc_url_here","SOLANA_PRIVATE_KEY":"your_private_key_here","OPENAI_API_KEY":"your_openai_api_key","ALLORA_API_KEY":"your_allora_api_key","COINGECKO_PRO_API_KEY":"your_coingecko_api_key"},"disabled":false,"autoApprove":["GET_BALANCE","GET_PRICE_PREDICTION"]}'

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": {
        "agentipy": {
            "command": "/path/to/your/run_mcp.sh",
            "env": {
                "RPC_URL": "your_solana_rpc_url_here",
                "SOLANA_PRIVATE_KEY": "your_private_key_here",
                "OPENAI_API_KEY": "your_openai_api_key",
                "ALLORA_API_KEY": "your_allora_api_key",
                "COINGECKO_PRO_API_KEY": "your_coingecko_api_key"
            },
            "disabled": false,
            "autoApprove": [
                "GET_BALANCE",
                "GET_PRICE_PREDICTION"
            ]
        }
    }
}

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": {
        "agentipy": {
            "command": "/path/to/your/run_mcp.sh",
            "env": {
                "RPC_URL": "your_solana_rpc_url_here",
                "SOLANA_PRIVATE_KEY": "your_private_key_here",
                "OPENAI_API_KEY": "your_openai_api_key",
                "ALLORA_API_KEY": "your_allora_api_key",
                "COINGECKO_PRO_API_KEY": "your_coingecko_api_key"
            },
            "disabled": false,
            "autoApprove": [
                "GET_BALANCE",
                "GET_PRICE_PREDICTION"
            ]
        }
    }
}

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