baseball-mcp
# baseball-mcp: An MLB Stats API Wrapper for MCP
This project provides an MCP (Model Context Protocol) that acts as a wrapper for the MLB Stats API. It allows you to easily access and process various MLB data points, including schedules, game results, and team information. This server is designed for efficient data retrieval and processing within an MCP framework.
## Demo Videos
Here are a couple of demo videos showcasing the capabilities of `mcp_mlb_statsapi`:
* **Demo 1: MCP MLB Stats API - Quick Overview**
- [](https://youtu.be/cnqbcB8064k "demo 1")
* **Demo 2: MCP MLB Stats API - 輸入中文也可以**
- [](https://youtu.be/XhuyfIWKLjY "demo 2")
## Features
* **Game Schedules:** Retrieve MLB game schedules for specified date ranges, optionally filtering by team.
* **Game Results:** Fetch daily game results, including scores, winning/losing teams, and winning pitcher.
* **Team Results:** Get detailed results for a specific team's most recent game, including scoring plays and highlights.
* **Player Lookup:** Look up player IDs using last name, first name, or a combination of both. Supports fuzzy matching.
## Installation
#### Prerequisites
- Python 3.10 or newer
- uv package manager:
**If you're on Mac, please install uv as**
```bash
brew install uv
```
**On Windows**
```bash
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```
Otherwise installation instructions are on their website: [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
#### Install via PyPI
The `mcp_mlb_statsapi` package is available on PyPI and can be installed using `pip`:
```bash
pip install mcp_mlb_statsapi
```
#### Install via Github
or you can clone this repo, run it with soruce code.
```bash
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
```
#### Claude for Desktop Integration
Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:
```json
{
"mcpServers": {
"mcp_mlb_statsapi": {
"command": "{YOUR_PYTHON_EXECUTABLE_PATH}/python",
"args": ["-m",
"mcp_mlb_statsapi"]
}
}
}
```
If you install it via source code
```json
{
"mcpServers": {
"mcp_mlb_statsapi": {
"command": "{YOUR_UV_EXECUTABLE_PATH}/uv",
"args": [
"--directory",
"{YOUR_PROJECT_PATH}/src/mcp_mlb_statsapi",
"run",
"mcp_mlb_statsapi"
]
}
}
}
```
## Contributing
Contributions are welcome! Please open an issue or submit a pull request.
## License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
## References
This project utilizes the following external libraries and resources:
* **MLB-StatsAPI:** [https://github.com/toddrob99/MLB-StatsAPI](https://github.com/toddrob99/MLB-StatsAPI) - A Python library providing access to the MLB Stats API. This project relies heavily on `mlb-statsapi` for data retrieval.
[](https://mseep.ai/app/mpizza-mcp-mlb-statsapi)
[](https://mseep.ai/app/45b7cf1b-10ee-4ba0-8bf5-90a464b0f860)
TDQS
Scored across 3 tools
The three tools have distinct primary purposes: get_daily_results focuses on game outcomes for all teams on a date, get_mlb_schedule provides scheduling information across a date range, and mlb_team_result delivers detailed scoring/highlights for a specific team's recent game. However, there is some overlap between get_daily_results and mlb_team_result in that both can return game results for a date, which could cause minor confusion for an agent.
The naming is mixed: get_daily_results and get_mlb_schedule follow a consistent verb_noun pattern, but mlb_team_result deviates by placing the domain prefix first and using a noun_verb structure. This inconsistency reduces predictability, though the names remain readable and descriptive.
With only 3 tools, the server feels thin for covering the MLB domain comprehensively. While the tools address key aspects like results, schedules, and team details, the limited count may hinder complex agent workflows, such as accessing player stats, standings, or historical data, making it borderline appropriate.
The tool set has significant gaps for a baseball server. It lacks essential operations like retrieving team standings, player statistics, game box scores, or live scores, and there is no CRUD coverage for user interactions (e.g., favorites or predictions). This incompleteness will likely cause agent failures when handling common baseball queries beyond basic scheduling and results.