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

@sigrun/ext-mcp

v0.5.0

Published

MCP extension for sigrun (pi-durable): registers MCP server tools as <server>/<toolname> tools

Readme

@sigrun/ext-mcp

Register MCP server tools as pi-durable tools, named <server>/<tool>.

Config: the extension's settings (<configDir>/settings/sigrun-mcp.json, edited in Settings → sigrun-mcp). Each entry under "servers" names an MCP server — stdio ("transport": "command") or remote ("transport": "url"):

{
	"servers": {
		"github": {
			"transport": "command",
			"command": "npx",
			"args": ["-y", "@modelcontextprotocol/server-github"],
			"exposure": "codemode",
			"timeout": 120
		},
		"search": {
			"transport": "url",
			"url": "https://mcp.example.test/mcp",
			"headers": { "Authorization": "Bearer <token>" },
			"exposure": "direct"
		}
	}
}

Header and env VALUES are secrets: on save they move to the secrets store (servers/<name>/headers/<Header>, servers/<name>/env/<KEY>) and the file keeps only the names. Other extensions read the registry through the mcp.servers published hook (name, resolved enabled, exposure, toolExposure), answered fresh from settings on every call.

Upgrading from mcp.json: on the first boot with no servers in settings, an existing mcp.json (SIGRUN_MCP_CONFIG or <configDir>/mcp.json) is imported once — secrets into the secrets store, the disabled alias folded into enabled, pi's codemode-deferred normalized to codemode — with a log line and a primary-admin notice. The file is never read again; when settings already have servers, an mcp.json is ignored with a log line.

The sigrun-ext-mcp oauth <server> CLI reads the server from the same settings file plus the sigrun-mcp secrets section (config dir resolution: SIGRUN_CONFIG_DIR → $XDG_CONFIG_HOME/sigrun → ~/.config/sigrun), and stores tokens as <configDir>/mcp-tokens.json (0600). On first read or write, an existing legacy store beside the resolved mcp.json is renamed to that location; an already-present new store wins.

Server fields

  • command, args (stdio) — how to spawn the server.
  • url (remote) — the server endpoint (http/https). Streamable HTTP is the transport; a legacy HTTP+SSE server (2024-11-05 shape — GET stream + endpoint event + message POSTs) is adopted automatically, so no adapter process is needed.
  • headers (remote) — extra request headers (auth etc.), sent on every request. For per-user servers, configured Authorization is removed; only that user's scoped token supplies it.
  • env (stdio) — extra environment variables for the child process. For per-user servers, configured MCP_ACCESS_TOKEN is removed; only that user's scoped token supplies it.
  • credentials — "user" (default) or "shared". User-credential servers start per user in the host's service jail; remote user servers connect with the user's scoped token. Existing installs needing one system-wide server must explicitly select "shared".
  • sharedAuthority — required, non-empty one-line reason when credentials is "shared". Shared MCP servers hand every permitted user's agent the admin's credential for that service; the settings section displays this reason and warning beside the server.
  • users — optional string allowlist for a shared server. Only those users may call its tools. A non-empty list is valid only with credentials: "shared"; an empty list means unset (all users) on any server. To deny everyone, set enabled: false. Ownerless calls fail closed.
  • availability — "all" (default) or "opt-in". The per-user settings section stores each server's enablement as a flat boolean keyed by its bare server name. "all" starts enabled; "opt-in" starts disabled.
  • enabled (default true) — skip the server entirely when false. The legacy disabled alias folds into enabled on import/read; a server that spells out both contradictorily is a config error and fails loudly.
  • timeout — per-request wire timeout in seconds (default 60). A request that gets no reply by its deadline rejects. A server that keeps sending notifications/progress for a pending request never dies at the deadline while it keeps reporting work — progress resets the deadline.
  • exposure — how the server's tools register (see below). Default "codemode".
  • toolExposure — per-tool overrides of exposure: an object mapping tool names (exact) or *-globs (e.g. "get-*") to exposure words. An exact name always wins; among matching patterns the FIRST one in config order wins.
  • oauth (stdio) — the authorization-code (PKCE) flow block. Shared servers use sigrun-ext-mcp oauth <server> and the file token store. Per-user servers use POST /v1/ext/sigrun-mcp/oauth/<server>/start, then POST /v1/ext/sigrun-mcp/oauth/<server>/complete with { "redirectedUrl": "<full redirected URL>" }; the CLI refuses these servers so their credentials cannot enter the shared store.

