MCP Catalogs
Home

mlb-mcp

by etweisberg·25·Score 44

Python MCP server for MLB baseball analytics with API access to statcast, fangraphs, and baseball reference data.

otherai-llm
7
Forks
1
Open issues
2 mo ago
Last commit
2d ago
Indexed

Overview

The MLB Stats MCP Server is a comprehensive Python implementation that provides structured access to Major League Baseball statistics through multiple data sources. It integrates with the MLB Stats API, pybaseball library, and other baseball data providers to deliver detailed analytics. The server features well-organized code structure with separate modules for tools (MLB StatsAPI, Statcast, pybaseball plotting) and utilities, making it modular and maintainable.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Baseball analysts can retrieve player statistics and game performance data using MCP tools
you:Sports journalists can generate baseball visualizations and statistics reports programmatically
you:Fantasy baseball enthusiasts can access up-to-date player data for roster decisions
you:What data sources does this MCP server integrate with?
you:Does the server support generating visualizations?

When to choose this

Choose this server if you need comprehensive baseball statistics access through multiple data sources and want to integrate them into MCP-compatible applications.

When NOT to choose this

Avoid this if you need access to sports data outside of baseball, as it's specialized solely for MLB statistics and won't support other sports analytics.

Tools this server exposes

4 tools extracted from the README
  • mlb_statsapi_tools

    MLB StatsAPI tool definitions for accessing MLB statistics

  • statcast_tools

    Statcast data tool definitions for advanced baseball analytics

  • pybaseball_plotting_tools

    Generate matplotlib plots and return base64 encoded images

  • pybaseball_supp_tools

    Supplemental pybaseball functions for Fangraphs, Baseball Reference, and other data sources

Note: 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.

Comparable tools

sportsdata-mcpespn-api-clientbaseball-data-scraperfantasy-tools-api

Installation

Installation

  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 .

Claude Desktop Integration

To connect this MCP server to Claude Desktop, add a configuration to your claude_desktop_config.json file:

"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

What data sources does this MCP server integrate with?
The server integrates with MLB Stats API, pybaseball library for statcast data, Fangraphs, and Baseball Reference.
Does the server support generating visualizations?
Yes, it includes matplotlib plotting tools that can generate and return base64 encoded images.

Compare mlb-mcp with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.