Skip to main content

Model Context Protocol SDK for real-time sports stats. Requires an API key from SportsRadar

Project description

Sports MCP Server

MIT licensed Python Version

Built on top of the Model Context Protocol Python SDK

Overview

Python server implementing Model Context Protocol (MCP) for interactability with real-time sports stats via SportRadar

Supported Sports

  • NFL

Note: Please check Development for adding more sport support

Features

  • Get game, league and player stats
  • Get team rosters and schedules
  • Get tournament info and player transactions

Note: The server will need an API key from SportRadar. Here is the instruction link

Resources

  • sports://seasonsched/{_cache}: Season schedule cache
  • sports://leaguetransactions/{_cache}: League transactions cache / parser
  • sports://gamestats/{_cache}: Game stats cache
  • sports://leaguestats/{_cache}: League stats cache
  • sports://teamstats/{_cache}: Team stats cache
  • sports://playerstats/{_cache}: Player stats cache

Tools

  • update_api_config
    • Update SportRadar's API configuration settings
    • Args
      • language (str)
      • access_level (str) -> trial or production api key
      • format (str) -> data return format (JSON or XML)
  • get_schedule
    • Gets a specific week schedule for the sport given
    • Args
      • sport (str)
      • week (int)
      • type (str) -> type of season (PRE, REG, PST)
      • year (int)
  • get_daily_transactions
    • Gets info on transactions done in sports teams throughout the year
    • Args
      • year (int)
      • month (int)
      • day (int)
      • sport (str)
  • get_game_stats
    • Gets statistical info on a specific sports game using it's ID
    • Args
      • game_id (str)
      • sport (str)
  • get_league_info
    • Gets top-level info about each team in the sport provided
    • Args
      • sport (str)
  • get_team_roster
    • Gets franchise team info + complete roster of players in the sport provided
    • Args
      • team_id (str)
      • sport (str)
  • get_tournament_list
    • Gets lists of tournaments that are happening for the sport in that year
    • Args
      • sport (str)
      • year (int)
  • get_tournament_info
    • Gets information of a tournament that is happening for the sport
    • Args
      • tournament_id (str)
      • sport (str)
  • get_player_stats
    • Gets top-level info about each player in the sport provided
    • Args
      • sport (str)
      • player_id (str)
  • get_address
    • When given coordinates (lat and lon), find the address
    • Args
      • lat (float)
      • lon (float)

Usage with Claude Desktop

Installing Manually

  1. First, install the package: pip install mcp-sports-server

  2. Add this to your claude_desktop_config.json

{
  "mcpServers": {
     "ancestry": {
       "command": "mcp-sports-server",
       "args": ["--api-key", "your_api_key"]
     }
  }
}

Development

As currently there is only NFL support. If there is enough interest more sports will be added.

If you want to create your own sport support, you can fork this repo and either make your own MCP server, or push changes to this current server.

Most of the code inside has DOCTYPE comments about how to add a new sport, essentially to add a new sport:

  1. Create a new Sport inside of sportsclasses.py
  2. Update MCP Resources (more specifically the parser_map to include your sport parsing function)
  3. Update MCP Tools as needed (you will need to update the Annotated parameters in tools)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_sports_server-1.0.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_sports_server-1.0.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_sports_server-1.0.0.tar.gz.

File metadata

  • Download URL: mcp_sports_server-1.0.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.0 CPython/3.11.3

File hashes

Hashes for mcp_sports_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1b46dde84d8c62cb65d6f0668c1aa0230ed1ce1e8cd4c8c906e096affe5621e1
MD5 3bb94333760be903769ec07150e91b9b
BLAKE2b-256 e7c1669278f23bd4389b43a411badd0a404d27d67eb1a7beed92f23f44edaa66

See more details on using hashes here.

File details

Details for the file mcp_sports_server-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_sports_server-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a04ff78d0b7a06026aa91b3273eb068df2f141bc7201fa5232a9d4a2c9336ebe
MD5 4168c927e2ac441f061e04252072e88f
BLAKE2b-256 1a5a0c083297135d10d027be4adfdff4c175ec0dd344a5a8f394cf4d0921b2dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page