Per-user PKCE state stays in memory for ten minutes and is scoped to the authenticated user and server. Completion stores only the raw access token in that user's token:<server> secret. It then retires and reconnects that user's catalog connection. Core owns the process lifecycle: releasing the last handle arms idle-stop, so a still-live child keeps its original environment until that timer fires or it crashes; the extension cannot force a relaunch through the host contract. An already idle-stopped server launches fresh on the next activation and reads the new token immediately.

userServers is the separate admin policy for user-supplied servers: "none" (default), "remote", or "all". It is distinct from the admin catalog's credentials and availability fields above. Catalog names starting u_ are reserved for those user-supplied servers and rejected.

When enabled, the Your MCP servers part of the extension's settings page accepts a JSON object under the servers key (the declared per-user schema). Entries use the same validation rules as the operator registry; a user server name may not start with u_. Its tools publish only to that user as u_<server>/<tool>. "remote" permits URL servers and ignores stdio; "all" permits URL servers too. A live policy change reconciles every active user, retiring disallowed connections and removing their tools without a restart: lifecycle events re-read the policy from settings. A catalog server literally named servers is rejected because it would shadow this settings namespace.

Named limitation — all and user-supplied stdio: sigrun declares per-user services statically at load and passes no server name to UserService.start. Consequently a dynamic, named user-supplied stdio service cannot be launched. Under "all", such an entry is reported as a configuration error naming the server; its command is never spawned in sigrun's process, and no tools are published. "all" does not make user-supplied stdio functional.

Exposure: how tools reach callers

On pi-durable 1.2.0 semantics, "exposure" decides who can call a server's tools:

| exposure | registration | who can call | | ----------- | ------------------------- | ------------------------------------- | | codemode | callers: ["tools"] | scripts only (never model-offered) | | deferred | deferred: true | the model, once tool_search loads it | | direct | normal | the model (offered when in the set) | | hidden | not registered | nobody (config entry kept) |

The codemode-deferred word is kept as an alias for codemode (pi compat).

The default flip — a breaking change

Before 1.2.0, an mcp.json server entry with no exposure field had its tools offered to the model. Now the default is "codemode": a default-exposure server's tools are callable by scripts (codemode), never offered to the model directly. To restore the old behavior, set the server (or the tool, via toolExposure) to "exposure": "direct":

{ "exposure": "direct" }

The mcp_servers system-prompt section lists codemode/deferred servers when their discovery tool (codemode, tool_search) is offered in the request; when such servers exist but their tools are unreachable, it appends one notice line naming the count and the Settings → default tools fix.

Tool naming: <server>/<tool> (decision)

Tools keep the existing <server>/<tool> shape rather than upstream pi's mcp__<server>__<tool>:

  • The upstream codemode section groups tools by CodemodeNamespace.prefix (longest match wins), and the namespaces are config-side — the host passes the groups, so any naming can namespace trivially: ours groups as prefix: "<server>/" with no rename at all.
  • The name-addressed surface makes per-tool replacement and toolExposure patterns readable ("github/*"), and the existing wire name is already deployed in configs and scripts.

No section-rendering compat requires the upstream spelling; the decision is recorded here per the spec's open item.

Replacement semantics

Replacement works by not installing ours and installing yours: the name-addressed tool surface (<server>/<tool>) makes per-name replacement trivial. Co-installing this package with another that registers the same tool names shadows silently (pi-durable resolves cross-extension duplicates last-selected-wins) — do not co-install. Sigrun's extension loader (made the shadowing visible at boot: it console.warns once per duplicate tool name, naming the extensions and the last-wins resolution) but the warning changes nothing: last-wins stands. Replace, don't co-install.