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

@pamudji/spechub

v0.1.0

Published

This repo is the implementation of the product described in `SPEC.md`.

Readme

SpecHub

This repo is the implementation of the product described in SPEC.md.

What’s here (so far)

  • apps/gateway: MCP-ish HTTP gateway with in-memory or Appwrite storage
  • scripts/appwrite-bootstrap.js: creates Appwrite DB + collections used by the gateway
  • scripts/pat-create.js / scripts/pat-revoke.js: manage Personal Access Tokens (PATs)
  • apps/gateway/test/*: smoke tests (in-memory + real Appwrite)

Run the gateway locally

npm run dev:gateway

MCP server details

  • Endpoint: POST /mcp (JSON-RPC 2.0)
  • Auth:
    • AUTH_MODE=dev: requires Authorization: Bearer <DEV_PAT> (default dev-token)
    • AUTH_MODE=appwrite: either Authorization: Bearer <PAT> or a dashboard session cookie (spechub_session)
  • Optional SSE response mode: send Accept: text/event-stream (or add ?sse=1) to get a single-event SSE response (non-streaming JSON-RPC result payload).

Env vars (optional):

  • PORT (default: 8787)
  • DEV_PAT (default: dev-token) – bearer token accepted by the gateway
  • DEV_ADMIN_USER_IDS (default: empty) – comma-separated user IDs that can force-unlock
  • ALLOWED_ORIGINS (optional) – allowlist for browser Origins (same-origin is allowed automatically; CORS supports credentialed requests for allowed origins)
  • Cookie auth (for cross-origin dashboards):
    • COOKIE_SAMESITE=none and COOKIE_SECURE=1 (required if your dashboard is on a different “site”)
    • Optional: COOKIE_DOMAIN=.example.com (only works for shared parent domains)

Quick smoke test

$headers = @{
  Authorization = "Bearer dev-token"
  "Content-Type" = "application/json"
}

$body = @{
  jsonrpc = "2.0"
  id = 1
  method = "tools/list"
  params = @{}
} | ConvertTo-Json -Depth 10

Invoke-RestMethod -Method Post -Uri http://localhost:8787/mcp -Headers $headers -Body $body

Minimal CLI wrapper (/sh-* style)

This repo includes a minimal Node wrapper that can drive the MCP gateway:

npm run sh -- init --url http://localhost:8787 --pat dev-token --project demo
npm run sh -- plan mvp "Ship MVP"
npm run sh -- exec 1 --auto-complete

No-clone usage (installable binaries)

If you want to use /sh-* style commands in other repos without cloning this repo, install from Git and use the spechub binary:

npm i -g @pamudji/spechub
spechub-gateway   # runs the MCP gateway
spechub install-claude   # writes `.claude/commands/sh-*.md` into the current repo
spechub install-mcp      # writes `.mcp.json` that registers `spechub-mcp` (stdio→HTTP bridge)

Claude Code MCP setup (Option B: tools/resources directly)

Claude Code typically expects MCP servers over stdio. SpecHub’s gateway is HTTP, so use the included bridge:

  • Install the package: npm i -g @pamudji/spechub
  • In your repo: spechub install-mcp --url https://<your-gateway>
    • Defaults to an npx-based .mcp.json so collaborators don’t need a global install.
    • If you don’t want a PAT checked into the repo, omit --pat and set SPECHUB_PAT in your environment instead.
  • Restart Claude Code so it reloads .mcp.json.

Use a remote Appwrite backend

  1. Create .env from .env.example and set:
  • STORAGE_BACKEND=appwrite
  • AUTH_MODE=appwrite
  • APPWRITE_ENDPOINT, APPWRITE_PROJECT_ID, APPWRITE_API_KEY, APPWRITE_DATABASE_ID
  1. (Optional) Usage metering:
  • ENABLE_APPWRITE_USAGE=1 records daily counters + append-only usage_events (shadow mode; never blocks core)
  1. Bootstrap the Appwrite database + collections:
npm run appwrite:bootstrap
  1. Start the gateway:
npm run dev:gateway
  1. Sign up / log in via the dashboard (session cookie auth):
  • Open http://localhost:8787/dashboard
  • Use the “Signup / Login” section (this sets an HttpOnly spechub_session cookie)
  • Click “Connect” with an empty PAT field (the dashboard will use the session cookie)
  1. Create a PAT (for CLI or cross-site use), or use the dashboard PAT tools:
npm run pat:create -- --userId YOUR_USER_ID --accountId YOUR_ACCOUNT_ID --roles owner

Notes:

  • If you don’t use Appwrite Teams, the gateway treats your “account” as user:<YOUR_USER_ID> (this is what dashboard/auth/whoami returns in accountIds).
  • If your dashboard is hosted on a different site/origin, use a PAT (simplest) or configure cookie auth with COOKIE_SAMESITE=none + COOKIE_SECURE=1 and make your fetch() calls with credentials: "include".
  1. Open the UIs:
  • Dev UI: http://localhost:8787/
  • Dashboard: http://localhost:8787/dashboard (docs editor, usage, PAT management)