etweisberg/mlb-mcp
MCP server for advanced baseball analytics (statcast, fangraphs, baseball reference, mlb stats API) with client demo
[](https://github.com/etweisberg/baseball/mcp-baseball-stats/workflows/test.yml) [](https://github.com/etweisberg/mcp-baseball-stats/actions/workflows/pre-commit.yml) [](https://smithery.ai/server/@etweisberg/mlb-mcp)
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.
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 - Additional pybaseball tools provided for generating matplotlib plots and returning base64 encoded imagespybaseball_supp_tools.py - Supplemental pybaseball functions for interfacing with fangraphs, baseball reference, and other data sourcesutils/ - Utility moduleslogging_config.py - Logging configurationimages.py - functions related to handling plot imagestests/ - Test suite for verifying server functionalitypyproject.toml - Project configuration and dependencies.pre-commit-config.yaml - Pre-commit hooks configuration.github/ - GitHub Actions workflowscurl -LsSf https://astral.sh/uv/install.sh | shuv venv
source .venv/bin/activate # On Unix/macOS
# or
.Loading reviews...