Feedback

Pybaseball MCP Server

@jweingardt12 Claim

Basic information

Runtime
python
Category
License
Not specified
Transports
stdio
Author
jweingardt12
Submitted by
Community
Quality
20
Stars
4

About Pybaseball MCP Server

MCP server to fetch basic (and complex!) baseball-related stats.

Pybaseball MCP Server is a MCP server in the Other category listed in the AddMCP.net directory, published by jweingardt12. Supported transport: stdio. Runtime: python. The repository has 4 GitHub stars. Source code is hosted on github.com. Related topics: baseball, mcp.

Setup

{
    "mcpServers": {
        "mlb_mcp": {
            "command": "python",
            "args": [
                "mcp_stdio_wrapper.py"
            ]
        }
    }
}

Pybaseball MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "mlb_mcp": {
            "command": "python",
            "args": [
                "mcp_stdio_wrapper.py"
            ]
        }
    }
}

Pybaseball MCP Server tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

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 /docs when 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.

Frequently asked questions

1 What dependencies does Pybaseball MCP Server require?

It requires the pybaseballstats, pandas, and numpy Python packages, as listed in the README.

2 How do I start the Pybaseball MCP Server?

Run uvicorn main:app --reload in the project directory after installing dependencies.

3 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.

4 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.

5 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.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