SuperAPI AI Directory

npm-mcp

npm package management: publish, version, search, audit, install and more.

Open website

About this tool

npm-mcp is an MCP (Model Context Protocol) server used to let AI assistants manage npm packages. It provides 32 tools, covering operations such as publishing, versioning, searching, auditing, and installing, and can be invoked through Claude Code or any MCP client.

Purpose The core purpose of this tool is to eliminate the context cost of switching back and forth between the AI coding environment and the terminal. Once you finish writing the code for a library in Claude Code, you can directly complete operations such as publishing an npm package, version management, and dependency queries through the AI assistant, without manually switching to the terminal to execute commands.

Main Capabilities According to the official description, npm-mcp's capabilities fall into four categories:

  1. Publishing & Versioning: publishing scoped packages, incrementing the version and publishing, checking package contents before publishing, staged publishing, and more.
  2. Dependency Management: installing packages, checking for outdated dependencies, comparing versions, and querying dependency relationships.
  3. Security & Diagnostics: auditing and security-related operations.
  4. Configuration & Auth: token configuration and authentication-related operations. The official description states that it provides a total of 32 tools, covering publish, install, audit, search, security, and more.

How to Use

  1. Obtain an npm token: go to npmjs.com > Account > Access Tokens to create a granular access token with the required package access permissions. The official documentation states that Classic and Automation tokens are no longer supported; stage-only tokens use the staged publishing process described below; existing npm login credentials can also be used.
  2. Add to Claude Code: edit ~/.claude/settings.json and configure MCP according to the official example. If npm login has already been run locally, you can skip NPM_TOKEN, and ~/.npmrc will be used automatically.
  3. Environment variables: the official documentation lists environment variable-related configuration (the specific variable names are in the officialrepository).

Staged Publishing Notes The official documentation clearly states: staged publishing requires npm CLI 11.15.0 or higher, and Node.js 22.14.0 or higher; you can use npm stage --help to view it, and NPM_PATH can select a separate npm installation. Staging itself does not publish the package; approval is required to publish; approval and rejection require maintainer 2FA. dryRun applies only to stages with an action of "publish". Using a stage-only token to publish directly will return E_STAGE_REQUIRED. npm plans to remove direct publishing with granular tokens in January 2027.

Parameters and Authentication pkg can directly accept JSON values: value: "my-package", value: true, value: ["keyword"], or value: { test: "node --test" }. Strings remain strings; do not stringify arrays or objects before passing them in. When npm requires 2FA, otp must be passed, including for staged approval/rejection and package maintainer or token changes. The official documentation states: as of August 2026, bypass-2FA tokens cannot bypass the second factor for account or governance operations. Tokens expire, so you need to update the configured token when necessary, or refresh local credentials via npm login.

Use Cases Suitable for users doing JavaScript/Node.js development in Claude Code or other MCP clients, especially developers who need to frequently publish libraries, manage dependencies, and perform security audits.

Limitations Some advanced features (such as staged publishing) have minimum requirements for npm CLI and Node.js versions; 2FA and token types have clear restrictions; npm plans to remove the direct publishing method in the future. Other features, fees, or pricing information not described in the official materials are not currently provided.