mlb-mcp
by etweisberg·★ 25·综合分 44
Python 开发的棒球分析 MCP 服务器,提供对 statcast、fangraphs 和 baseball reference 数据的 API 访问。
概述
MLB Stats MCP 服务器是一个全面的 Python 实现,通过多个数据源提供对职业棒球联盟统计数据的结构化访问。它集成了 MLB Stats API、pybaseball 库和其他棒球数据提供商,以提供详细的分析功能。服务器具有组织良好的代码结构,包含工具(MLB StatsAPI、Statcast、pybaseball 绘图)和实用程序模块,使其模块化和可维护。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
如果您需要通过多个数据源访问全面的棒球统计数据并希望将其集成到MCP兼容的应用程序中,请选择此服务器。
什么时候不要选它
如果您需要访问棒球以外的体育数据,请不要使用它,因为它专门针对MLB统计,不支持其他体育分析。
此 server 暴露的工具
从 README 抽取出 4 个工具mlb_statsapi_toolsMLB StatsAPI tool definitions for accessing MLB statistics
statcast_toolsStatcast data tool definitions for advanced baseball analytics
pybaseball_plotting_toolsGenerate matplotlib plots and return base64 encoded images
pybaseball_supp_toolsSupplemental pybaseball functions for Fangraphs, Baseball Reference, and other data sources
说明:Tool names were inferred from the project structure and directory organization, as the README doesn't provide explicit documentation of individual tools or their signatures.
可对比工具
安装
安装
- 如果你还没有安装 uv,请先安装:
curl -LsSf https://astral.sh/uv/install.sh | sh- 创建并激活虚拟环境:
uv venv
source .venv/bin/activate # 在 Unix/macOS 上
# 或者在 Windows 上
.venv\Scripts\activate- 安装依赖项:
uv pip install -e .Claude Desktop 集成
要将此 MCP 服务器连接到 Claude Desktop,请将配置添加到你的 claude_desktop_config.json 文件中:
"mcp-baseball-stats": {
"command": "{PATH_TO_UV}",
"args": [
"--directory",
"{PROJECT_DIRECTORY}",
"run",
"python",
"-m",
"mlb_stats_mcp.server"
],
"env": {
"MLB_STATS_LOG_FILE": "{LOG_FILE_PATH}",
"MLB_STATS_LOG_LEVEL": "DEBUG"
}
}FAQ
- 这个 MCP 服务器集成了哪些数据源?
- 该服务器集成了 MLB Stats API、用于 statcast 数据的 pybaseball 库、Fangraphs 和 Baseball Reference。
- 服务器是否支持生成可视化图表?
- 是的,它包含 matplotlib 绘图工具,可以生成并返回 base64 编码的图像。
mlb-mcp 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。