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.

コメント

「その他」の他のコンテンツ