io.github.mikusnuz/npm

Official registry Developer tools

MCP server for npm package management — publish, version, search, audit, and more

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

NPM package @mikusnuz/npm-mcp
Claude Code
claude mcp add npm -e 'NPM_TOKEN=<your npm_token>' -- npx -y @mikusnuz/npm-mcp@1.4.0
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "npm": {
            "command": "npx",
            "args": [
                "-y",
                "@mikusnuz/npm-mcp@1.4.0"
            ],
            "env": {
                "NPM_TOKEN": "<your npm_token>"
            }
        }
    }
}

Environment variables

  • NPM_TOKEN secret npm granular access token; stage-only tokens use the stage tool

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. npm-mcp
  2. When to Use
  3. Why
  4. Setup
  5. Tools
  6. Examples
  7. Auth
  8. Environment Variables
  9. License

English | 한국어 | 中文 | 日本語

npm-mcp

MCP server that lets AI assistants manage npm packages. Publish, version, search, audit, install, and more -- all through Claude Code or any MCP client.

The MCP server requires Node.js 20 or newer. Individual npm CLI features may require a newer Node.js/npm combination as noted below.

When to Use

TaskTool
"Publish this package to npm"publish
"Check for outdated dependencies"outdated
"Run a security audit on my packages"audit
"Search npm for authentication libraries"search
"Bump the version and publish"version then publish
"Check who owns this npm package"owner
"View download stats for my package"view

For AI agents: See llms.txt for a machine-readable summary. Copy templates/CLAUDE.md or templates/AGENTS.md into your project to teach your agent about this MCP.

Why

You're in Claude Code building a library. You finish the code, and now you need to publish it. Instead of switching to a terminal:

You: publish this package to npm with public access
Claude: [calls publish tool] Published @yourorg/lib@1.0.0 successfully

That's it. No context switching.

Setup

1. Install
git clone https://github.com/mikusnuz/npm-mcp.git
cd npm-mcp
npm install
npm run build
2. Get npm token

Go to npmjs.com > Account > Access Tokens and create a granular access token with access to the packages you need. Classic and Automation tokens are no longer supported. A stage-only token uses the stage workflow below. Existing npm login credentials also work.

3. Add to Claude Code

Edit ~/.claude/settings.json:

{
  "mcpServers": {
    "npm-mcp": {
      "command": "node",
      "args": ["/path/to/npm-mcp/dist/index.js"],
      "env": {
        "NPM_TOKEN": "npm_xxxxxxxxxxxx"
      }
    }
  }
}

Or if you've already run npm login locally, skip NPM_TOKEN -- it uses your ~/.npmrc automatically.

Tools

Publishing & Versioning
ToolDescription
publishPublish a package to npm registry
stageStage, list, inspect, download, approve, or reject a pending package version
versionBump package version (patch/minor/major/pre*)
unpublishRemove a package version
deprecateDeprecate a version (or undeprecate with empty message)
packPreview what would be published
Package Info
ToolDescription
viewView package info from registry
searchSearch npm registry
bugsGet bug tracker URL for a package
repoGet repository URL for a package
docsGet documentation URL for a package
diffShow diff between package versions
Dependency Management
ToolDescription
installInstall packages
pending-scriptsList unreviewed dependency install scripts without changing policy (npm 12+)
approve-scriptsApprove named, reviewed dependencies with version pinning (npm 12+)
deny-scriptsDeny install scripts for named dependencies across versions (npm 12+)
uninstallRemove packages
updateUpdate packages to latest semver-compatible version
outdatedCheck for outdated packages
lsList installed packages
explainExplain why a package is installed
dedupeReduce duplication in dependency tree
pruneRemove extraneous packages
fundShow funding info for dependencies
queryQuery packages using CSS-like selectors
Security & Diagnostics

npm 12 blocks unapproved dependency install scripts. Call pending-scripts with an absolute project path, review the packages, then pass explicit package names to approve-scripts or deny-scripts. These commands update policy without running scripts; rerun the intended install/build separately. There is no bulk approval option. npm pins approvals when a trusted resolved version is available; check its warnings if an older lockfile forces a name-only approval. For global installs only, install.allowScripts accepts an explicit list of reviewed names. Older npm versions do not support these options; select npm 12+ using NPM_PATH. See npm script approval.

