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 dayong@mcphub.com.
A Model Context Protocol (MCP) server for accessing TheSportsDB API with multiple tools for sports data retrieval.
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:
leagueOR (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:
eventORfilename, 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:leagueIdORsport - 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.