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

@re-shell/mcp

v0.3.0

Published

Stdio MCP server exposing Re-Shell's read-only JSON commands as agent tools.

Readme

@re-shell/mcp

A Model Context Protocol (MCP) server that exposes Re-Shell's machine-readable commands to AI agents as typed, validated tools, plus read-only resources and prompts.

Part of the Re-Shell monorepo. Version in this tree: 0.2.0 (published: 0.1.0).

Re-Shell emits a stable { ok, data, warnings } / { ok, error } envelope (the single source of truth is @re-shell/contracts). This server wraps the allow-listed, JSON-emitting commands so an MCP-capable agent can inspect and reason about a workspace safely: read-only by default, and every result validated against the exact wire schema before the agent sees it.

Tools

Read-only (always registered):

| Tool | Wraps | Returns | |------|-------|---------| | workspace_summary | re-shell workspace summary --json | workspace overview envelope | | workspace_graph | re-shell workspace graph --json | dependency graph envelope | | workspace_health | re-shell workspace health --json | health summary envelope | | templates_list | re-shell templates list --json | template catalog (optional language/framework filter) | | templates_show | re-shell templates show <id> --json | one template | | templates_matrix | re-shell templates matrix --json | compatibility matrix | | doctor | re-shell doctor --json | diagnostics | | analyze | re-shell analyze --json | workspace analysis | | commands_list | re-shell commands list --json | command catalog |

Opt-in write tools, registered only when RE_SHELL_MCP_ALLOW_WRITE=1:

| Tool | Does | |------|------| | workspace_create | re-shell workspace init <name> --json | | scaffold_service | Runs re-shell generate service <name> --json; when name is missing it asks the host for it through MCP elicitation instead of failing |

Resources and prompts

Resources (read-only, JSON): reshell://workspace/summary, reshell://workspace/graph, reshell://workspace/health, reshell://scorecard (production-readiness scorecard) and reshell://contracts/commands (the command catalog).

Prompts: scaffold-service (turn a description into a reviewable dry-run plan of real commands) and diagnose-drift (diagnose dependency drift and readiness gaps from the scorecard and health resources). Prompt arguments are treated as untrusted data.

How it works

Each tool spawns the built Re-Shell CLI (spawn, argv array, no shell) with --json, parses stdout, and validates it against the matching wire schema from @re-shell/contracts (the *WireSchema exports, e.g. workspaceSummaryWireSchema) before returning it. A non-zero exit that still emits a valid error envelope is returned as-is, so the agent sees the CLI's own code and message; non-JSON or schema-invalid output is surfaced as an MCP error. Fields a newer CLI adds are passed through untouched. Output is capped at 8 MiB and each call has a 120 s backstop timeout.

The CLI is located automatically: @re-shell/cli is a declared dependency of this package, so a standalone install is enough and RE_SHELL_BIN is not required. Resolution order: RE_SHELL_BIN (optional override) then require.resolve('@re-shell/cli') then a monorepo fallback to packages/cli/dist/index.js. The re-shell-mcp bin resolves symlinks (realpath), so it starts correctly through node_modules/.bin as npx runs it.

Usage

npx @re-shell/mcp

Wire it into an MCP client (config excerpt):

{
  "mcpServers": {
    "re-shell": {
      "command": "npx",
      "args": ["-y", "@re-shell/mcp"]
    }
  }
}

| Env var | Purpose | |---------|---------| | RE_SHELL_BIN | Optional path to a specific CLI entry (dist/index.js) instead of the installed @re-shell/cli dependency | | RE_SHELL_MCP_ALLOW_WRITE | Set to 1 to register the write tools (off by default) |

The server reports its package version to the client in the MCP initialize result.

Safety

  • Read-only by default: write tools require explicit opt-in.
  • No shell: commands run via spawn with an argv array, never shell: true.
  • Allow-listed: only the commands above are exposed (they mirror the dashboard hub's command registry).
  • Contract-validated: every payload is checked against the @re-shell/contracts wire schemas before it reaches the agent.

Development

pnpm --filter @re-shell/mcp test builds dist/ first and then runs the built bin (through a symlink, as npx does) against the real CLI: an MCP initialize + tools/list handshake over stdio, every read-only tool and resource, and a check that the published tarball contains no test files. Build the CLI first (pnpm -r build). The repository's node scripts/pack-smoke.mjs additionally packs this package with the CLI and contracts, installs the tarballs in a clean directory outside the repo and runs the MCP handshake against the installed re-shell-mcp.