Sports-MCP-Server

tejas161/Sports-MCP-Server

3.2

If you are the rightful owner of Sports-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server for accessing TheSportsDB API with multiple tools for sports data retrieval.

Tools
  1. listLeagues

    List all leagues in a country for a specific sport.

  2. listTeams

    List all teams in a specific league by league name or by sport and country.

  3. searchPlayers

    Search for any sports person by their main or alternate name.

  4. searchEvents

    Search for any sports event by its title with optional filters.

  5. getEventHighlights

    Get video YouTube highlights for events on a particular date.

Sports MCP Server

A Model Context Protocol (MCP) server for accessing TheSportsDB API with multiple tools for sports data retrieval.

Project Structure

sports_new_mcp_server/
ā”œā”€ā”€ index.js                 # Main entry point
ā”œā”€ā”€ package.json            # Project dependencies
ā”œā”€ā”€ package-lock.json       # Dependency lock file
ā”œā”€ā”€ README.md              # Project documentation
└── src/                   # Source code directory
    ā”œā”€ā”€ server.js          # Server setup and tool registration
    ā”œā”€ā”€ utils/             # Shared utilities
    │   └── api.js         # API request utilities
    └── tools/             # Individual MCP tools
        ā”œā”€ā”€ listLeagues.js      # List leagues tool
        ā”œā”€ā”€ listTeams.js        # List teams tool
        ā”œā”€ā”€ searchPlayers.js    # Search players tool
        ā”œā”€ā”€ searchEvents.js     # Search events tool
        └── getEventHighlights.js # Get event highlights tool

Available Tools

1. listLeagues

List all leagues in a country for a specific sport.

  • Parameters: country (required), sport (required)
  • Example: {country: "England", sport: "Soccer"}

2. listTeams

List all teams in a specific league by league name or by sport and country.

  • Parameters: league OR (sport + country)
  • Examples:
    • {league: "English_Premier_League"}
    • {sport: "Soccer", country: "Spain"}

3. searchPlayers

Search for any sports person by their main or alternate name.

  • Parameters: player (required)
  • Example: {player: "Lionel Messi"}

4. searchEvents

Search for any sports event by its title with optional filters.

  • Parameters: event OR filename, optional: season, date
  • Examples:
    • {event: "Arsenal_vs_Chelsea"}
    • {event: "Arsenal_vs_Chelsea", season: "2016-2017"}
    • {event: "Arsenal_vs_Chelsea", date: "2015-04-26"}

5. getEventHighlights

Get video YouTube highlights for events on a particular date.

  • Parameters: date (required), optional: leagueId OR sport
  • Examples:
    • {date: "2024-07-07"}
    • {date: "2024-07-07", leagueId: 4684}
    • {date: "2024-07-07", sport: "motorsport"}

Installation & Usage

  1. Install dependencies:

    npm install
    
  2. Start the MCP server:

    node index.js
    

Architecture

The server is built with a modular architecture:

  • Entry Point (index.js): Simple entry point that starts the server
  • Server (src/server.js): Main server setup and tool registration
  • Utilities (src/utils/api.js): Shared API request functions
  • Tools (src/tools/*.js): Individual tool implementations

Each tool is self-contained with its own schema definition and handler function, making it easy to add, modify, or remove tools independently.

API Data Source

All data is sourced from TheSportsDB API, a free sports database API.