npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

puckapi

v0.1.0

Published

The hockey data API. Stats, odds, and everything between. REST API + MCP server.

Readme

PuckAPI

The hockey data API. Stats, odds, and everything between. REST API + MCP server.

Architecture

Two services, one database:

  • Next.js app (Vercel) -- public site, dashboard, auth, billing, playground
  • MCP server (Railway) -- 12 data tools, API key auth, credit metering
  • Neon Postgres -- shared database

Stack

  • Next.js 15 (App Router) + Tailwind CSS
  • Better Auth (email/password + email verification)
  • Stripe (subscriptions + wallet deposits + customer portal)
  • Resend (transactional email)
  • Drizzle ORM + Neon Postgres
  • MCP SDK (Streamable HTTP transport)

Local Development

# Install
npm install

# Set up environment
cp .env.example .env
# Fill in DATABASE_URL, BETTER_AUTH_SECRET, STRIPE_SECRET_KEY, etc.

# Run Next.js dev server
npm run dev:web

# Run MCP server (separate terminal)
npm run dev

# Build
npm run build:web    # Next.js
npm run build        # MCP server (tsc)

# Test
npm test             # 88 integration tests

# Database
npm run db:generate  # Generate Drizzle migrations
npm run db:migrate   # Apply migrations

Data Pipeline

npm run backfill:games     # Games from NHL API
npm run backfill:odds      # Odds from The Odds API
npm run backfill:rosters   # Player rosters
npm run backfill:goalies   # Goalie stats
npm run backfill:standings # Team standings
npm run daily-update       # Daily refresh (also runs via GitHub Actions)

MCP Endpoint

Production: https://mcp.puckapi.com/mcp

Requires API key via x-api-key header or Authorization: Bearer header.

12 Endpoints

| Credits | Endpoints | |---------|-----------| | 1 | list_teams | | 2 | get_standings, get_schedule, search_players | | 5 | get_games, get_team_stats, get_player_stats, get_goalie_stats | | 10 | get_odds, get_game_detail, get_head_to_head | | 25 | get_line_movement |

Billing

  • Free tier: 500 credits on signup
  • Subscriptions: Starter ($19/mo, 10K credits), Pro ($49/mo, 30K credits), Scale ($149/mo, 125K credits)
  • Wallet deposits: $5 to $500, 400 credits per dollar, never expire
  • Monthly credits reset each period and are consumed first. Wallet credits are permanent.

Metering

The MCP server supports METERING_MODE:

  • enforced -- charges credits, refunds on tool errors, serializable transactions
  • shadow -- records lifecycle data without charging
  • off -- bypasses metering for local debugging

Idempotency: pass x-idempotency-key or x-request-id to make retries duplicate-safe.

Deployment

  • Next.js: Auto-deploys to Vercel on push to main
  • MCP server: Auto-deploys to Railway on push to main
  • Database: Neon Postgres (migrations run automatically on Railway start)

Environment Variables

See .env.example for full list. Key ones:

| Variable | Required | Description | |----------|----------|-------------| | DATABASE_URL | Yes | Neon Postgres connection string | | BETTER_AUTH_SECRET | Yes | Session signing secret | | STRIPE_SECRET_KEY | Yes | Stripe API key | | STRIPE_PRICE_STARTER/PRO/SCALE | Yes | Stripe recurring price IDs | | RESEND_API_KEY | Yes | Transactional email | | INTERNAL_API_SECRET | Prod | MCP server to Next.js auth | | MCP_SERVER_URL | Prod | Playground proxy target | | FRONTEND_URL | Prod | Credit alert callback URL |