# Npm

> Npm is an open-source MCP server for developer tools. npm package publishing, versioning, auditing and install tools for MCP clients. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Self-hosted, CLI
- **Repository:** https://github.com/mikusnuz/npm-mcp
- **MCP Registry name:** io.github.mikusnuz/npm
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

This server wraps the npm command line so an assistant can run package chores without leaving the conversation. The README groups roughly 40 tools into publishing and versioning, package info, dependency management, security and diagnostics, configuration and auth, and project setup.

It includes a staged publishing flow: a stage tool can publish a version to a staging area, then list, view, download, approve or reject it, with approval needing maintainer 2FA. That needs npm CLI 11.15.0 or later and Node.js 22.14.0 or later. For npm 12 it also has tools to review and approve or deny dependency install scripts by name, with no bulk approval.

Authentication uses an npm granular access token in NPM_TOKEN, or existing npm login credentials from ~/.npmrc. The README says classic and Automation tokens are no longer supported. The server itself needs Node.js 20 or newer and is built from source after cloning the repository.

## Features

- **Publish and version:** Publish packages, bump versions, deprecate or unpublish releases and preview a pack.
- **Staged publishing:** Stage a version, then approve or reject it with a 2FA code.
- **Dependency management:** Install, update, prune, dedupe and list packages, and explain why one is present.
- **Security checks:** Run audits, generate CycloneDX or SPDX SBOMs and check npm environment health.
- **Install script approval:** Review, approve or deny dependency install scripts on npm 12 and later.
- **Registry lookups:** Search the registry and view package details, bug and repository URLs, and version diffs.

## Good for

- Bump a version and publish a library from an AI chat
- Audit a project's dependencies and list outdated packages
- Generate an SBOM for a production build
- Search npm for libraries and compare two versions of one

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add npm --env NPM_TOKEN='<NPM_TOKEN>' -- npx -y @mikusnuz/npm-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "npm": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add npm --env NPM_TOKEN='<NPM_TOKEN>' -- npx -y @mikusnuz/npm-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.npm]
command = "npx"
args = ["-y", "@mikusnuz/npm-mcp"]
env = { NPM_TOKEN = "<NPM_TOKEN>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e NPM_TOKEN='<NPM_TOKEN>' npm npx -- -y @mikusnuz/npm-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "npm": {
      "command": "npx",
      "args": [
        "-y",
        "@mikusnuz/npm-mcp"
      ],
      "env": {
        "NPM_TOKEN": "<NPM_TOKEN>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 42 tools deletes data and 4 change data; 33 names don't say. From the server's own tool labels and tool names; not verified by us.

- `publish` (name suggests: changes): Publish a package to npm registry
- `stage`: Stage, list, inspect, download, approve, or reject a pending package version
- `version`: Bump package version
- `unpublish`: Remove a package version
- `deprecate`: Deprecate a version
- `pack`: Preview what would be published
- `view` (name suggests: reads): View package info from registry
- `search` (name suggests: reads): Search npm registry
- `bugs`: Get bug tracker URL for a package
- `repo`: Get repository URL for a package
- `docs`: Get documentation URL for a package
- `diff`: Show diff between package versions
- `install`: Install packages
- `pending-scripts`: List unreviewed dependency install scripts
- `approve-scripts` (name suggests: changes): Approve named, reviewed dependencies
- `deny-scripts`: Deny install scripts for named dependencies
- `uninstall` (name suggests: deletes): Remove packages
- `update` (name suggests: changes): Update packages
- `outdated`: Check for outdated packages
- `ls`: List installed packages
- `explain` (name suggests: reads): Explain why a package is installed
- `dedupe`: Reduce duplication in dependency tree
- `prune`: Remove extraneous packages
- `fund`: Show funding info for dependencies
- `query` (name suggests: reads): Query packages using CSS-like selectors
- `audit`: Run security audit
- `sbom`: Generate Software Bill of Materials
- `doctor`: Check npm environment health
- `ping`: Check registry connectivity
- `whoami`: Check current authenticated user
- `token`: Manage access tokens
- `access`: Set or view access level on packages
- `owner`: Manage package owners
- `dist-tag`: Manage distribution tags
- `profile`: View or modify npm profile settings
- `config`: View npm configuration
- `init`: Initialize a new package.json
- `pkg`: Manage package.json fields
- `ci`: Clean install from lockfile
- `run-script` (name suggests: changes): Run scripts defined in package.json
- `link`: Symlink a local package
- `cache`: Manage the npm cache

## FAQ

### What credentials does Npm need?

A granular npm access token in NPM_TOKEN, or existing credentials from npm login in ~/.npmrc.

### Does Npm support staged publishing?

Yes, through the stage tool, which needs npm CLI 11.15.0+ and Node.js 22.14.0+.

### Which Node.js version does the server need?

Node.js 20 or newer, though some npm features need newer combinations.

### Are classic tokens supported?

No. The README says classic and Automation tokens are no longer supported.

### Is Npm free?

Yes. Npm is open source, so you can use and self-host it for free.

### How do I add Npm to Claude Code?

Run this command in your terminal: claude mcp add npm --env NPM_TOKEN='<NPM_TOKEN>' -- npx -y @mikusnuz/npm-mcp

### What are the best alternatives to Npm?

The closest alternatives to Npm are REA, Codebase Memory, Serena MCP: the IDE for your agent, XERJ and Context7.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/npm
