Skip to main content
Glama
stevearagonsite

Python Server MCP

Python Server MCP - 암호화폐 가격 서비스

이 프로젝트는 암호화폐 가격 정보를 제공하는 MCP(Model Context Protocol) 서버를 구현합니다. 이 서버는 Python과 MCP 프레임워크를 사용하여 다양한 클라이언트에서 사용할 수 있는 API를 구축합니다.

특징

  • 실시간 암호화폐 가격 검색

  • 환경 기반 구성(개발, 프로덕션, 스테이징, 로컬)

  • CoinMarketCap API 통합

  • Docker 컨테이너 배포

Related MCP server: Coin MCP Server

요구 사항

  • 파이썬 3.12+

  • uv(패키지 및 가상 환경 관리자)

  • Docker(컨테이너 실행을 위한 선택 사항)

설치

uv 사용(권장)

지엑스피1

uv를 사용하여 가상 환경을 만들고 활성화하세요

uv venv
source .venv/bin/activate

종속성 설치

uv sync

구성

  1. 프로젝트 루트에 다음 변수를 사용하여 .env 파일을 만듭니다.

ENVIRONMENT=DEV  # Options: LOCAL, DEV, STAGING, PROD
COINMARKETCAP_API_KEY=your_api_key_here
  1. 각 환경에 대해 특정 환경 파일을 만들 수도 있습니다.

    • .dev.env - 개발 환경용

    • .staging.env - 스테이징 환경용

    • .prod.env - 프로덕션 환경용

용법

로컬 실행

python main.py

이렇게 하면 표준 입출력(stdio)을 통해 요청을 수신하는 MCP 서버가 시작됩니다.

Docker 사용

# Build the image
docker build -t test-mcp -f Dockerfile --platform linux/amd64 .

# Run the container
docker run -it test-mcp

프로젝트 구조

.
├── Dockerfile          # Docker configuration
├── main.py             # Application entry point
├── pyproject.toml      # Dependencies configuration
├── start.sh            # Docker startup script
└── src/                # Source code
    ├── __init__.py     # MCP server initialization
    └── core/           # Core modules
        ├── common/     # Shared schemas and models
        ├── config.py   # Application configuration
        ├── services/   # Application services
        ├── settings/   # Environment-specific settings
        └── utils/      # Utilities

개발

MCP 서버에 새 도구 추가

MCP 서버에 새 도구를 추가하려면 다음 단계를 따르세요.

  1. src/__init__.py 파일에 함수를 정의합니다.

  2. main() 함수에 도구를 등록합니다.

  3. docstring으로 도구 문서화

예:

@server.add_tool
def my_new_tool(parameter1: str, parameter2: int) -> str:
    """
    Description of what the tool does.
    
    Args:
        parameter1: Description of parameter 1
        parameter2: Description of parameter 2
        
    Returns:
        Description of what is returned
    """
    # Tool implementation
    return result

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    B
    maintenance
    A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
    3
    349 npm
    39
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A cryptocurrency price query service based on Model Context Protocol that provides tools for retrieving virtual currency prices, market trends, detailed information, and K-line data.
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A server that provides real-time cryptocurrency data through the Model Context Protocol, allowing access to detailed exchange information and current cryptocurrency rates from the CoinCap API.
    9 npm
    1
    MIT