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:
- Login to Cloudflare:
- Deploy the worker:
📋 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 -TypeScript
- -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 -Python
- -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 -Python
- -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 -TypeScript