Cover image

Solana MCP服务器

3 years

Works with Finder

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

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • Azure
  • 该存储库用于开发Azure MCP服务器,将Azure的功能带给您的代理商。

  • caio-moliveira
  • 创建该项目是为了证明我们如何与不同的模型上下文协议(MCP)连接。

  • Onelevenvy
  • Flock是一个基于工作流程的低音平台,可快速构建聊天机器人,抹布和协调多代理团队,由Langgraph,Langchain,Langchain,Fastapi和Nextjs提供支持。(羊群工作流工作流的低代码平台,rag rag rag 用于快速构建聊天机器人、 rag temant Agent fastem temantfaster和muti-agent agagent应用

    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!