tejas161/Sports-MCP-Server
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.
listLeagues
List all leagues in a country for a specific sport.
listTeams
List all teams in a specific league by league name or by sport and country.
searchPlayers
Search for any sports person by their main or alternate name.
searchEvents
Search for any sports event by its title with optional filters.
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
ORfilename
, 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
ORsport
- Examples:
{date: "2024-07-07"}
{date: "2024-07-07", leagueId: 4684}
{date: "2024-07-07", sport: "motorsport"}
Installation & Usage
-
Install dependencies:
npm install
-
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.