Baseball MCP
An MCP server for retrieving Major League Baseball (MLB) game results, schedules, and specific game details using the mlb-statsapi library.
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
- Demo 2: MCP MLB Stats API - 輸入中文也可以
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
brew install uv
On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Otherwise installation instructions are on their website: Install uv
Install via PyPI
The mcp_mlb_statsapi
package is available on PyPI and can be installed using pip
:
pip install mcp_mlb_statsapi
Install via Github
or you can clone this repo, run it with soruce code.
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:
{
"mcpServers": {
"mcp_mlb_statsapi": {
"command": "{YOUR_PYTHON_EXECUTABLE_PATH}/python",
"args": ["-m",
"mcp_mlb_statsapi"]
}
}
}
If you install it via source code
{
"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 - A Python library providing access to the MLB Stats API. This project relies heavily on
mlb-statsapi
for data retrieval.
Related Servers
PiAPI
PiAPI MCP server makes user able to generate media content with Midjourney/Flux/Kling/Hunyuan/Udio/Trellis directly from Claude or any other MCP-compatible apps.
MCP Weather Server
Provides weather-related tools using the US National Weather Service API.
Wordle MCP
Fetches daily Wordle solutions for a specific date via the Wordle API.
Plex MCP Server
Search for movies and manage playlists on your Plex Media Server using the Plex API.
Trade Agent
Execute stock and crypto trades via Trade Agent
Pollinations
Multimodal MCP server for generating images, audio, and text with no authentication required
Octagon VC Agents
AI-driven venture capitalist agents powered by Octagon Private Markets' real-time intelligence.
CYAN ARROW Trading System
A high-performance trading system for Claude Desktop, providing real-time market data via Tiingo and optional Telegram alerts.
3D Cartoon Generator & File System Tools
Generates 3D-style cartoon images using Google's Gemini AI and provides secure file system operations.
Shioaji MCP Server
Access the Shioaji trading API for financial data and trading operations, requiring a SinoPac Securities account.