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 PyPI 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": {
     "sports": {
       "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.1.tar.gz (29.9 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.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_sports_server-1.0.1.tar.gz
  • Upload date:
  • Size: 29.9 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.1.tar.gz
Algorithm Hash digest
SHA256 5c394296780c831f5b00d6ec4fd817982f075ba48c95c002bfbb507172a89ad1
MD5 0053cbc123bf0910ccf302feeb61ee17
BLAKE2b-256 fb6adfcfe87914c6d3521786c1f2ed48f4993e6d595b8fb8c34383fb5677bb62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_sports_server-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4114437bbf4c827939e743589c93e082ffa1a5f0223cca880fb5b294cf432c8
MD5 d036caeb183950ca80cb9dbf9f4fef01
BLAKE2b-256 8665e6cf50c218d37aeea0f8f3d50705693575707a54a96e8414a02fcfe84dbf

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