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

@opencodehub/mcp

v0.1.0

Published

OpenCodeHub — stdio MCP server exposing code-graph + group tools

Downloads

49

Readme

@opencodehub/mcp

Model Context Protocol server for OpenCodeHub. Wraps the analysis + storage layer and exposes it to coding agents over stdio.

Surface

codehub mcp   # spawn the stdio server
  • Transport is stdio only — no HTTP, no SSE, no daemon (packages/cli/src/commands/mcp.ts).
  • list_repos is the discovery entry point. Per-repo tools accept an optional repo (registry name) or repo_uri alias (Sourcegraph-style URI like github.com/org/repo, local:<hash> for unpublished repos); with one repo registered both are optional.
  • When ≥ 2 repos are registered and neither is supplied, the tool returns an AMBIGUOUS_REPO error envelope with choices[] (capped at 10) so the caller can retry deterministically (see root CLAUDE.md).
  • Every response carries a next_steps array and a _meta.codehub/staleness entry when the index may be behind HEAD (packages/mcp/src/staleness.ts).

Tools

29 tools registered in packages/mcp/src/server.ts:151-179. Implementation files live under packages/mcp/src/tools/<id>.ts.

| Group | Tools | | ----------- | ---------------------------------------------------------------------------------------------------------- | | Discovery | list_repos, query, context, route_map, tool_map | | Impact | impact, api_impact, detect_changes, shape_check, rename | | Snapshot | pack_codebase, project_profile, dependencies, owners, risk_trends | | Findings | scan, verdict, list_findings, list_findings_delta, license_audit | | Dead code | list_dead_code, remove_dead_code | | Group | group_list, group_query, group_status, group_contracts, group_cross_repo_links, group_sync | | Raw query | sql |

Design

  • Single source of truth — registration order in server.ts IS the surface. tool_map introspects the live server so agents can list tools without out-of-band documentation (packages/mcp/src/tools/tool-map.ts).
  • Structured errors over prose — every error returns structuredContent.error = { error_code, jsonrpc_code, ... } so a caller can branch on error_code instead of regex-matching (packages/mcp/src/error-envelope.ts).
  • Repo resolution is centralisedrepoResolver and the AMBIGUOUS_REPO envelope are wired through every per-repo tool so ambiguity is reported once, consistently (packages/mcp/src/repo-resolver.ts).
  • Connection pooling — the graph store is held in a per-process pool to amortise DuckDB cold starts across many tool calls (packages/mcp/src/connection-pool.ts).
  • Lazy analysis — heavy work (scan, code-pack, verdict) shells out via analysis-bridge rather than running in the MCP process so a hung scanner cannot stall the server (packages/mcp/src/analysis-bridge.ts).

See ADR 0012 for the repo_uri-as-typed-attribute rationale and the root CLAUDE.md for the AMBIGUOUS_REPO retry contract.