Implements the server as a Cloudflare Worker, enabling deployment and hosting of the MCP service on Cloudflare's edge network.
Provides access to MLB Stats API data including team information, rosters, player statistics, game schedules, live game data, league standings, game boxscores, player information, season information, and venue details.
MLB Stats MCP Server - Enhanced with Meta-Tools
š§ Version 2.1 - Now with Entity Resolution Meta-Tools!
A Cloudflare Worker that serves as an enhanced MCP (Model Context Protocol) server for accessing MLB Stats API data. Features meta-tools for intelligent entity resolution, comprehensive team/player mappings, and optimized data access patterns.
šÆ Enhanced Features
š§ Meta-Tools for Entity Resolution
resolve_team: Convert team names to canonical MLB team IDs
resolve_player: Convert player names to canonical MLB player IDs
Comprehensive Mappings: All 30 MLB teams with aliases and abbreviations
Fuzzy Matching: "Yankees", "NYY", "New York Yankees" all resolve correctly
Smart Suggestions: "Did you mean?" fallbacks for typos and partial matches
ā¾ MLB Data Access
Direct MLB API proxy with zero additional latency
All MLB endpoints supported (teams, players, stats, schedules, etc.)
CORS enabled for web applications
No API keys required (MLB Stats API is public)
Error handling and validation with detailed responses
šļø Architecture Benefits
Domain logic ownership: All MLB-specific logic contained within this worker
Service binding ready: Optimized for Cloudflare worker-to-worker communication
Token efficient: Meta-tools reduce round-trips and enable smart caching
Future-proof: Extensible pattern for other sports (NFL, NBA, NHL)
š ļø Available Commands
š§ Meta-Tools (Entity Resolution)
resolve_team
- Team Name Resolution
Convert any team reference to canonical MLB team information.
Request:
Response:
Supported Inputs:
Team names: "Yankees", "Red Sox", "Dodgers"
Full names: "New York Yankees", "Boston Red Sox"
Abbreviations: "NYY", "BOS", "LAD"
Cities: "New York", "Boston", "Los Angeles"
resolve_player
- Player Name Resolution
Convert any player reference to canonical MLB player information.
Request:
Response:
Supported Players:
Aaron Judge, Shohei Ohtani, Mookie Betts, Freddie Freeman
Ronald Acuna Jr., Mike Trout, and other star players
Both full names and last names supported
ā¾ MLB Data Commands
getTeamInfo
- Get team information and detailsgetRoster
- Get team roster and player positionsgetPlayerStats
- Get player statistics (hitting, pitching)getSchedule
- Get game schedule and datesgetLiveGame
- Get live game data and updatesgetStandings
- Get league and division standingsgetGameBoxscore
- Get detailed game boxscoregetPlayerInfo
- Get player biographical informationgetSeasons
- Get season information and yearsgetVenues
- Get stadium and venue information
šÆ Enhanced Workflow
Traditional Approach:
Enhanced Meta-Tool Approach:
Request Format
Send POST requests to the worker endpoint with the following JSON structure:
Response Format
Successful responses return:
Error responses return:
Development
Install Wrangler CLI:
npm install -g wranglerLogin to Cloudflare:
wrangler loginDeploy the worker:
wrangler deploy
š Complete Usage Examples
š§ Meta-Tool Examples
Resolve Team Names
Resolve Player Names
ā¾ Data Retrieval Examples
Get Team Information
Get Player Stats (with resolved player ID)
Get Team Roster (with resolved team ID)
Get Schedule
š Error Handling Examples
Team Not Found
Player Not Found
š Integration with Sports-Proxy
When used with the enhanced sports-proxy, the workflow becomes seamless:
This eliminates the need for manual entity resolution and creates a natural language interface to MLB data!
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Cloudflare Worker that provides access to MLB Statistics API data through the Model Context Protocol, supporting multiple endpoints like team info, player stats, game schedules, and live game data.
Related MCP Servers
- -securityFlicense-qualityA Cloudflare Workers-based Model Context Protocol server that can be deployed without authentication requirements, allowing users to create custom AI tools accessible from Cloudflare AI Playground or Claude Desktop.Last updated -
- -securityFlicense-qualityAn MCP server that enables interaction with MLB (Major League Baseball) v3 projections through the SportsData.io API, allowing access to baseball statistics and projections through natural language.Last updated -
- -securityFlicense-qualityAn MCP Server that enables interaction with MLB scores and statistics via the SportsData.io MLB V3 Scores API, allowing users to access baseball data through natural language queries.Last updated -
- -securityFlicense-qualityA deployable Cloudflare Workers service that implements Model Context Protocol without authentication, allowing AI models to access custom tools via clients like Claude Desktop or Cloudflare AI Playground.Last updated -