solana-mcp

MCP.Pizza Chef: omaidf

The Solana MCP Server is a Python-based implementation of the Model Context Protocol tailored for the Solana blockchain. It offers real-time blockchain data processing, RESTful API endpoints, and WebSocket support for live updates, enabling seamless interaction with Solana blockchain data and models. Designed for developers integrating Solana data into AI workflows, it supports both development and production environments with easy setup via Docker or direct Python execution.

Use This MCP server To

Access real-time Solana blockchain data via RESTful APIs Stream live Solana blockchain updates using WebSocket Integrate Solana blockchain context into AI models Develop AI agents with direct Solana data access Build blockchain monitoring dashboards with live data feeds Automate Solana transaction analysis and reporting

README

Solana Model Context Protocol (MCP) Server

A Python-based server implementing the Model Context Protocol for the Solana blockchain. This server provides an interface for interacting with Solana blockchain data and models.

Features

  • Real-time Solana blockchain data processing
  • Model Context Protocol implementation
  • RESTful API endpoints for blockchain interaction
  • WebSocket support for real-time updates

Setup

Standard Setup

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Set up environment variables:
    cp .env.example .env
    
  4. Edit .env file with your Solana RPC node details

Docker Setup

  1. Build the Docker image:

    docker build -t solana-mcp-server .
    
  2. Run the Docker container:

    docker run -p 8000:8000 --env-file .env solana-mcp-server
    

Running the Server

Development mode:

python main.py

Production mode:

uvicorn main:app --host 0.0.0.0 --port 8000

Docker mode:

docker run -p 8000:8000 --env-file .env solana-mcp-server

API Documentation

Once the server is running, access API documentation at:

http://localhost:8000/docs

Environment Variables

The following environment variables can be configured:

  • HOST: Server host (default: 0.0.0.0)
  • PORT: Server port (default: 8000)
  • DEBUG: Enable debug mode (default: False)
  • LOG_LEVEL: Logging level (default: INFO)
  • CORS_ORIGINS: Comma-separated list of allowed CORS origins (default: *)
  • RELOAD: Enable hot reload for development (default: False)

Enhanced Solana Analytics API

The server provides enhanced Solana analytics capabilities through the following endpoints:

Token Information

POST /api/analyzer/token

Get detailed information about a token including price, market cap, and supply data.

Whale Detection

POST /api/analyzer/whales

Identify large holders ("whales") of specific tokens with configurable thresholds.

Enhanced Account Analysis

POST /api/analyzer/account

Get detailed parsed account information with additional context.

Token Accounts with Pricing

POST /api/analyzer/token-accounts

Get token accounts for an address with enriched pricing and valuation data.

solana-mcp FAQ

How do I set up the Solana MCP Server?
Clone the repo, install dependencies with pip, configure your .env with Solana RPC details, then run the server in development or production mode.
Can I run the Solana MCP Server using Docker?
Yes, build the Docker image and run the container with your environment variables for easy deployment.
What protocols does the Solana MCP Server support for data access?
It supports RESTful API endpoints for standard requests and WebSocket for real-time blockchain updates.
How does the server handle real-time data from the Solana blockchain?
It uses WebSocket connections to stream live blockchain events and updates to clients.
Is the Solana MCP Server compatible with multiple LLM providers?
Yes, it is designed to work with various LLMs like OpenAI, Claude, and Gemini by providing standardized blockchain context.
What environment variables are required to run the server?
You need to set your Solana RPC node details in the .env file to connect to the blockchain network.
Can I use the Solana MCP Server for production workloads?
Yes, it supports production deployment using Uvicorn with configurable host and port settings.
Does the server provide any security features for blockchain data access?
While the server provides scoped API access, security depends on your environment setup and Solana RPC node configuration.