MCP cover image

Solana MCP Server

2

Github Watches

0

Github Forks

2

Github Stars

Solana Model Context Protocol (MCP)

A comprehensive Solana blockchain interaction server that implements the Model Context Protocol (MCP), optimized for seamless integration with AI tools and interfaces.

What is Model Context Protocol?

Model Context Protocol (MCP) provides a standardized way for AI tools and language models to interact with blockchain data. This implementation allows AI agents to:

  • Query Solana blockchain data using natural language
  • Access structured token and account information
  • Maintain context across multiple interactions
  • Perform semantic searches across blockchain transactions
  • Generate human-readable explanations of complex blockchain data

Why MCP for AI Integration?

MCP creates a bridge between AI agents and blockchain data, enabling:

  • Contextual Understanding: AI models can maintain conversation history and build context about tokens and accounts
  • Semantic Queries: Support for natural language processing to translate user queries into blockchain operations
  • Structured Responses: Data is returned in standardized formats optimized for AI consumption
  • Enhanced Explanations: Complex blockchain concepts are explained in accessible language

Features

  • Natural Language Processing: Query blockchain data using everyday language
  • Token Analysis: Comprehensive token information and metrics
  • Semantic Search: Find transactions and activities based on meaning, not just exact matches
  • Context Awareness: Server maintains session state and understands entity relationships
  • Solana RPC Integration: Full access to Solana blockchain capabilities
  • RESTful API: Easy integration with existing systems
  • Docker Support: Simple deployment with containerization

Quick Start with Docker

Option 1: Using Docker Compose

# Clone the repository
git clone https://github.com/omaidf/solana-mcp.git
cd solana-mcp

# Build and start the container
docker-compose up -d

Option 2: Using Docker directly

# Build the Docker image
docker build -t solana-mcp .

# Run the container
docker run -p 8000:8000 solana-mcp

Environment Variables

Customize the server by setting the following environment variables:

SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_COMMITMENT=confirmed
SOLANA_TIMEOUT=30
HOST=0.0.0.0
PORT=8000
LOG_LEVEL=INFO
LOG_FORMAT=json
ENVIRONMENT=production
METADATA_CACHE_SIZE=100
METADATA_CACHE_TTL=300
PRICE_CACHE_SIZE=500
PRICE_CACHE_TTL=60

API Endpoints

Core MCP Endpoints

  • GET /health - Health check endpoint
  • GET /version - Get API version information

Solana Token Analysis

  • GET /token-analysis/analyze/{mint} - Get comprehensive token analysis
  • GET /token-analysis/metadata/{mint} - Get token metadata
  • GET /token-analysis/supply/{mint} - Get token supply information
  • GET /token-analysis/price/{mint} - Get token price information
  • GET /token-analysis/holders/{mint} - Get token holder information

Natural Language Queries

  • POST /nlp/query - Submit natural language queries about the Solana blockchain

See API_DOCUMENTATION.md for complete API documentation.

Development

Prerequisites

  • Python 3.9+
  • pip

Setup

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -e .

Running locally

python -m solana_mcp.main

The server will be available at http://localhost:8000.

MCP Integration Examples

Python

import httpx
import asyncio

async def get_token_analysis(mint_address):
    async with httpx.AsyncClient() as client:
        response = await client.get(f"http://localhost:8000/token-analysis/analyze/{mint_address}")
        if response.status_code == 200:
            return response.json()
        else:
            raise Exception(f"Error: {response.status_code} - {response.json().get('detail')}")

