EM

etweisberg/mlb-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

34 stars 12 forks 품질 67 트렌드 32

etweisberg/mlb-mcp는 MCP 서버 후보가 https://github.com/etweisberg/mlb-mcp.에서 수입되었습니다

개요

etweisberg/mlb-mcp는 MCP 서버 후보가 https://github.com/etweisberg/mlb-mcp.에서 수입되었습니다

개요(AI 번역)

MLB Stats API 및 pybaseball] statcast, fangraphs 및 baseball Reference 통계를 통해 MLB 통계 데이터를 액세스하기위한 모델 Context Protocol (MCP) 서버를 생성하는 파이썬 프로젝트. 이 서버는 MCP 호환 클라이언트와 함께 사용할 수있는 baseball 통계에 대한 API 액세스를 제공합니다.

프로젝트 구조

  • mlb_stats_mcp/ - 메인 패키지 디렉토리
  • server.py - 핵심 MCP 서버 구현
  • tools/ - MCP 도구 구현
  • mlb_statsapi_tools.py - MLB StatsAPI 도구 정의
  • statcast_tools.py - Statcast 데이터 도구 정의
  • pybaseball_plotting_tools.py - pybaseball] matplotlib 플롯 생성 및 base64 인코딩된 이미지 제공
  • pybaseball_supp_tools.py - 수풀 pybaseball] fangraphs, baseball reference 및 기타 데이터 소스와 연동하기위한 기능
  • utils/ - 유틸리티 모듈
  • logging_config.py - 로깅 구성
  • images.py - 도형 이미지 처리 관련 기능
  • tests/ - 서버 기능을 검증하는 테스트 스위트
  • pyproject.toml - 프로젝트 구성 및 의존성
  • .pre-commit-config.yaml - Pre-commit Hooks 구성

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

MLB Stats MCP Server

A Python project that creates a Model Context Protocol (MCP) server for accessing MLB statistics data through the MLB Stats API and pybaseball library for statcast, fangraphs, and baseball reference statistics. This server provides structured API access to baseball statistics that can be used with MCP-compatible clients.

Project Structure

  • mlb_stats_mcp/ - Main package directory
    • server.py - Core MCP server implementation
    • tools/ - MCP tool implementations
      • mlb_statsapi_tools.py - MLB StatsAPI tool definitions
      • statcast_tools.py - Statcast data tool definitions
      • pybaseball_plotting_tools.py - Additional pybaseball tools provided for generating matplotlib plots and returning base64 encoded images
      • pybaseball_supp_tools.py - Supplemental pybaseball functions for interfacing with fangraphs, baseball reference, and other data sources
    • utils/ - Utility modules
      • logging_config.py - Logging configuration
      • images.py - functions related to handling plot images
    • tests/ - Test suite for verifying server functionality
  • pyproject.toml - Project configuration and dependencies
  • .pre-commit-config.yaml - Pre-commit hooks configuration
  • .github/ - GitHub Actions workflows

Tools

Setup

  1. Install uv if you haven’t already:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create and activate a virtual environment:
uv venv
source .venv/bin/activate  # On Unix/macOS
# or
.venv\Scripts\activate  # On Windows
  1. Install dependencies:
uv pip install -e .

Installing via Smithery

To install MLB Stats Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @etweisberg/mlb-mcp --client claude

Running Tests

The project includes comprehensive pytest tests for the MCP server functionality:

uv run pytest -v

Tests verify all MLB StatsAPI tools work correctly with the MCP protocol, establishing connections, making API calls, and processing responses.

Environment Variables

The project uses environment variables stored in .env to configure settings.

Use ANTHROPIC_API_KEY to enable MCP Server.

Logging Configuration

The MLB Stats MCP Server supports configurable logging via environment variables:

  • MLB_STATS_LOG_LEVEL - Sets the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
GitHub에서 전체 README 보기

설치

npx -y @smithery/cli install @etweisberg/mlb-mcp --client claude
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →