loading…
Search for a command to run...
loading…
Enables npm registry operations from MCP clients like Claude Code and Cursor, with 64 tools for package intelligence, security audits, dependency analysis, org/
Enables npm registry operations from MCP clients like Claude Code and Cursor, with 64 tools for package intelligence, security audits, dependency analysis, org/team management, and write operations like deprecate and unpublish.
npm version License: MIT GitHub stars CI Release
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.
One click adds this to your local Yaw MCP config so it's available in every Yaw Terminal session. Or install manually below.
Other npm MCP servers wrap npm search and call it done. This one doesn't.
npm view.npm_deprecate, npm_dist_tag_set, npm_owner_add, npm_unpublish_version go directly to the HTTP API with your token. No 2FA prompts, no --otp hunts, no ENEEDAUTH from a session-bound .npmrc.npm login --auth-type=web) instead of looping on unrecoverable errors.npm_unpublish_* requires confirm: true. npm_owner_remove blocks you from locking yourself out. npm_deprecate validates the message format (em-dash, no trailing period) that npmjs.com's API actually accepts.npm_ops_playbook returns the canonical tool-vs-CLI-vs-CI decision matrix so your agent picks the right path on the first try.readOnlyHint, destructiveHint, idempotentHint, and openWorldHint, so MCP clients can skip confirmation on safe ops.NPM_TOKEN.node_modules install.1. Create .mcp.json in your project root
macOS / Linux / WSL:
{
"mcpServers": {
"npm": {
"command": "npx",
"args": ["-y", "@yawlabs/npmjs-mcp@latest"]
}
}
}
Windows:
{
"mcpServers": {
"npm": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@yawlabs/npmjs-mcp@latest"]
}
}
}
Why the extra step on Windows? Since Node 20,
child_process.spawncannot directly execute.cmdfiles (that's whatnpxis on Windows). Wrapping withcmd /cis 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:
{
"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?"
| Environment variable | Default | Description |
|---|---|---|
NPM_TOKEN |
(none) | npm access token. Required only for write/auth/org/access/hooks tools. A Granular Access Token is strongly preferred over a Classic Automation token. |
NPM_REGISTRY |
https://registry.npmjs.org |
Alternate registry (enterprise/private). Must support the npm HTTP API shape. |
Alternate MCP clients:
| Client | Config 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.
@types/*).These bypass the CLI/2FA friction that makes npm deprecate and friends fail locally. All use the HTTP API with your NPM_TOKEN.
confirm: true.confirm: true.latest)./-/user/).| Operation | Preferred path | Why |
|---|---|---|
| Read (search/view/stats) | These MCP tools, no auth | Fast, zero friction |
| Deprecate / dist-tag / owner / team / hook | npm_deprecate, npm_dist_tag_*, etc. |
HTTP API, no CLI 2FA friction |
| Publish | CI tag-push workflow | Version discipline, provenance, org token |
| Unpublish | npm_unpublish_version (with confirm: true) |
Safer than CLI; irreversible within 72h |
| CLI fallback (rare) | npm login --auth-type=web then npm <op> |
Only if MCP returns 422 |
Call npm_ops_playbook at the start of any session to get the up-to-date matrix.
> "What vulnerabilities does lodash 4.17.20 have and what's the fix?"
→ npm_audit_deep({ name: "lodash", version: "4.17.20" })
> "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 fastify vs express vs koa for maintenance health"
→ npm_compare({ packages: ["fastify", "express", "koa"] })
→ npm_health({ name: "fastify" }) // ...etc
> "Point @myorg/pkg@latest at 3.2.1"
→ npm_dist_tag_set({ name: "@myorg/pkg", tag: "latest", version: "3.2.1" })
> "My deprecate keeps returning 422 — what's wrong?"
→ npm_verify_token() // Confirms token scope, packages, 2FA state
→ npm_ops_playbook() // Returns the canonical retry sequence
"Error: NPM_TOKEN is required"
NPM_TOKEN to the env block of your MCP config and restart the client."HTTP 401 Unauthorized" or "HTTP 403 Forbidden"
npm_verify_token — it reports which packages and orgs the token can actually write."HTTP 422 Unprocessable" on deprecate
"Renamed to @x/y — install that instead", not "Renamed to @x/y. Install that instead."versions range that doesn't match any published version. Call npm_versions to confirm.Windows: MCP server doesn't start
cmd /c npx ... pattern from the Quick start section. Node 20+ can't spawn .cmd files directly.package.json declares engines.node: ">=20")git clone https://github.com/YawLabs/npmjs-mcp.git
cd npmjs-mcp
npm install
npm run lint # Biome check
npm run lint:fix # Auto-fix
npm run build # tsc + esbuild bundle
npm test # node --test
See CONTRIBUTING.md for the full workflow, including release process.
MIT
Выполни в терминале:
claude mcp add yawlabs-npmjs-mcp -- npx Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development