# Example usage
async def main():
    try:
        token_data = await get_token_analysis("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
        print(f"Token name: {token_data['token_name']}")
        print(f"Current price: ${token_data['current_price_usd']}")
    except Exception as e:
        print(f"Failed to get token data: {e}")

if __name__ == "__main__":
    asyncio.run(main())

License

See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Created by omaidf

相关推荐

  • Aurity Ltd
  • Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

  • Convincible Ltd
  • You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!

  • John Rafferty
  • Text your favorite pet, after answering 10 questions about their everyday lives!

  • Ian O'Connell
  • Provide players' names or enter Quickstart to start the game!

  • analogchat.com
  • Efficient Spotify assistant for personalized music data.

  • Matthieu Savioux
  • Evaluates language quality of texts, responds with a numerical score between 50-150.

  • seabiscuit.ai
  • Discover A More Robust Business: Craft tailored value proposition statements, develop a comprehensive business model canvas, conduct detailed PESTLE analysis, and gain strategic insights on enhancing business model elements like scalability, cost structure, and market competition strategies. (v1.18)

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • n8n-io
  • Fair-Code-Workflow-Automatisierungsplattform mit nativen KI-Funktionen. Kombinieren Sie visuelles Gebäude mit benutzerdefiniertem Code, SelbstHost oder Cloud, 400+ Integrationen.

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • metorial
  • Containerisierte Versionen von Hunderten von MCP -Servern 📡 🧠

  • langgenius
  • Azure
  • Dieses Repository dient zur Entwicklung des Azure MCP -Servers, wodurch Ihre Agenten die Leistung von Azure verleiht.

  • alibaba
  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

  • caio-moliveira
  • Dieses Projekt wurde erstellt, um zu demonstrieren, wie wir uns mit verschiedenen Modellkontextprotokollen (MCPs) verbinden können.

  • superiorlu
  • 🤖 Sammeln Sie praktische KI -Repos, Tools, Websites, Papiere und Tutorials auf KI. 实用的 ai 百宝箱 💎

  • rulego
  • ⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.

  • Byaidu
  • PDF wissenschaftliche Papierübersetzung mit erhaltenen Formaten - 基于 ai 完整保留排版的 pdf 文档全文双语翻译 , 支持 支持 支持 支持 google/deeptl/ollama/openai 等服务 提供 cli/gui/mcp/docker/zotero

    Reviews

    2.8 (10)
    Avatar
    user_IUiMjK3c
    2025-04-25

    As a loyal user of Solana-MCP, I can confidently say this tool is a game changer for developers working on the Solana blockchain. Created by omaidf, this application streamlines the development process with its user-friendly interface and robust features. Whether you're a seasoned developer or just starting, Solana-MCP provides everything you need to thrive in the Solana ecosystem. Highly recommend!

    Avatar
    user_rJ7LYGAE
    2025-04-25

    As a dedicated user of the solana-mcp application, I have found it to be incredibly efficient and user-friendly. Created by omaidf, this product stands out for its seamless integration and exceptional performance. Whether you are a beginner or an experienced developer, solana-mcp offers a reliable platform that meets all your needs. Highly recommended!

    Avatar
    user_G7ekJrw3
    2025-04-25

    Solana-mcp by omaidf is a fantastic application! It's user-friendly and delivers seamless integration with the Solana blockchain. The interface is intuitive, making it easy even for beginners to start using quickly. Highly recommend for anyone looking to manage their projects efficiently on Solana. Great job, omaidf!

    Avatar
    user_Gtf8oLEg
    2025-04-25

    I've been using solana-mcp by omaidf for a while now, and it's been a game changer! The app is user-friendly and incredibly efficient for managing projects. Its seamless integration with Solana's ecosystem has significantly boosted my productivity. Highly recommend to anyone in need of a reliable multi-chain project management tool!

    Avatar
    user_nTtorHo9
    2025-04-25

    As a devoted user of solana-mcp by omaidf, I am thoroughly impressed with its seamless performance and user-friendly interface. The integration capabilities are exceptional, making it a powerful tool for any developer immersed in the Solana ecosystem. Highly recommend checking it out!

    Avatar
    user_CA6F5JgM
    2025-04-25

    I've been a loyal user of solana-mcp created by omaidf and I am thoroughly impressed. This application has significantly optimized my workflow and provided a seamless experience. The user interface is intuitive, and the performance is robust. Highly recommend this tool for anyone looking to enhance their productivity!

    Avatar
    user_XgtsXdCF
    2025-04-25

    As a dedicated user of the solana-mcp application created by omaidf, I must say I am thoroughly impressed by its functionality and design. The seamless integration and user-friendly interface make it a valuable tool for anyone interested in the Solana ecosystem. Highly recommended for both beginners and advanced users!

    Avatar
    user_SSLM5e2B
    2025-04-25

    As a devoted user of the solana-mcp application by omaidf, I have been thoroughly impressed by its functionality and ease of use. The seamless integration and user-friendly interface make it a top choice for managing my tasks efficiently. Highly recommended for anyone looking to boost productivity!

    Avatar
    user_dAKvt9wn
    2025-04-25

    As a dedicated user of the solana-mcp application, I must say it's an exceptional tool created by omaidf. It seamlessly integrates with my workflow and offers reliable performance. The user interface is intuitive, making it easy for newcomers and experienced users alike. Highly recommend this to anyone looking to enhance their productivity with a solid, well-crafted application.

    Avatar
    user_zKvb4OWF
    2025-04-25

    I've been using the Solana-MCP application created by omaidf, and it's been a game changer. The seamless integration and user-friendly interface make complex tasks effortless. Highly recommended for anyone looking to streamline their workflow in the Solana ecosystem!