NHL MCP Server
Provides access to live NHL data including player statistics, team standings, game scores, schedules, and playoff information through 40+ NHL API endpoints.
README
NHL MCP Server
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.
🏒 Features
This MCP server provides access to 40+ NHL API endpoints including:
Player Information
- Player game logs (current and historical seasons)
- Player detailed information and career statistics
- Player spotlight and featured players
- Player landing pages and biographical data
Statistics
- Current and historical skater stats leaders
- Current and historical goalie stats leaders
- Customizable statistical categories and limits
- Season and career totals
Team Information
- 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
Game Information
- 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 Information
- League schedules and season calendars
- TV schedules and broadcast information
- Streaming availability ("where to watch")
- Network television schedules
Playoff Information
- Playoff overviews and tournament brackets
- Playoff schedules and series information
- Postseason statistics and records
Additional Features
- Season information and draft data
- Meta information and API utilities
- Team code references and format helpers
- Comprehensive error handling
🚀 Installation
- Clone or download this repository
- Install the required dependencies:
pip install -r requirements.txt
Dependencies:
fastmcp>=2.8.0- FastMCP framework for MCP server creationrequests>=2.31.0- HTTP library for API callstyping-extensions- Enhanced type hints support
📖 Usage
Running the Server
Start the MCP server:
python nhl_mcp_server.py
The server will start and listen for MCP connections.
MCP Client Configuration
Add this server to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"nhl-api": {
"command": "python",
"args": ["/path/to/nhl_mcp_server.py"]
}
}
}
Testing the Server
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
🛠️ Available Tools
The server exposes the following MCP tools:
Player Tools
get_player_info(player_id)- Get detailed player informationget_player_game_log(player_id, season, game_type)- Get player game logsget_player_spotlight()- Get featured players
Team Tools
get_standings_now()- Get current NHL standingsget_club_stats_now(team)- Get team statisticsget_team_roster(team)- Get team rosterget_team_schedule(team)- Get team schedule
Game Tools
get_daily_scores_now()- Get today's scoresget_play_by_play(game_id)- Get game play-by-playget_game_boxscore(game_id)- Get game boxscore
Statistics Tools
get_current_skater_stats_leaders()- Get skater stat leadersget_current_goalie_stats_leaders()- Get goalie stat leaders
Schedule Tools
get_schedule_now()- Get current scheduleget_tv_schedule_now()- Get TV schedule
Utility Tools
get_team_codes()- Get list of NHL team codesget_season_format_help()- Get format help for seasons and parameters
📋 Parameter Formats
Team Codes
Use standard NHL team abbreviations:
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
Season Format
Seasons use 8-digit format: YYYYYYYY
20232024for 2023-24 season20222023for 2022-23 season
Game Types
2- Regular season games3- Playoff games
Date Format
Use ISO date format: YYYY-MM-DD
2024-01-15for January 15, 2024
💡 Example Queries
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"
🏗️ Architecture
The project consists of:
nhl_api_client.py- Core NHL API client with 40+ endpoint functionsnhl_mcp_server.py- FastMCP server that exposes API functions as MCP toolstest_client.py- Test script for the NHL API clienttest_mcp_server.py- Test script for the MCP server backenddemo.py- Comprehensive demonstration of server capabilitiesrequirements.txt- Python dependenciesmcp_config_example.json- Example MCP client configuration
✅ Testing & Validation
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
Test Results:
- ✅ 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
🔧 Error Handling
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.
🤝 Contributing
Feel free to contribute by:
- 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
📄 License
This project is open source. The NHL API is provided by the National Hockey League and is subject to their terms of service.
🖼️ Screenshots
NHL MCP Server in Action

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!
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。