- Home
- MCP servers
- MLB Stats
MLB Stats
- python
17
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"etweisberg-mlb-mcp": {
"command": "{PATH_TO_UV}",
"args": [
"--directory",
"{PROJECT_DIRECTORY}",
"run",
"python",
"-m",
"mlb_stats_mcp.server"
],
"env": {
"ANTHROPIC_API_KEY": "YOUR_API_KEY",
"MLB_STATS_LOG_FILE": "{LOG_FILE_PATH}",
"MLB_STATS_LOG_LEVEL": "DEBUG"
}
}
}
}You run MLB Stats MCP Server to expose MLB statistics data through a structured MCP API, making MLB Stats API and pybaseball data available to MCP-compatible clients for easy querying of statcast, Fangraphs, and Baseball Reference statistics.
How to use
Operate the MLB Stats MCP Server as a local service that you connect to from an MCP client. You can start the server from your terminal, then configure your client to point at the local MCP endpoint. The server handles authentication via environment variables and logs activity to a configurable destination.
How to install
Prerequisites you need before installation are Python tooling and a local package manager to install the server in editable mode. You will also need a Python environment to run the MCP server module.
Install the uv tool, create a virtual environment, and install the project in editable mode.
curl -LsSf https://astral.sh/uv/install.sh | sh
.venv\Scripts\activate
Additional configuration and start
To run the MLB Stats MCP Server from Claude Desktop, you can use the integration configuration that launches the MCP server via UV and executes the Python module responsible for the server.
"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"
}
}
Notes on environment and logging
Configure runtime behavior and logging through environment variables. You can enable verbose MCP server logs by setting the log level and directing logs to a file or stdout.