Skip to main content
Glama
mgcrea

@mgcrea/mcp-npm

by mgcrea

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
NPM_OTPNoA one-time password code. Almost always wrong — see note in .env.example.
NPM_DEBUGNoSet to '1' to log to stderr.
NPM_TOKENNoOverrides the ~/.npmrc lookup. Needed in Docker and CI.
NPM_OTP_MODENoOne of 'web' (default), 'static', or 'none'. See Two-factor section.web
NPM_REGISTRYNoDefaults to https://registry.npmjs.org. The .npmrc token is looked up for this host.https://registry.npmjs.org
NPM_MCP_CONFIGNoPath to a JSON config file. If not set, defaults to $XDG_CONFIG_HOME/npm-mcp/config.json or ~/.config/npm-mcp/config.json.
NPM_MAX_RETRIESNoRetry budget for 429/5xx. Defaults to 3.3
NPM_ALLOW_WRITESNoSet to '1' to register the write tools. Off by default.
NPM_OTP_MAX_USESNoCalls one code covers. Defaults to 80, npm's own guidance.80
NPM_DOWNLOADS_URLNoDefaults to https://api.npmjs.org. A different host, never authenticated.https://api.npmjs.org
NPM_OTP_TTL_SECONDSNoHow long a confirmed code is reused. Defaults to 300, npm's own window.300
NPM_AUTO_OPEN_BROWSERNoSet to '0' to print the URL instead of launching a browser.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
npm_auth_statusA

Report what this server can and cannot do: whether a token is configured and where it came from, which npm account it belongs to, whether two-factor authentication is on, whether writes are enabled, and whether a one-time password is currently cached. Call this first when a tool you expected is missing — an absent tool means missing configuration rather than a bug. trusted_publishing_available is true, false, or "unknown" when a probe npm refused left the answer undetermined — read blockers and undetermined for which. It is an ACCOUNT-level answer: npm also refuses the trust endpoints per package, which this cannot see, so a true here is not a promise that any particular package will work.

npm_auth_reloadA

Re-read the npm token from ~/.npmrc, NPM_TOKEN and the config file, and report whether it changed. Use this after npm login in a terminal: this server captures the token when it starts, so a login that visibly worked leaves it sending the OLD credential and failing 401 on everything while npm whoami in your shell succeeds. Cheap and safe — it reads three files, sends nothing to npm, and never reports the token itself. It re-reads ONLY the token: the registry, the write gate and the OTP settings stay as they were at startup, so a reload can never quietly widen what this server may do. One limit worth knowing: if the server started with NO token at all, the credentialled tools were never registered, and a reload cannot add them — that case still needs a restart.

npm_audit_dependenciesA

Check a set of package versions against npm's security advisories — the same data npm audit uses, queried directly. Takes a flat map of package name to the versions you have installed, and returns only the packages with advisories against them. Needs no npm token, so it works on an otherwise unconfigured server. The references field is stripped from each advisory: it is about 1.5 KB of markdown links apiece, and url already points at the write-up.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.7/5.0

Scored across 3 tools

Disambiguation5/5

The three tools occupy distinct roles: auth status inspection, auth token reload, and dependency audit. There is no meaningful overlap, and the repeated auth prefix only groups related functions.

Naming Consistency5/5

All tools use a consistent npm_ prefix and snake_case: npm_auth_status, npm_auth_reload, npm_audit_dependencies. The pattern is predictable and signals the domain and action clearly.

Tool Count5/5

Three tools is on the lower end but well-scoped for an npm auth/audit helper server; each tool covers a distinct need and none is redundant. The count is within the typical 3-15 range.

Completeness4/5

For the apparent domain of npm authentication and dependency auditing, the set is largely complete: it can inspect auth state, reload credentials, and query advisories. The main gap is the absence of any npm registry/package operations, though the auth-focused intent makes that a minor rather than critical omission.

Maintenance

ActivityMaintained
ResponsivenessNo issues