
etweisberg/mlb-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
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 directoryserver.py- Core MCP server implementationtools/- MCP tool implementationsmlb_statsapi_tools.py- MLB StatsAPI tool definitionsstatcast_tools.py- Statcast data tool definitionspybaseball_plotting_tools.py- Additionalpybaseballtools provided for generating matplotlib plots and returning base64 encoded imagespybaseball_supp_tools.py- Supplementalpybaseballfunctions for interfacing with fangraphs, baseball reference, and other data sources
utils/- Utility moduleslogging_config.py- Logging configurationimages.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
- Install uv if you haven’t already:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create and activate a virtual environment:
uv venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
- 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)
설치
npx -y @smithery/cli install @etweisberg/mlb-mcp --client claude