MCP.so
登录

Pybaseball MCP Server

@jweingardt12

关于 Pybaseball MCP Server

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

基本信息

分类

其他

运行时

python

传输方式

stdio

发布者

jweingardt12

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

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

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

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.

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.

评论

其他 分类下的更多 MCP 服务器