ToolDescription
auditRun security audit (with optional auto-fix)
sbomGenerate Software Bill of Materials (CycloneDX/SPDX)
doctorCheck npm environment health
pingCheck registry connectivity
Configuration & Auth
ToolDescription
whoamiCheck current authenticated user
tokenManage access tokens (list/revoke)
accessSet or view access level on packages
ownerManage package owners (ls/add/rm)
dist-tagManage distribution tags (ls/add/rm)
profileView or modify npm profile settings
configView npm configuration (read-only)
Project Setup
ToolDescription
initInitialize a new package.json
pkgManage package.json fields programmatically
ciClean install from lockfile (for CI)
run-scriptRun scripts defined in package.json
linkSymlink a local package for development
cacheManage the npm cache

Examples

Publish a scoped package:

publish({ path: "/home/user/my-lib", access: "public" })

Bump version and publish:

version({ path: "/home/user/my-lib", bump: "patch" })
publish({ path: "/home/user/my-lib" })

Check what's inside before publishing:

pack({ path: "/home/user/my-lib", dryRun: true })

Search for existing packages:

search({ query: "react state management", limit: 5 })

View package details:

view({ package: "@yourorg/lib", field: "versions" })

Install packages:

install({ path: "/home/user/my-app", packages: ["express", "cors"], saveDev: false })

Check outdated dependencies:

outdated({ path: "/home/user/my-app" })

Compare versions:

diff({ specs: ["lodash@4.17.20", "lodash@4.17.21"] })

Generate SBOM:

sbom({ path: "/home/user/my-app", format: "spdx", production: true })

Query dependencies:

query({ path: "/home/user/my-app", selector: ":root > .prod" })

Auth

Staged publishing

Staged publishing requires npm CLI 11.15.0 or later and Node.js 22.14.0 or later. Check npm stage --help; NPM_PATH can select a separate npm installation. See the staged publishing prerequisites.

stage({ action: "publish", path: "/home/user/my-lib", access: "public" })
stage({ action: "list", package: "@yourorg/lib" })
stage({ action: "view", stageId: "returned-stage-id" })
stage({ action: "download", stageId: "returned-stage-id", path: "/home/user/review" })
stage({ action: "approve", stageId: "returned-stage-id", otp: "123456" })
// Or reject the staged version:
stage({ action: "reject", stageId: "returned-stage-id", otp: "123456" })

Staging does not publish the package; approval does. Approval and rejection require maintainer 2FA. dryRun applies only to stage with action: "publish". A direct publish with a stage-only token returns E_STAGE_REQUIRED. npm plans to remove direct publishing with granular tokens in January 2027. See npm staging and token requirements.

pkg accepts JSON values directly: value: "my-package", value: true, value: ["keyword"], or value: { test: "node --test" }. Strings stay strings; do not stringify arrays or objects before passing them.

MethodHow
NPM_TOKEN (recommended)Set NPM_TOKEN env var in MCP config. Get token from npmjs.com > Access Tokens
npm loginRun npm login in terminal first. Token saved in ~/.npmrc is used automatically

Pass otp when npm requires 2FA, including staged approval/rejection and package maintainer or token changes. Since August 2026, bypass-2FA tokens cannot bypass the second factor for account or governance operations. Tokens expire; renew the configured token when needed or refresh local credentials with npm login.

Environment Variables

VariableDefaultDescription
NPM_TOKEN--npm authentication token
NPM_PATHnpmPath to npm binary (if not in PATH)

License

MIT

Frequently asked questions

What is io.github.mikusnuz/npm?

MCP server for npm package management — publish, version, search, audit, and more

How do I install io.github.mikusnuz/npm?

It runs on your machine. In Claude Code: claude mcp add npm -e 'NPM_TOKEN=<your npm_token>' -- npx -y @mikusnuz/npm-mcp@1.4.0. For other clients, paste the JSON configuration from this page into their MCP settings.

Does io.github.mikusnuz/npm need an API key?

Yes. It expects NPM_TOKEN, which you set in its configuration.

Is io.github.mikusnuz/npm open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains io.github.mikusnuz/npm?

It is published by mikusnuz. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.