npm Registry MCP Server

io.github.YawLabs由 GitHub 账号 YawLabs 发布v0.17.1更新于 Oct 31, 2026

npm registry MCP server — package intelligence, security audits, dependency analysis

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

npm 注册表 MCP 服务器,让助手搜索软件包、审计依赖、检查许可证与下载量,并执行 deprecate、dist-tag 等 npm 写操作。

可以做什么
  • 搜索并读取软件包元数据、版本、README、dist-tag 与 TypeScript 类型支持
  • 查看依赖列表、解析传递依赖树并检查许可证
  • 查询下载量、注册表整体统计与最近发布记录
  • 审计漏洞、对比软件包,并评估维护健康度、来源证明与可信发布者
  • 管理认证信息、组织、团队、协作者与软件包访问设置
  • 执行 deprecate、dist-tag、owner、访问权限、团队、组织、令牌与 webhook 等写操作
适用场景
适合在采用某个 npm 软件包前做调研、对一组依赖做漏洞审计,或完成弃用版本、切换 dist-tag 等注册表维护工作,同时避免本地 CLI 的 2FA 交互提示。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 20.11 或更高版本。只读工具无需凭据。写操作、认证、组织、访问权限与 webhook 工具需要在 NPM_TOKEN 环境变量中提供 npm 访问令牌,建议使用细粒度访问令牌。可选变量可设置备用注册表、请求超时、重试退避与调试日志。需要能访问 npm 注册表的网络。
安装前请注意
NPM_TOKEN 授予注册表写权限:该令牌可弃用软件包、修改 dist-tag、变更所有者与访问权限、管理团队和组织、吊销令牌或取消发布软件包。取消发布在 72 小时内不可撤销,且需 confirm: true。部分所有者、访问权限、团队、组织与令牌变更仍需交互式 2FA 验证,由代理执行会失败。请尽量缩小令牌范围,非必要不使用写操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 npm Registry MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@yawlabs/npmjs-mcp

[Add to Yaw MCP]

One click adds this to your local Yaw MCP config so it's available in every Yaw Terminal session. Or install manually below.

[npm version] [License: MIT] [GitHub stars]

Run npm registry operations from Claude Code, Cursor, and any MCP client. 64 tools covering the full registry surface: package intelligence, security audits, dependency analysis, org/team management, and the write ops that normally fight you locally (npm deprecate, npm dist-tag, npm owner, npm unpublish).

Built and maintained by Yaw Labs.

Why this one?

Other npm MCP servers wrap npm search and call it done. This one doesn't.

  • Full registry HTTP surface — 64 tools across reads, writes, orgs, teams, hooks, provenance, trusted publishers, and ops health. Not just npm view.
  • Write ops that actually work in agents — npm_deprecate, npm_undeprecate, npm_dist_tag_set, npm_unpublish_version go directly to the HTTP API with a Granular Access Token that has 2FA bypass. No 2FA prompts, no --otp hunts, no ENEEDAUTH from a session-bound .npmrc. (Since 2026-07-31 npm requires an interactive 2FA challenge for owner, access, team membership and grant, org membership and token changes even with 2FA bypass; for those tools the error names the exact npm command a human runs.)
  • Agent-aware failure surfacing — npm_check_auth and npm_publish_preflight detect a non-interactive context and hand back a human-runnable command, and every write error names what was sent and the npm CLI equivalent, instead of looping on unrecoverable errors.
  • Safety by default — npm_unpublish_* requires confirm: true. npm_owner_remove blocks you from locking yourself out. npm_deprecate rejects a message over the registry's 1024-character limit before sending it.
  • Ops playbook built in — npm_ops_playbook returns the canonical tool-vs-CLI-vs-CI decision matrix so your agent picks the right path on the first try.
  • Tool annotations — every tool declares readOnlyHint, destructiveHint, idempotentHint, and openWorldHint, so MCP clients can skip confirmation on safe ops.
  • No API key required for reads — search, packages, downloads, security, dep tree, licenses all work anonymously. Auth is opt-in via NPM_TOKEN.
  • Instant startup — ships as a single bundled file with zero runtime dependencies. No 5-minute node_modules install.
  • Input hardening — package names, scopes, versions, dist-tags, and team names are all regex-validated against npm's actual constraints. Defends against CRLF and path-traversal in URL construction.

Quick start

1. Create .mcp.json in your project root

macOS / Linux / WSL:

json
{  "mcpServers": {    "npm": {      "command": "npx",      "args": ["-y", "@yawlabs/npmjs-mcp@latest"]    }  }}

Windows:

json
{  "mcpServers": {    "npm": {      "command": "cmd",      "args": ["/c", "npx", "-y", "@yawlabs/npmjs-mcp@latest"]    }  }}

Why the extra step on Windows? Since Node 20, child_process.spawn cannot directly execute .cmd files (that's what npx is on Windows). Wrapping with cmd /c is the standard workaround.

2. Restart and approve

Restart Claude Code (or your MCP client) and approve the npm MCP server when prompted.

3. (Optional) Add your npm token for write operations

Read-only tools work without any setup. For write tools (deprecate, dist-tag, owner, team_*, org_member_*, unpublish, hook_*, access_set*, token_revoke), add NPM_TOKEN to the env block:

json
{  "mcpServers": {    "npm": {      "command": "npx",      "args": ["-y", "@yawlabs/npmjs-mcp@latest"],      "env": {        "NPM_TOKEN": "npm_xxxxxxxxxxxx"      }    }  }}

Use a Granular Access Token scoped to just the packages and orgs you want your agent to manage.

That's it. Now ask your AI assistant:

"Deprecate my-old-pkg 1.x with a pointer to v2"

"What's the dep tree for fastify look like three levels deep?"

"Audit express for known CVEs and tell me the fix"

"Who are the maintainers of next.js and when did each one last publish?"

Configuration

Environment variableDefaultDescription
NPM_TOKEN(none)npm access token. Required only for write/auth/org/access/hooks tools. Use a Granular Access Token (with 2FA bypass for headless writes); classic tokens, including Automation tokens, were revoked in December 2025.
NPM_REGISTRYhttps://registry.npmjs.orgAlternate registry (enterprise/private). Must support the npm HTTP API shape.
NPM_REQUEST_TIMEOUT_MS30000Timeout for each attempt of a registry request, in milliseconds, including reading the body. A read retries a timeout, a network error, or HTTP 429/502/503/504, up to 3 attempts in all, so a stalled read can take about three times this value. A write is never re-sent after a timeout or network error, because the registry may already have applied it; it retries only on 429/503. A value that is not a positive, finite number (Infinity included) falls back to the default, so the timeout cannot be turned off.
NPM_RETRY_BACKOFF_MS500Base wait before a retry, doubled each time: 500 ms, then 1000 ms by default. When the retried response carries a Retry-After header, that wait (capped at 30 s) is used instead, whatever this is set to. 0, an empty value, or whitespace removes the backoff wait. Any other negative or non-numeric value falls back to the default.
DEBUG(none)Logs one line per attempt of every npm API call to stderr, prefixed [npmjs-mcp]: method, URL, then the status and milliseconds to response headers, or the wait before a retry and the attempt number, or the network error. The token is never logged. Enabled only by the exact values npmjs-mcp or *; anything else, such as 1 or npmjs-mcp:*, is ignored. A DEBUG=* set for another tool turns it on too.
NPMJS_MCP_RUNTIMEautoauto: serve on the oam the launcher is already running under if that is 0.19.1 or newer; otherwise run on the newest oam binary it can find at 0.19.1 or newer (see OAM_BIN); otherwise on Node. An oam host older than 0.19.1 never serves the server itself — it hands off to the newest usable oam, or to Node on PATH, or exits with an error when there is neither. An unusable OAM_BIN is always named on stderr; the other oam binaries found are named, with the reason, only when none of them is usable — an older copy losing to a newer one says nothing. oam: the same, but exit with an error instead of falling back to Node. node: always Node — in-process under npx, and handed off to Node on PATH when a client launches the command with oam run. Case-insensitive, and surrounding whitespace is ignored; any other value behaves like auto.
NPMJS_MCP_SANDBOX(none)1 or true (any case, surrounding whitespace ignored) runs the server in a freshly spawned oam (0.19.1+) under --permission, granting only the npm registry hosts (plus NPM_REGISTRY's host) and the variables the server reads; filesystem and subprocess access stay denied. Forces a spawn even when already running on oam. Under auto, when no usable oam is found, or the one found fails to launch, the server runs without the sandbox and says so on stderr; pair it with NPMJS_MCP_RUNTIME=oam to make that fatal. Ignored under NPMJS_MCP_RUNTIME=node. Any other non-empty value leaves the sandbox off and says so on stderr.
OAM_BIN(none)Path to an oam binary to use in preference to discovery, when it is 0.19.1 or newer. If it does not exist, is older, or will not run, the launcher says so on stderr and carries on with discovery. Discovery looks in OAM_INSTALL_DIR when it is set, then the installed location (%LOCALAPPDATA%\oam\bin then ~/.oam/bin on Windows, ~/.oam/bin elsewhere), then on PATH, asks every oam it finds for its version, and uses the newest; on a tie the earlier location wins. On Windows only oam.exe counts; an oam.cmd / oam.bat shim is never run, and is named on stderr when no usable oam is found. Ignored under NPMJS_MCP_RUNTIME=node, and when already running on oam 0.19.1+ without the sandbox.

Runtime

The server ships a launcher that prefers the oam runtime and falls back to Node. The server itself is a pre-bundled ESM file using only node: builtins, so both paths behave identically — verified against the full MCP surface (handshake, all 64 tools, live registry calls) on each.

oam 0.19.1, the latest release, is the minimum. The launcher asks every oam binary it can find for its version and runs the newest one at or above it, never serves on an older oam, and falls back to Node when there is none (NPMJS_MCP_RUNTIME=oam turns that into a hard error). See Configuration for the details.

Falling back costs nothing: npm has already started Node to run the launcher, so the fallback is an in-process import() — no extra spawn, no extra startup.

oam is faster, but the launcher is not. Measured on windows-arm64, n=12 medians, spawn to first MCP initialize response:

invocationtimevs node
oam run dist/index.js116 ms0.67x
node dist/index.js172 ms1.00x
this launcher (node spawns oam)243 ms1.41x

npm bin entries are Node scripts, so reaching oam through one costs Node's startup plus oam's — more than oam saves. The launcher exists so npx users get oam automatically; it is not the fast path.

If you want oam's speed, point your MCP host straight at it and skip the launcher:

json
{ "mcpServers": { "npmjs": { "command": "oam", "args": ["run", "/abs/path/to/dist/index.js"] } } }

Benchmarking note: measure an installed oam (~/.oam/bin), never one out of a cargo target/ directory — a concurrent cargo build replaces the binary mid-run, and fresh bytes are cold where the node.exe you are comparing against is warm. oam is pre-alpha; re-measure on your own hardware.

oam's --permission sandbox is opt-in. Set NPMJS_MCP_SANDBOX=1 and the launcher spawns the server on oam (0.19.1 or newer) with:

  • network granted to registry.npmjs.org:443, api.npmjs.org:443 and replicate.npmjs.com:443, plus the host and port of NPM_REGISTRY when it is set (its own port, or 443 / 80 for https / http). oam compares each request as host:port exactly, so every grant is scoped to the one port the server uses;
  • environment granted to exactly the variables the server reads: NPM_TOKEN, NPM_REGISTRY, NPM_REQUEST_TIMEOUT_MS, NPM_RETRY_BACKOFF_MS and DEBUG;
  • filesystem and subprocess access denied outright. The server reads no files at runtime and spawns nothing, so a dependency that suddenly wants either is stopped by the runtime instead of trusted — which matters for a process holding an NPM_TOKEN.

Under the default NPMJS_MCP_RUNTIME=auto, if no usable oam is found, or the one chosen fails to start, the server runs without the sandbox and says so on stderr. Set NPMJS_MCP_RUNTIME=oam as well to make that an error.

It is not the default because an incomplete grant fails silently rather than loudly. Measured on oam 0.9.0 with only registry.npmjs.org granted, npm_health still returned HTTP 200, with weeklyDownloads: null and no error: the download counts come from api.npmjs.org. A missing variable is worse. oam removes a non-granted variable from process.env instead of throwing, so a denied NPM_TOKEN looks like no token at all, "unauthenticated" rather than "denied".

Alternate MCP clients:

ClientConfig file
Claude Code.mcp.json (project root) or ~/.claude.json (global)
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
Cursor~/.cursor/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json
VS Code.vscode/mcp.json

Use the same JSON block shown above in any of these.

Tools (64)

Search (1)

  • npm_search — Search the npm registry with qualifiers (keywords, author, scope).

Packages (6)

  • npm_package — Metadata: description, dist-tags, maintainers, license, repository.
  • npm_version — Detailed metadata for a specific version.
  • npm_versions — All published versions with dates.
  • npm_readme — README content.
  • npm_dist_tags — Dist-tags (latest, next, beta, etc).
  • npm_types — TypeScript type support (built-in types or @types/*).

Dependencies (3)

  • npm_dependencies — Dependency lists (prod, dev, peer, optional).
  • npm_dep_tree — Transitive dependency tree (configurable depth).
  • npm_license_check — License audit of a package and its direct deps.

Downloads (4)

  • npm_downloads — Total download count for a period.
  • npm_downloads_range — Daily download breakdown.
  • npm_downloads_bulk — Compare downloads for up to 128 packages.
  • npm_version_downloads — Per-version download counts.

Security (3)

  • npm_audit — Check packages for known vulnerabilities.
  • npm_audit_deep — Full audit with CVSS scores, CWEs, fix recommendations.
  • npm_signing_keys — Registry ECDSA signing keys.

Analysis (4)

  • npm_compare — Compare 2–5 packages side-by-side.
  • npm_health — Maintenance, downloads, security, deprecation summary.
  • npm_maintainers — Maintainers and publish history.
  • npm_release_frequency — Release cadence and gaps.

Registry (3)

  • npm_registry_stats — Total npm-wide download counts.
  • npm_recent_changes — Recent publishes from the CouchDB changes feed.
  • npm_ops_playbook — Canonical recipes for npm operations. Call this first when unsure which tool to use.

Provenance & trust (2)

  • npm_provenance — Sigstore attestations (SLSA, publish).
  • npm_trusted_publishers — OIDC trust relationships with CI/CD providers.

Auth (5, requires NPM_TOKEN)

  • npm_whoami — Authenticated user.
  • npm_profile — Profile, email, 2FA status.
  • npm_tokens — List access tokens.
  • npm_verify_token — One-call capability check. Call this first when debugging write failures.
  • npm_user_packages — Packages published by a user.

Access & orgs (7, requires NPM_TOKEN)

  • npm_collaborators — Package collaborators and permissions.
  • npm_package_access — Package access settings.
  • npm_org_members — Org members and roles.
  • npm_org_packages — Org packages.
  • npm_org_teams — Org teams.
  • npm_team_packages — Team package permissions.
  • npm_team_members — Team members and roles.

Workflows (2)

  • npm_check_auth — Auth health check with headless publish feasibility.
  • npm_publish_preflight — Pre-publish validation checklist.

Write operations (19, requires NPM_TOKEN with write scope)

These bypass the CLI/2FA friction that makes npm deprecate and friends fail locally. All use the HTTP API with your NPM_TOKEN.

  • npm_deprecate — Deprecate a package or specific versions (enforces the registry's 1024-char message limit; message punctuation is not constrained).
  • npm_undeprecate — Clear deprecation.
  • npm_unpublish_version — Unpublish a version. Requires confirm: true.
  • npm_unpublish_package — Unpublish an entire package. Requires confirm: true.
  • npm_dist_tag_set — Point a dist-tag at a version.
  • npm_dist_tag_remove — Remove a dist-tag (refuses latest).
  • npm_owner_add — Add a maintainer (resolves user via /-/user/).
  • npm_owner_remove — Remove a maintainer (prevents self-lockout).
  • npm_access_set — Set public/private/restricted access.
  • npm_access_set_mfa — Configure 2FA requirement (none/publish/automation).
  • npm_team_grant / npm_team_revoke — Grant/revoke team permissions on a package.
  • npm_team_create / npm_team_delete — Create/delete a team in an org.
  • npm_team_member_add / npm_team_member_remove — Manage team members.
  • npm_org_member_set / npm_org_member_remove — Manage org membership and roles.
  • npm_token_revoke — Revoke an access token by key.

Webhooks (5, requires NPM_TOKEN)

  • npm_hook_add — Register a webhook on a package, scope, or user.
  • npm_hook_list — List webhooks (optional package filter).
  • npm_hook_get — Fetch a single webhook.
  • npm_hook_update — Update endpoint/secret.
  • npm_hook_remove — Delete a webhook.

Operation decision matrix

OperationPreferred pathWhy
Read (search/view/stats)These MCP tools, no authFast, zero friction
Deprecate / dist-tag / unpublishnpm_deprecate, npm_dist_tag_*, etc.HTTP API, no CLI 2FA friction with a 2FA-bypass token
Owner / access / team / org / token changesnpm_owner_*, npm_access_set*, npm_team_*, npm_org_member_*, npm_token_revokeSince 2026-07-31 these need an interactive 2FA challenge; on 401/403 the error names the npm command a human runs
Publishbash release.sh X.Y.Z from the workstationThis repo has no CI release workflow (removed in b2c256c). Note: workstation publishes carry no sigstore provenance — --provenance needs CI OIDC.
Unpublishnpm_unpublish_version (with confirm: true)Safer than CLI; irreversible within 72h
CLI fallbackThe npm command named in the error, run by a human who can answer the one-time-password promptOn a 401/403 from a change that needs interactive 2FA, or a 422 whose message names it

Call npm_ops_playbook at the start of any session to get the up-to-date matrix.

Examples

Audit a dependency

> "What vulnerabilities does lodash 4.17.20 have and what's the fix?"→ npm_audit_deep({    name: "my-project",              // the PROJECT being audited, not the dependency    version: "1.0.0",    dependencies: { lodash: "4.17.20" }   // required — the set to audit  })

For a quick check across several packages at once, npm_audit takes the name-to-versions map directly: npm_audit({ packages: { lodash: ["4.17.20"] } }).

Deprecate a package

> "Deprecate @myorg/legacy-sdk with a pointer to @myorg/sdk"→ npm_deprecate({ name: "@myorg/legacy-sdk", message: "Renamed to @myorg/sdk — install that instead" })

Compare package health

> "Compare fastify vs express vs koa for maintenance health"→ npm_compare({ packages: ["fastify", "express", "koa"] })→ npm_health({ name: "fastify" }) // ...etc

Rotate a dist-tag

> "Point @myorg/pkg@latest at 3.2.1"→ npm_dist_tag_set({ name: "@myorg/pkg", tag: "latest", version: "3.2.1" })

Debug a write failure

> "My deprecate keeps returning 401 — what's wrong?"→ npm_verify_token()  // Confirms token scope, packages, 2FA state→ npm_ops_playbook()  // Returns the canonical retry sequence

Troubleshooting

"Error: NPM_TOKEN is required"

  • The tool you called needs auth. Add NPM_TOKEN to the env block of your MCP config and restart the client.
  • Prefer a Granular Access Token scoped to just the packages and orgs you want touched.

"HTTP 401 Unauthorized" or "HTTP 403 Forbidden"

  • Your token lacks scope on the target package. Call npm_verify_token — it reports which packages and orgs the token can actually write.
  • An OTP challenge arrives as a 401 and a 2FA-policy refusal as a 403; neither is ever a 422. For deprecate, undeprecate, dist-tag and unpublish, a Granular Access Token with 2FA bypass enabled fixes both. Classic tokens, including Automation tokens, were revoked in December 2025.
  • Owner, access, team membership and grant, org membership and token changes need an interactive 2FA challenge since 2026-07-31, even from a token with 2FA bypass. No token fixes those: the error names the exact npm command for a human to run and answer the one-time-password prompt.

"HTTP 422 Unprocessable" on a write

  • Read the Raw: body at the end first; it is the registry's actual reason. Before it, the message says what that call sent and the documented npm rules it could have broken, then (where one exists) the npm CLI equivalent, which prints the registry's full error and prompts for a one-time password if needed.
  • For npm_deprecate, a versionRange that matches no published version and a message over 1024 characters are both rejected locally as HTTP 400 before any write, so neither is a 422 cause. The range error lists the published versions; correct the range from that list or with npm_versions.
  • Message punctuation is not a cause. Swapping a trailing period for an em-dash will not clear a 422.

Windows: MCP server doesn't start

  • Use the cmd /c npx ... pattern from the Quick start section. Node 20+ can't spawn .cmd files directly.

Requirements

  • Node.js 20.11+ (package.json declares engines.node: ">=20.11.0")
  • (Optional) npm access token for write operations

Contributing

bash
git clone https://github.com/YawLabs/npmjs-mcp.gitcd npmjs-mcpnpm installnpm run lint       # Biome checknpm run lint:fix   # Auto-fixnpm run build      # tsc + esbuild bundlenpm test           # node --test

See CONTRIBUTING.md for the full workflow, including release process.

License

MIT

[Follow @YawLabs on X]

来源:README.md,提交 af4458f

工具

64

npm_package

Get package info

Get package metadata — description, dist-tags, latest version, maintainers, license, repository, keywords. Does not include per-version details (use npm_version for that).

输入参数name必填

npm_version

Get version details

Get detailed metadata for a specific version — dependencies, dist info, file count, size, deprecation status.

输入参数name必填version

npm_versions

List versions

List published versions of a package with their publish dates, ordered newest first. Returns up to `limit` versions (default 50). Set limit=0 to return all.

输入参数name必填limit

npm_readme

Get package README

Get the README content of a package.

输入参数name必填

npm_dist_tags

Get dist-tags

Get dist-tags for a package (latest, next, beta, etc).

输入参数name必填

npm_types

Check TypeScript types

Check TypeScript type support for a package — whether it ships built-in types (types/typings field) or has a DefinitelyTyped companion (@types/* package).

输入参数name必填version

npm_dependencies

Get dependencies

Get the dependency lists for a specific package version — production deps, devDeps, peerDeps, and optionalDeps.

输入参数name必填version

npm_dep_tree

Resolve dependency tree

Resolve the production dependency tree for a package version (up to a configurable depth). Shows the full transitive dependency graph with versions. Issues one registry request per discovered package (10 in flight), so a wide tree at depth 4-5 can take a while; the walk is capped at 60s and returns `truncated: true` with a warning if it runs out of budget.

输入参数name必填depthversion

npm_license_check

Check licenses

Check the license of a package and its direct production dependencies. Flags missing or non-standard licenses. Matches single SPDX license identifiers case-insensitively (so 'mit' and 'MIT' both match). SPDX expressions like '(MIT OR Apache-2.0)' are NOT decomposed — they are flagged unless added to `allowed` verbatim. Issues 2 requests per direct dependency (10 in flight), capped at 60s; deps not reached in time come back as `NOT_CHECKED` (and are flagged, never treated as allowed).

输入参数name必填allowedversion

npm_downloads

Get download count

Get total download count for a package over a period (last-day, last-week, last-month, last-year, or a custom date range like 2025-01-01:2025-12-31).

输入参数name必填period

npm_downloads_range

Get daily downloads

Get daily download counts for a package over a period. Returns per-day breakdown.

输入参数name必填period

npm_downloads_bulk

Bulk download comparison

Compare download counts for multiple packages over a period. Up to 128 packages. Scoped packages (@scope/name) are NOT supported by the bulk endpoint — call npm_downloads separately for each scoped package.

输入参数periodpackages必填

npm_version_downloads

Per-version downloads

Get download counts broken down by version for the last week. Shows version adoption.

输入参数name必填period

npm_audit

Audit packages

Quick vulnerability check for specific packages and versions using the bulk advisory API. Returns matching advisories with severity, CVEs, and patched versions. For richer detail (CVSS scores, CWEs, fix recommendations), use npm_audit_deep instead.

输入参数packages必填

npm_audit_deep

Deep security audit

Full security audit on a dependency set — returns detailed advisories with CVSS scores, CWEs, affected version ranges, fix recommendations, and full vulnerability metadata. Uses the npm audit v1 endpoint which provides richer detail than the bulk advisory API (npm_audit). Requires you to provide the dependency map (use npm_dependencies to get it first).

输入参数name必填versiondependencies必填

npm_signing_keys

Get signing keys

Get the npm registry's ECDSA signing keys used to verify package signatures.

无需输入参数。

npm_compare

Compare packages

Compare 2-5 packages side-by-side — downloads, version, license, maintainers, size, last publish, and security status. Great for 'should I use X or Y?' decisions.

输入参数packages必填

npm_health

Package health check

Assess the health of a package — maintenance activity, download trend, security status, deprecation, and documentation quality.

输入参数name必填

npm_maintainers

Package maintainers

Get current maintainers and their publish history for a package.

输入参数name必填

npm_release_frequency

Release frequency

Analyze the release cadence of a package — publish timeline, gaps, and whether the project is actively maintained.

输入参数name必填limit

npm_registry_stats

Registry download stats

Get total npm-wide download counts for a period. Shows overall registry activity.

输入参数period

npm_recent_changes

Recent registry changes

Get the most recent package publishes/updates from the npm registry via the CouchDB changes feed. Note: uses replicate.npmjs.com which may have intermittent availability.

输入参数limit

npm_ops_playbook

npm operations playbook

Return canonical recipes for common npm operations — which MCP tool to call for which op, CLI fallbacks when the MCP server can't handle something, and message format guidance. Call this FIRST when you're not sure how to do an npm operation. Prevents reinventing approaches that don't work.

无需输入参数。

npm_whoami

Check npm auth

Check the currently authenticated npm user. Verifies the NPM_TOKEN is valid and returns the associated username. Essential for debugging auth issues before publishing.

无需输入参数。

npm_profile

Get npm profile

Get the authenticated user's npm profile — name, email, 2FA status, creation date. Useful for checking whether 2FA is enabled (which affects token requirements for publishing).

无需输入参数。

npm_tokens

List npm tokens

List all access tokens for the authenticated npm user. Shows token type, creation date, CIDR restrictions, and read-only status. Critical for finding reusable automation/granular tokens that cover your org scope — avoids the common mistake of creating duplicate tokens or using publish tokens in CI (which still require OTP).

输入参数pageperPage

npm_verify_token

Verify token capabilities

Verify the NPM_TOKEN and surface its capabilities — username, 2FA status, and whether writes are likely to succeed. Call this FIRST when debugging any write failure to rule out auth issues before trying other fixes. Faster than running writes and interpreting 401/403 errors.

无需输入参数。

npm_user_packages

List user packages

List all packages published by a specific npm user. Shows package names and the user's access level for each. Requires authentication.

输入参数username必填

npm_org_members

List org members

List all members of an npm organization with their roles (owner, admin, developer). Requires authentication as an org member.

输入参数org必填

npm_org_packages

List org packages

List all packages accessible to an npm organization with their access levels. Shows what the org owns or has been granted access to.

输入参数org必填

npm_org_teams

List org teams

List all teams within an npm organization. Requires authentication as an org member.

输入参数org必填

npm_team_packages

List team packages

List all packages a specific team has access to and their permission levels (read-only or read-write). Useful for auditing team permissions.

输入参数org必填team必填

npm_team_members

List team members

List all members of a team with their roles (e.g. 'developer'). Complements npm_team_member_add and npm_team_member_remove — use this to audit who is currently on the team before adding or removing members.

输入参数org必填team必填

npm_collaborators

Package collaborators

Get all users who have access to a package and their permission levels (read-only, read-write). Useful for verifying who can publish to a package before setting up CI/CD.

输入参数name必填

npm_package_access

Package access settings

Get package access settings — visibility (public/private), whether publish requires 2FA, and whether automation tokens can bypass 2FA. Critical for understanding why CI publishing fails: if publish_requires_tfa is true but automation_token_overrides_tfa is false, automation tokens cannot publish.

输入参数name必填

npm_provenance

Package provenance

Retrieve Sigstore attestations for a specific package version. Shows SLSA provenance (which CI built it, from which repo/commit) and publish attestations. NOTE: this tool RETRIEVES attestations from the registry -- it does NOT perform cryptographic signature, certificate-chain, or Rekor transparency-log verification. Use a dedicated Sigstore client to cryptographically verify the bundles.

输入参数name必填version必填

npm_trusted_publishers

List trusted publishers

List trusted publishing configurations for a package. Shows OIDC trust relationships with CI/CD providers (GitHub Actions, GitLab CI, CircleCI) that allow tokenless publishing. Requires authentication with write access to the package.

输入参数name必填

npm_check_auth

Check npm auth health

Quick auth health check — returns structured data about npm auth status, token capability, and whether headless (CI/agent) publishing is possible. Run this BEFORE attempting any publish operation. Returns canPublishHeadless boolean and a clear recommendation. MCP servers are called by AI agents which CANNOT open browsers or enter OTP codes. This tool detects that and provides the exact terminal command for the human to run instead of suggesting unworkable retries.

无需输入参数。

npm_publish_preflight

Publish preflight check

Comprehensive pre-publish validation — run before publishing ANY npm package. Returns an actionable checklist with pass/fail/warn for each item. ASSUMES NON-INTERACTIVE CONTEXT BY DEFAULT because MCP servers are called by AI agents that: - CANNOT open browsers (so --auth-type=web is useless) - CANNOT enter OTP codes - CANNOT retry with 2FA — this is a hand-off to the human Checks: auth token validity, 2FA requirements, token type inference, org-level token reuse, package name availability, maintainer access, scoped package settings. When issues are found, returns structured actions with exact commands for the HUMAN to run in their terminal — never suggests actions an agent cannot perform.

输入参数name必填

npm_deprecate

Deprecate package

Deprecate a package or specific versions. Shows a warning message on install. Uses the HTTP API with NPM_TOKEN, so no CLI login or OTP prompt is involved; a token without 2FA bypass is refused with 401 or 403. Registry hard limit: deprecation messages must be <= 1024 characters. A message over the limit, or a versionRange matching no published version, is rejected locally as HTTP 400 before any write; a 422 from the registry describes the packument that was sent. Message punctuation is never checked.

输入参数name必填message必填versionRange

npm_undeprecate

Undeprecate package

Clear the deprecation message from a package or specific versions. Equivalent to npm_deprecate with an empty message but more explicit about intent.

输入参数name必填versionRange

npm_unpublish_version

Unpublish version

Unpublish a specific version of a package. IRREVERSIBLE: once unpublished, the version cannot be re-published and will be blocked for 72 hours. Only works within 72 hours of the original publish for most packages. Requires explicit confirm: true to prevent accidents. Follows the npm CLI flow (mutate packument + delete tarball). For full-package unpublish use npm_unpublish_package. Dist-tag handling: any dist-tag that pointed at the unpublished version is removed. Only `latest` is auto-reassigned (to the highest remaining stable version). Other tags like `next`/`beta` are left unset — reassign them explicitly with npm_dist_tag_set if needed.

输入参数name必填confirm必填version必填

npm_unpublish_package

Unpublish entire package

Unpublish an ENTIRE package (all versions). DELETE /{pkg}/-rev/{rev}. IRREVERSIBLE: the name is blocked for 72 hours and cannot be re-published. For single-version unpublish prefer npm_unpublish_version. Requires confirm: true.

输入参数name必填confirm必填

npm_dist_tag_set

Set dist-tag

Point a dist-tag (e.g. 'latest', 'beta', 'next') at a specific version. Common uses: promote a beta to latest, roll back latest to a prior version, maintain separate channels.

输入参数tag必填name必填version必填

npm_dist_tag_remove

Remove dist-tag

Remove a dist-tag from a package. The 'latest' tag cannot be removed, only reassigned.

输入参数tag必填name必填

npm_owner_add

Add package owner

Add a user as a maintainer of a package. They will have publish and write permissions. Resolves the user's email via /-/user/ (no need to supply it). Use npm_collaborators to verify before adding.

输入参数name必填username必填

npm_owner_remove

Remove package owner

Remove a user from a package's maintainer list. Refuses if it would leave the package with zero maintainers (lockout prevention).

输入参数name必填username必填

npm_access_set

Set package access level

Set package access level: 'public' or 'restricted' (private). 'private' is accepted as an alias for 'restricted' for ergonomics -- both map to the registry wire value 'restricted'. Unscoped packages are always public. Restricted access requires a paid npm account.

输入参数name必填access必填

npm_access_set_mfa

Set package 2FA publish policy

Configure 2FA requirement for publishing: 'none' (off), 'publish' (2FA required), 'automation' (2FA required but automation tokens can bypass).

输入参数name必填level必填

npm_team_grant

Grant team package permission

Grant a team read-only or read-write permission on a package. Scope and team are passed as @scope:team (e.g. '@yawlabs:devs'). Requires org admin or team admin.

输入参数team必填package必填permissions必填

npm_team_revoke

Revoke team package permission

Revoke a team's access to a package. Team is passed as '@scope:team'. Does not delete the team itself — use npm_team_delete for that.

输入参数team必填package必填

npm_team_create

Create team

Create a team inside an organization. Team is passed as '@scope:team'.

输入参数team必填description

npm_team_delete

Delete team

Delete a team. Team is passed as '@scope:team'. Revokes all package permissions that team held, and team memberships are also removed. Requires confirm: true — this removes the team and all its package grants in one call. List the team's current grants with npm_team_packages first if you need to preserve them.

输入参数team必填confirm必填

npm_team_member_add

Add team member

Add a user to a team. Team is '@scope:team'. User must already be in the org.

输入参数team必填user必填

npm_team_member_remove

Remove team member

Remove a user from a team. Team is '@scope:team'. User remains in the org.

输入参数team必填user必填

npm_org_member_set

Set org member

Add a user to an org or change their role. Roles: 'developer', 'admin', 'owner'. If the user is already in the org, updates the role. Omitting `role` keeps the member's current role: this tool reads the roster first and re-sends the existing role explicitly, because the registry DEFAULTS an omitted role to 'developer' rather than preserving it (which would silently demote an admin or owner). For a user who is not yet a member, omitting `role` adds them as 'developer'.

输入参数org必填roleuser必填confirm必填

npm_org_member_remove

Remove org member

Remove a user from an org. Their team memberships in that org are also removed. Requires confirm: true — team memberships cascade and cannot be selectively preserved.

输入参数org必填user必填confirm必填

npm_token_revoke

Revoke access token

Revoke an access token by its key (UUID from npm_tokens). Requires confirm: true. Revoking the token currently in use by NPM_TOKEN will break the next call. Creating tokens is NOT exposed because the endpoint requires the user password — create via https://www.npmjs.com/settings/~/tokens instead.

输入参数confirm必填tokenKey必填

npm_hook_add

Add webhook

Create a registry webhook. Target is 'pkg' or '@scope/pkg' for a package, '@scope' for a scope, or '~user' for a user's packages. Endpoint is the HTTPS URL to POST events to; secret is used to HMAC-sign payloads. The secret is never echoed back in tool responses.

输入参数secret必填target必填endpoint必填

npm_hook_list

List webhooks

List webhooks. Optionally filter by package name. Secrets are redacted from responses.

输入参数limitoffsetpackage

npm_hook_get

Get webhook

Get a single webhook by its ID. The stored secret is redacted from the response.

输入参数id必填

npm_hook_update

Update webhook

Replace a webhook's endpoint AND signing secret. Both are required: the registry PUT overwrites the hook config, so this call always rotates the secret to whatever you pass — supply the current secret if you only mean to change the endpoint. The returned hook object has the secret redacted.

输入参数id必填secret必填endpoint必填

npm_hook_remove

Remove webhook

Delete a webhook by ID.

输入参数id必填

版本历史

5
  1. v0.17.1最新Oct 31, 2026
  2. v0.17.0Oct 9, 2026
  3. v0.16.5Oct 7, 2026
  4. v0.16.4Sep 30, 2026
  5. v0.16.3Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分