Pybaseball MCP Server
@jweingardt12
About Pybaseball MCP Server
MCP server to fetch basic (and complex!) baseball-related stats.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mlb_mcp": {
"command": "python",
"args": [
"mcp_stdio_wrapper.py"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Pybaseball MCP Server?
Pybaseball MCP Server is a FastAPI-based MCP (Model Context Protocol) server that exposes MLB and Fangraphs baseball data via the pybaseballstats library. It is intended for developers and applications that need programmatic access to baseball statistics through an MCP interface.
How to use Pybaseball MCP Server?
Install dependencies with pip install -r requirements.txt, then start the server with uvicorn main:app --reload. The server provides three HTTP GET endpoints: /player (Statcast data by name), /team_stats (team batting or pitching stats by team and year), and /leaderboard (MLB leaderboard by stat, season, and league). For an MCP STDIO interface, run the FastAPI server and then execute python mcp_stdio_wrapper.py.
Key features of Pybaseball MCP Server
- Query player Statcast data by name with optional date range.
- Retrieve team batting or pitching stats for a given year.
- Access MLB leaderboards by stat, season, and league.
- Supports both HTTP and MCP STDIO transports.
- Interactive API docs at
/docswhen server is running. - Ready for deployment on MCP‑compatible platforms like Smithery.
Use cases of Pybaseball MCP Server
- Analyze a specific player’s performance over a custom date range.
- Compare team‑level batting or pitching statistics across seasons.
- Build leaderboard dashboards for a single stat, league, and season.
- Integrate baseball data into MCP‑aware AI agents or workflows.
FAQ from Pybaseball MCP Server
What dependencies does Pybaseball MCP Server require?
It requires the pybaseballstats, pandas, and numpy Python packages, as listed in the README.
How do I start the Pybaseball MCP Server?
Run uvicorn main:app --reload in the project directory after installing dependencies.
How can I expose an MCP STDIO interface?
First start the FastAPI server (e.g., uvicorn main:app --host 0.0.0.0 --port 8000 &), then run python mcp_stdio_wrapper.py.
How do I list available tools on the server?
Use HTTP POST to http://localhost:8000/tools/list or send a JSON‑RPC request via the STDIO wrapper: echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | python mcp_stdio_wrapper.py.
Where can I find the API documentation?
Once the server is running, interactive API docs are available at http://127.0.0.1:8000/docs.
Frequently asked questions
What dependencies does Pybaseball MCP Server require?
It requires the pybaseballstats, pandas, and numpy Python packages, as listed in the README.
How do I start the Pybaseball MCP Server?
Run `uvicorn main:app --reload` in the project directory after installing dependencies.
How can I expose an MCP STDIO interface?
First start the FastAPI server (e.g., `uvicorn main:app --host 0.0.0.0 --port 8000 &`), then run `python mcp_stdio_wrapper.py`.
How do I list available tools on the server?
Use HTTP POST to `http://localhost:8000/tools/list` or send a JSON‑RPC request via the STDIO wrapper: `echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | python mcp_stdio_wrapper.py`.
Where can I find the API documentation?
Once the server is running, interactive API docs are available at `http://127.0.0.1:8000/docs`.
Basic information
More Other MCP servers
ACI: Open-Source Infra to Power Unified MCP Servers
aipotheosis-labsACI.dev is the open source tool-calling platform that hooks up 600+ tools into any agentic IDE or custom AI agent through direct function calling or a unified MCP server. The birthplace of VibeOps.

Peekaboo MCP – lightning-fast macOS screenshots for AI agents
steipetePeekaboo is a macOS CLI & optional MCP server that enables AI agents to capture screenshots of applications, or the entire system, with optional visual question answering through local or remote AI models.
Awesome Mlops
visengerA curated list of references for MLOps
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web
Comments