Solana Model Context Protocol (MCP) Server

by omaidf
Verified
MIT License
5
  • Linux
  • Apple

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Offers containerized deployment options through Docker and Docker Compose, allowing for simple setup and consistent running environments across different systems.

  • Enables repository access for installation, with the codebase hosted on GitHub for distribution and contribution.

  • Built with Python and requires Python 3.9+ for development and local execution, with Python client examples provided for integration.

솔라나 모델 컨텍스트 프로토콜(MCP)

AI 도구 및 인터페이스와의 원활한 통합을 위해 최적화된 모델 컨텍스트 프로토콜(MCP)을 구현한 포괄적인 Solana 블록체인 상호작용 서버입니다.

모델 컨텍스트 프로토콜이란 무엇인가요?

모델 컨텍스트 프로토콜(MCP)은 AI 도구와 언어 모델이 블록체인 데이터와 상호 작용하는 표준화된 방식을 제공합니다. 이 구현을 통해 AI 에이전트는 다음을 수행할 수 있습니다.

  • 자연어를 사용하여 Solana 블록체인 데이터 쿼리
  • 구조화된 토큰 및 계정 정보에 액세스하세요
  • 여러 상호 작용에서 컨텍스트 유지
  • 블록체인 거래 전반에 걸쳐 의미 검색을 수행합니다.
  • 복잡한 블록체인 데이터에 대한 사람이 읽을 수 있는 설명을 생성합니다.

AI 통합을 위해 MCP를 사용해야 하는 이유는?

MCP는 AI 에이전트와 블록체인 데이터 간에 브리지를 생성하여 다음을 가능하게 합니다.

  • 문맥적 이해 : AI 모델은 대화 내역을 유지하고 토큰 및 계정에 대한 컨텍스트를 구축할 수 있습니다.
  • 의미적 쿼리 : 사용자 쿼리를 블록체인 작업으로 변환하기 위한 자연어 처리 지원
  • 구조화된 응답 : 데이터는 AI 사용에 최적화된 표준화된 형식으로 반환됩니다.
  • 강화된 설명 : 복잡한 블록체인 개념이 접근 가능한 언어로 설명됩니다.

특징

  • 자연어 처리 : 일상 언어를 사용하여 블록체인 데이터 쿼리
  • 토큰 분석 : 포괄적인 토큰 정보 및 지표
  • 의미 검색 : 정확한 일치뿐만 아니라 의미에 따라 거래 및 활동을 찾습니다.
  • 컨텍스트 인식 : 서버는 세션 상태를 유지하고 엔터티 관계를 이해합니다.
  • Solana RPC 통합 : Solana 블록체인 기능에 대한 전체 액세스
  • RESTful API : 기존 시스템과의 쉬운 통합
  • Docker 지원 : 컨테이너화를 통한 간단한 배포

Docker로 빠르게 시작하기

옵션 1: Docker Compose 사용

지엑스피1

옵션 2: Docker 직접 사용

# Build the Docker image docker build -t solana-mcp . # Run the container docker run -p 8000:8000 solana-mcp

환경 변수

다음 환경 변수를 설정하여 서버를 사용자 정의하세요.

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 엔드포인트

핵심 MCP 엔드포인트

  • GET /health - 상태 확인 엔드포인트
  • GET /version - API 버전 정보 가져오기

솔라나 토큰 분석

  • GET /token-analysis/analyze/{mint} - 포괄적인 토큰 분석 받기
  • GET /token-analysis/metadata/{mint} - 토큰 메타데이터 가져오기
  • GET /token-analysis/supply/{mint} - 토큰 공급 정보 가져오기
  • GET /token-analysis/price/{mint} - 토큰 가격 정보 가져오기
  • GET /token-analysis/holders/{mint} - 토큰 보유자 정보 가져오기

자연어 쿼리

  • POST /nlp/query - Solana 블록체인에 대한 자연어 쿼리 제출

전체 API 문서는 API_DOCUMENTATION.md 참조하세요.

개발

필수 조건

  • 파이썬 3.9 이상

설정

# Create and activate virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -e .

지역적으로 실행

python -m solana_mcp.main

서버는 http://localhost:8000 에서 사용할 수 있습니다.

MCP 통합 예제

파이썬

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 파일을 참조하세요.

기여하다

기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.

작가

omaidf 가 생성함

-
security - not tested
A
license - permissive license
-
quality - not tested

AI 도구가 자연어를 사용하여 블록체인 데이터를 쿼리하고, 구조화된 토큰 정보에 액세스하고, 복잡한 블록체인 개념에 대한 사람이 읽을 수 있는 설명을 생성할 수 있도록 하는 Solana 블록체인 상호작용 서버입니다.

  1. What is Model Context Protocol?
    1. Why MCP for AI Integration?
      1. Features
        1. Quick Start with Docker
          1. Option 1: Using Docker Compose
          2. Option 2: Using Docker directly
        2. Environment Variables
          1. API Endpoints
            1. Core MCP Endpoints
            2. Solana Token Analysis
            3. Natural Language Queries
          2. Development
            1. Prerequisites
            2. Setup
            3. Running locally
          3. MCP Integration Examples
            1. Python
          4. License
            1. Contributing
              1. Author
                ID: 2xuxi3ody7