Skip to main content

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.

Metadata

Release files for mcp-sports-server 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-sports-server 1.0.3
File Size Uploaded
mcp_sports_server-1.0.3.tar.gz 29.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-sports-server 1.0.3
File Interpreter ABI Platform
mcp_sports_server-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / mcp_sports_server-1.0.3.tar.gz

Download URL mcp_sports_server-1.0.3.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
725b471945e2f6ce32b849ea639f513f30231eee5a35c0c5dcdd3506ec682918
BLAKE2b-256 checksum
How to use checksums
734522365a948f54b316eccf2f0aa9f5ca9f0be155c885fece6f1460123bb92c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.0 CPython/3.11.3

Release files / mcp_sports_server-1.0.3-py3-none-any.whl

Download URL mcp_sports_server-1.0.3-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b81b4826b818f50029167474c96d568ef9fe59d462af50f1794b22003280c06
BLAKE2b-256 checksum
How to use checksums
b05d0c19342d6f3469b5adc6770dc1238c07be37111079340e39444d1a1f8c92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.0 CPython/3.11.3

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page