
etweisberg/mlb-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
etweisberg/mlb-mcp は [https://github.com/etweisberg/mlb-mcp.] からインポートされた MCP サーバー候補です
概要
etweisberg/mlb-mcp は [https://github.com/etweisberg/mlb-mcp.] からインポートされた MCP サーバー候補です
概要(AI 翻訳)
MLB Stats API および [pybaseball] による MLB 統計データにアクセスするためのモデルコンテキストプロトコル (MCP) サーバを作成する Python プロジェクト。 統計、ファングラフ、および野球参照統計のためのライブラリ。 このサーバーは、MCP 互換のクライアントで使用できる野球統計への構造化された API アクセスを提供します。
プロジェクト構成
- [
mlb_stats_mcp/- メインパッケージディレクトリ - [
server.py- コアMCPサーバーの実装 - [
tools/- MCP ツールの実装 - [
mlb_statsapi_tools.py- MLB StatsAPI ツールの定義 - [
statcast_tools.py- 統計データツールの定義 - [[
pybaseball_plotting_tools.py- 追加の[pybaseball])マットプロリブプロットを生成し、ベース64エンコードされた画像を返すために提供されるツール - [
pybaseball_supp_tools.py- 補pybaseball] ファングラフ、野球の参照および他のデータソースとの対面のための機能 - [
utils/- ユーティリティモジュール - [
logging_config.py- ログ設定 - [
images.py- プロット画像を扱う機能 - [[
tests/] - サーバの機能を検証するためのテストスイート - [
pyproject.toml- プロジェクト構成と依存関係 - [
.pre-commit-config.yaml- プレコミットのホック構成
このページは 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