Skip to main content
Glama

NHL MCP Server

by argotdev
test-api.js1.85 kB
#!/usr/bin/env node /** * Simple test script to verify NHL API connectivity */ import { NHLAPIClient } from './dist/nhl-api.js'; const client = new NHLAPIClient(); async function runTests() { console.log('Testing NHL API Client...\n'); try { // Test 1: Get today's scores console.log('1. Testing get today\'s scores...'); const games = await client.getTodaysScores(); console.log(`✓ Found ${games.length} games for today\n`); // Test 2: Get standings console.log('2. Testing get standings...'); const standings = await client.getStandings(); console.log(`✓ Retrieved standings for ${standings.standings?.length || 0} teams\n`); // Test 3: Get top skaters console.log('3. Testing get top skaters...'); const players = await client.getTopSkaters('points', 5); console.log(`✓ Retrieved top ${players.length} players`); if (players.length > 0) { const topPlayer = players[0]; const name = `${topPlayer.firstName.default} ${topPlayer.lastName.default}`; console.log(` Top scorer: ${name} - ${topPlayer.value} points\n`); } // Test 4: Get top goalies console.log('4. Testing get top goalies...'); const goalies = await client.getTopGoalies(5); console.log(`✓ Retrieved top ${goalies.length} goalies`); if (goalies.length > 0) { const topGoalie = goalies[0]; const name = `${topGoalie.firstName.default} ${topGoalie.lastName.default}`; console.log(` Top goalie: ${name} - ${topGoalie.value.toFixed(3)} SV%\n`); } console.log('✓ All tests passed!\n'); console.log('NHL MCP Server is ready to use.'); console.log('Add it to your Claude Desktop config to start querying NHL data.\n'); } catch (error) { console.error('✗ Test failed:', error.message); process.exit(1); } } runTests();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/argotdev/nhl-mcp-ts'

If you have feedback or need assistance with the MCP directory API, please join our Discord server