NHL MCP Server
About
An MCP server for the NHL API, providing access to all documented endpoints.
Details
- Author
- sanchorelaxo
- Categories
- Developer Tools, Other, API
Jump to
Setup
Install NHL MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/sanchorelaxo/mcp-server-sandbox
Follow the installation instructions in the repository README, then restart your MCP client.
A comprehensive Model Context Protocol (MCP) server for the NHL API, built with FastMCP. This server provides access to all documented NHL API endpoints through MCP tools, enabling AI assistants to access live NHL data.
This MCP server provides access to40+ NHL API endpointsincluding:
- Player game logs (current and historical seasons)
- Player detailed information and career statistics
- Player spotlight and featured players
- Player landing pages and biographical data
- Current and historical skater stats leaders
- Current and historical goalie stats leaders
- Customizable statistical categories and limits
- Season and career totals
- Team standings (current and historical by date)
- Team statistics and performance metrics
- Team rosters with player details
- Team schedules and upcoming games
- Club statistics and team comparisons
- Daily scores and live scoreboards
- Game play-by-play data with detailed events
- Game boxscores and statistical summaries
- Game stories and match summaries
- Game landing pages
- League schedules and season calendars
- TV schedules and broadcast information
- Streaming availability ("where to watch")
- Network television schedules
- Playoff overviews and tournament brackets
- Playoff schedules and series information
- Postseason statistics and records
- Season information and draft data
- Meta information and API utilities
- Team code references and format helpers
- Comprehensive error handling
- Clone or download this repository
- Install the required dependencies:
- fastmcp>=2.8.0- FastMCP framework for MCP server creation
- requests>=2.31.0- HTTP library for API calls
- typing-extensions- Enhanced type hints support
The server will start and listen for MCP connections.
Add this server to your MCP client configuration (e.g., Claude Desktop):
{ "mcpServers": { "nhl-api": { "command": "python", "args": ["/path/to/nhl_mcp_server.py"] } } }
Run the test scripts to verify functionality:
# Test the underlying NHL API client python test_client.py # Test the MCP server backend python test_mcp_server.py # Run a comprehensive demo python demo.py
The server exposes the following MCP tools:
- get_player_info(player_id)- Get detailed player information
- get_player_game_log(player_id, season, game_type)- Get player game logs
- get_player_spotlight()- Get featured players
- get_standings_now()- Get current NHL standings
- get_club_stats_now(team)- Get team statistics
- get_team_roster(team)- Get team roster
- get_team_schedule(team)- Get team schedule
- get_daily_scores_now()- Get today's scores
- get_play_by_play(game_id)- Get game play-by-play
- get_game_boxscore(game_id)- Get game boxscore
- get_current_skater_stats_leaders()- Get skater stat leaders
- get_current_goalie_stats_leaders()- Get goalie stat leaders
- get_schedule_now()- Get current schedule
- get_tv_schedule_now()- Get TV schedule
- get_team_codes()- Get list of NHL team codes
- get_season_format_help()- Get format help for seasons and parameters
- TOR(Toronto Maple Leafs),MTL(Montreal Canadiens)
- NYR(New York Rangers),BOS(Boston Bruins)
- EDM(Edmonton Oilers),CGY(Calgary Flames)
- And all other NHL teams
- 20232024for 2023-24 season
- 20222023for 2022-23 season
- 2- Regular season games
- 3- Playoff games
Once connected to an MCP client, you can ask:
- "What are the current NHL standings?"
- "Show me Connor McDavid's stats this season"
- "What games are on today?"
- "Get the Toronto Maple Leafs roster"
- "Who are the current goal scoring leaders?"
- "Show me yesterday's game scores"
- "Get the playoff bracket"
- nhl_api_client.py- Core NHL API client with 40+ endpoint functions
- nhl_mcp_server.py- FastMCP server that exposes API functions as MCP tools
- test_client.py- Test script for the NHL API client
- test_mcp_server.py- Test script for the MCP server backend
- demo.py- Comprehensive demonstration of server capabilities
- requirements.txt- Python dependencies
- mcp_config_example.json- Example MCP client configuration
The server has been thoroughly tested with:
- Live NHL Data: All endpoints tested with current NHL season data
- Error Handling: Robust error handling for API failures and invalid parameters
- Response Validation: Proper handling of different response types (dict, list, etc.)
- MCP Compliance: Full compatibility with MCP protocol standards
- ✅ 40+ NHL API endpoints working correctly
- ✅ Live data retrieval (standings, scores, player stats)
- ✅ MCP tool registration and exposure
- ✅ Error handling and validation
- ✅ Documentation and examples
The server includes comprehensive error handling:
- HTTP Errors: Network timeouts, connection failures, API unavailability
- JSON Parsing: Malformed responses and unexpected data structures
- Parameter Validation: Invalid team codes, player IDs, and date formats
- Rate Limiting: Graceful handling of API rate limits
All errors are returned as descriptive messages to help with debugging.
- Adding new NHL API endpoints as they become available
- Improving error handling and validation
- Adding more comprehensive tests
- Enhancing documentation and examples
- Reporting bugs or suggesting improvements
This project is open source. The NHL API is provided by the National Hockey League and is subject to their terms of service.
Screenshot showing the NHL MCP Server providing live NHL data including current standings, player information, game scores, and statistics. The server successfully integrates with MCP clients to bring comprehensive hockey data to AI assistants.
🏒 Ready to bring live NHL data to your AI assistant!
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Access college football statistics from the College Football Data API.
Provides club information and advanced player statistics for Euroleague and Eurocup basketball from the Euroleague API.
Access Formula 1 data, including race results, driver standings, and circuit information.
Access extensive Formula 1 statistics and information using the FastF1 library and OpenF1 API.
Provides football (soccer) data using the API-Football service.
Access MLB game data, standings, and player statistics using the SportRadar API.
The hockey data API. Stats, odds, and everything between.
Provides real-time football match information from the SoccerDataAPI using natural language.
Provides football (soccer) statistics and live match data using the API-Football service.
41 sports API providers, 396 tools: scores, stats, odds, esports, chess, motorsport & more.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





