FastAPI-based Model Context Protocol (MCP) server exposing comprehensive MLB statistics and baseball data.
https://github.com/guillochon/mlb-api-mcpStop scraping MLB websites or wrestling with inconsistent sports APIs. This MCP server gives your AI applications direct access to comprehensive, real-time MLB data through a clean, standardized interface.
Building sports analytics tools, fantasy baseball apps, or AI-powered baseball insights? You've probably hit these walls:
This MCP server solves all of that. One consistent interface, comprehensive data coverage, and built specifically for AI application integration.
Live Game Intelligence: Real-time boxscores, play-by-play data, and game highlights. Perfect for building live game commentary, betting analysis, or real-time fantasy updates.
Advanced Analytics Ready: Traditional stats plus sabermetrics (WAR, wOBA, wRC+) in structured formats that AI models can immediately consume for player evaluation and predictive modeling.
Complete Historical Context: Draft data, award recipients, team rosters across seasons. Build recommendation engines that understand career trajectories and historical performance patterns.
Smart Search & Discovery: Player and team search that goes beyond exact matches. Your users can find "that pitcher from the Giants in 2019" without knowing names or exact details.
Fantasy Sports AI Assistant: Pull player stats, injury reports, and matchup data to generate personalized lineup recommendations. The sabermetrics endpoints give you the advanced metrics needed for competitive analysis.
Live Game Commentary Bot: Combine real-time scoring plays with player biographical data to generate contextual game narratives. "This is Martinez's third home run against left-handed pitching this month..."
Sports Analytics Dashboard: Build executive dashboards that correlate team performance with roster changes over time. The comprehensive roster and historical data endpoints make trend analysis straightforward.
Betting Analysis Tools: Cross-reference game pace statistics with pitcher matchups and historical performance for data-driven betting insights.
Unlike typical REST APIs, this MCP server integrates directly with AI workflows:
# Your AI agent can directly call these tools
mlb_server.get_player_stats(player_id="592450", season="2024")
mlb_server.get_sabermetrics(player_id="592450", stat_type="WAR")
mlb_server.search_players(name="trout", team="angels")
No authentication headaches, no rate limit surprises, no data transformation - just consistent, AI-ready baseball data.
Docker Ready: Single command deployment with docker run -p 8000:8000 mlb-api-mcp
. Scale horizontally behind a load balancer for high-traffic applications.
Local Development: Clone and run locally with full API documentation at /docs
. Interactive testing interface lets you explore endpoints before integrating.
MCP Integration: Drop into any MCP-compatible AI application immediately. The server exposes 20+ specialized tools that AI agents can discover and use autonomously.
The server handles MLB's underlying API complexity, caching, and error recovery so you can focus on building features instead of fighting data infrastructure.
Ready to skip the sports data headaches? Clone the repo and have live MLB data flowing into your AI applications in under five minutes.