MLB API MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol (MCP) server that provides comprehensive access to MLB statistics and baseball data through a FastMCP-based interface.
Overview
This MCP server acts as a bridge between AI applications and MLB data sources, enabling seamless integration of baseball statistics, game information, player data, and more into AI workflows and applications.
Features
MLB Data Access
- **Current standings** for all MLB teams with flexible filtering by league, season, and date
- **Game schedules** and results with date range support
- **Player statistics** including traditional and sabermetric stats (WAR, wOBA, wRC+)
- **Team information** and rosters with various roster types
- **Live game data** including boxscores, linescores, and play-by-play
- **Game highlights** and scoring plays
- **Player and team search** functionality
- **Draft information** and award recipients
- **Game pace statistics** and lineup information
MCP Tools
All MLB/statistics/game/player/team/etc. functionality is exposed as MCP tools, not as RESTful HTTP endpoints. These tools are accessible via the /mcp/ endpoint using the MCP protocol. For a list of available tools and their descriptions, visit /tools/ when the server is running.
Key MCP Tools
- get_mlb_standings - Current MLB standings with league and season filters
- get_mlb_schedule - Game schedules for specific dates, ranges, or teams
- get_mlb_team_info - Detailed team information
- get_mlb_player_info - Player biographical information
- get_mlb_boxscore - Complete game boxscores
- get_mlb_linescore - Inning-by-inning game scores
- get_mlb_game_highlights - Video highlights for games
- get_mlb_game_scoring_plays - Play-by-play data with event filtering
- get_mlb_game_pace - Game duration and pace statistics
- get_mlb_game_lineup - Detailed lineup information for games
- get_multiple_mlb_player_stats - Traditional player statistics
- get_mlb_sabermetrics - Advanced sabermetric statistics (WAR, wOBA, etc.)
- get_mlb_roster - Team rosters with various roster types
- get_mlb_search_players - Search players by name
- get_mlb_search_teams - Search teams by name
- get_mlb_players - All players for a sport/season
- get_mlb_teams - All teams for a sport/season
- get_mlb_draft - Draft information by year
- get_mlb_awards - Award recipients
- get_current_date - Current date
- get_current_time - Current time
For the full list and detailed descriptions, see /tools/ or /docs when the server is running.
HTTP Endpoints
The following HTTP endpoints are available:
- / - Redirects to /docs
- /docs - Interactive API documentation and tool listing
- /health/ - Health check endpoint
- /mcp/info - MCP server information
- /tools/ - List of all available MCP tools
- /mcp/ (POST) - MCP protocol endpoint for MCP-compatible clients
> **Note:** There are no RESTful HTTP endpoints for MLB/statistics/game/player/team/etc. All such functionality is accessed via MCP tools through the /mcp/ endpoint.
MCP Integration
- Compatible with MCP-enabled AI applications
- Tool-based interaction model with comprehensive endpoint descriptions
- Automatic API documentation generation
- Schema validation and type safety
- Full response schema descriptions for better AI integration
Installation
Installing via Smithery
To install MLB API Server for Claude Desktop automatically via Smithery:
Option 1: Local Installation
1. Install uv if you haven't already:
2. Clone the repository: