Skip to main content
Glama

MLB Stats MCP Server

by jdguggs10

MLB Stats MCP Server

A Cloudflare Worker that serves as an MCP (Model Context Protocol) server for accessing MLB Stats API data.

Features

  • Proxy requests to MLB Stats API
  • Support for multiple MLB endpoints
  • CORS enabled for web applications
  • Error handling and validation
  • No API keys required (MLB Stats API is public)

Supported Commands

  • getTeamInfo - Get team information
  • getRoster - Get team roster
  • getPlayerStats - Get player statistics
  • getSchedule - Get game schedule
  • getLiveGame - Get live game data
  • getStandings - Get league standings
  • getGameBoxscore - Get game boxscore
  • getPlayerInfo - Get player information
  • getSeasons - Get season information
  • getVenues - Get venue information

Request Format

Send POST requests to the worker endpoint with the following JSON structure:

{ "command": "getPlayerStats", "params": { "pathParams": { "playerId": "660271" }, "queryParams": { "stats": "season", "group": "hitting", "season": "2024" } } }

Response Format

Successful responses return:

{ "result": { // MLB API response data } }

Error responses return:

{ "error": "Error message" }

Development

  1. Install Wrangler CLI:
    npm install -g wrangler
  2. Login to Cloudflare:
    wrangler login
  3. Deploy the worker:
    wrangler deploy

Example Usage

Get Team Information

{ "command": "getTeamInfo", "params": { "queryParams": { "season": "2024", "sportId": "1" } } }

Get Player Stats

{ "command": "getPlayerStats", "params": { "pathParams": { "playerId": "660271" }, "queryParams": { "stats": "season", "group": "hitting", "season": "2024" } } }

Get Schedule

{ "command": "getSchedule", "params": { "queryParams": { "sportId": "1", "date": "2024-07-04" } } }
-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. Features
    1. Supported Commands
      1. Request Format
        1. Response Format
          1. Development
            1. Example Usage
              1. Get Team Information
              2. Get Player Stats
              3. Get Schedule

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              A 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
            • -
              security
              F
              license
              -
              quality
              An 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
            • -
              security
              F
              license
              -
              quality
              An 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
            • -
              security
              F
              license
              -
              quality
              A 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

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/jdguggs10/mlbstats-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server