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

getlib-mcp

v1.5.1

Published

GetLib MCP - powerful modular self-hostable library docs MCP server and dashboard (Context7 alternative)

Downloads

2,661

Readme

GetLib MCP

Self-hostable library docs platform: Next.js dashboard + first-class MCP server with tools, resources, and prompts. A Context7-style alternative you own.

Stack

  • Bun (package manager, scripts, MCP runtime)
  • Next.js 16 App Router + React 19 + TypeScript
  • Tailwind CSS v4 + HeroUI v3 + Recharts
  • Supabase PostgreSQL (production database + dev option, per-concern migrations)
  • Official @modelcontextprotocol/sdk v1

Scripts (Bun only)

bun install
cp .env.example .env   # set GET_LIB_MODE=development for local work
bun run dev      # dashboard with Turbopack
bun run mcp      # MCP server over stdio (14 tools, 2 resources, 6 prompts)
bun run build:mcp # emit the modular npx/CLI entry to dist/index.js (runs on prepublishOnly)
bun run db:push -- --database-url "$DATABASE_URL" --target development  # apply supabase/migrations in order
bun run build
bun run start    # also serves Streamable HTTP at /api/mcp/http and SSE at /api/mcp/sse
bun run typecheck
bun run lint     # typecheck + no-em-dash repository check + architecture boundary check
bun run validate # typecheck + no-em-dash check + boundary check + tests + production build
bun test         # unit + integration tests across application, domain, and server (bun:test)

Layout

src/
  app/         # Next.js App Router: (auth), (dashboard), api/mcp, api/management,
               # api/_lib (shared route helpers: error model, body limits, request IDs)
  web/         # Dashboard UI: features, components, hooks, lib/api-client,
               # styles/tokens.css, types (web-owned control-plane contracts)
  application/ # Use cases: library (search, resolve, docs, best-practices,
               # snippets, examples, compare, changelog, migration,
               # batch-resolve), scan, audit, compat, dispatch, health,
               # clients, mcp catalog, sources, dashboard, statistics,
               # install, runtime, development, settings, auth (used by
               # API routes). Capability seams are injected Deps interfaces;
               # live bindings sit in server/mcp/infrastructure/deps.
  domain/      # Pure business rules (no I/O): auth policy, MCP catalog contracts
  server/mcp   # MCP module: registry, tools, services, sources, utils,
               # resources, prompts, transport, runtime, init,
               # infrastructure/database, infrastructure/supabase,
               # infrastructure/deps (live use-case bindings), tests

Architecture

MCP Control Plane + MCP Server + Web Application. One rule governs the boundary:

server/ never imports web/
Web UI -> features -> services -> /api/management/* -> application
MCP server -> registry -> tools -> application -> domain
  -> infrastructure -> Supabase / external providers

MCP tools are thin protocol adapters: validate input, run the service, return the result. The dashboard reads control-plane data over /api/management/* only; /api/mcp/* is the MCP protocol boundary (Streamable HTTP, SSE, tool execution) and never serves browsers. Auth is centralized with fallback bootstrap credentials, persistence goes through the database repository boundary (mock in development, Supabase in production), and the runtime environment auto-detects from Vercel/Node metadata (GET_LIB_MODE exists only as a debug override).

Repository checks: bun run lint also enforces the no-em-dash rule (all controlled content must avoid the em dash character; encoded circumventions are additionally rejected in user-facing src/app and src/web output, while backend detection patterns may still match em dashes inside untrusted external content. AGENTS.md is excluded because Next.js tooling regenerates that file, and bun.lock because it is a generated lockfile) and the architecture boundary check (scripts/check-boundaries.ts: dependency direction across web, app, application, domain, infrastructure, and MCP layers). All GETLIB_* environment variables are validated in src/server/mcp/config.ts, the single configuration boundary.

Deployment

  • Vercel: Next.js framework, install and build via Bun
  • Docker: multi-stage Bun build, Node runtime with next start
  • VPS: build, then serve .next behind any Node host

License

GetLib MCP, Copyright (c) 2026 D1ZZY4, is licensed under the Server Side Public License, Version 1 (SSPL v1). See LICENSE for the full text. In short: free to use, modify, and self-host; forks and modified versions must stay open under the same license with source included; offering it as a service to third parties requires releasing the full service source; attribution to the original source must be kept.