{
  "markdown": "**English** | [한국어](README.ko.md) | [中文](README.zh.md) | [日本語](README.ja.md)\n\n# npm-mcp\n\n[![npm version](https://img.shields.io/npm/v/@mikusnuz%2Fnpm-mcp)](https://www.npmjs.com/package/@mikusnuz/npm-mcp)\n[![MCP Badge](https://lobehub.com/badge/mcp/mikusnuz-npm-mcp)](https://lobehub.com/mcp/mikusnuz-npm-mcp)\n\nMCP server that lets AI assistants manage npm packages. Publish, version, search, audit, install, and more -- all through Claude Code or any MCP client.\n\n## When to Use\n\n| Task | Tool |\n|------|------|\n| \"Publish this package to npm\" | `publish` |\n| \"Check for outdated dependencies\" | `outdated` |\n| \"Run a security audit on my packages\" | `audit` |\n| \"Search npm for authentication libraries\" | `search` |\n| \"Bump the version and publish\" | `version` then `publish` |\n| \"Check who owns this npm package\" | `owner` |\n| \"View download stats for my package\" | `view` |\n\n> **For AI agents:** See [`llms.txt`](llms.txt) for a machine-readable summary. Copy [`templates/CLAUDE.md`](templates/CLAUDE.md) or [`templates/AGENTS.md`](templates/AGENTS.md) into your project to teach your agent about this MCP.\n\n## Why\n\nYou're in Claude Code building a library. You finish the code, and now you need to publish it. Instead of switching to a terminal:\n\n```\nYou: publish this package to npm with public access\nClaude: [calls publish tool] Published @yourorg/lib@1.0.0 successfully\n```\n\nThat's it. No context switching.\n\n## Setup\n\n### 1. Install\n\n```bash\ngit clone https://github.com/mikusnuz/npm-mcp.git\ncd npm-mcp\nnpm install\nnpm run build\n```\n\n### 2. Get npm token\n\nGo to [npmjs.com](https://www.npmjs.com) > Account > Access Tokens > **Generate New Token** (Automation type recommended).\n\n### 3. Add to Claude Code\n\nEdit `~/.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"npm-mcp\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/npm-mcp/dist/index.js\"],\n      \"env\": {\n        \"NPM_TOKEN\": \"npm_xxxxxxxxxxxx\"\n      }\n    }\n  }\n}\n```\n\nOr if you've already run `npm login` locally, skip `NPM_TOKEN` -- it uses your `~/.npmrc` automatically.\n\n## Tools\n\n### Publishing & Versioning\n\n| Tool | Description |\n|------|-------------|\n| `publish` | Publish a package to npm registry |\n| `version` | Bump package version (patch/minor/major/pre*) |\n| `unpublish` | Remove a package version |\n| `deprecate` | Deprecate a version (or undeprecate with empty message) |\n| `pack` | Preview what would be published |\n\n### Package Info\n\n| Tool | Description |\n|------|-------------|\n| `view` | View package info from registry |\n| `search` | Search npm registry |\n| `bugs` | Get bug tracker URL for a package |\n| `repo` | Get repository URL for a package |\n| `docs` | Get documentation URL for a package |\n| `diff` | Show diff between package versions |\n\n### Dependency Management\n\n| Tool | Description |\n|------|-------------|\n| `install` | Install packages |\n| `uninstall` | Remove packages |\n| `update` | Update packages to latest semver-compatible version |\n| `outdated` | Check for outdated packages |\n| `ls` | List installed packages |\n| `explain` | Explain why a package is installed |\n| `dedupe` | Reduce duplication in dependency tree |\n| `prune` | Remove extraneous packages |\n| `fund` | Show funding info for dependencies |\n| `query` | Query packages using CSS-like selectors |\n\n### Security & Diagnostics\n\n| Tool | Description |\n|------|-------------|\n| `audit` | Run security audit (with optional auto-fix) |\n| `sbom` | Generate Software Bill of Materials (CycloneDX/SPDX) |\n| `doctor` | Check npm environment health |\n| `ping` | Check registry connectivity |\n\n### Configuration & Auth\n\n| Tool | Description |\n|------|-------------|\n| `whoami` | Check current authenticated user |\n| `token` | Manage access tokens (list/revoke) |\n| `access` | Set or view access level on packages |\n| `owner` | Manage package owners (ls/add/rm) |\n| `dist-tag` | Manage distribution tags (ls/add/rm) |\n| `profile` | View or modify npm profile settings |\n| `config` | View npm configuration (read-only) |\n\n### Project Setup\n\n| Tool | Description |\n|------|-------------|\n| `init` | Initialize a new package.json |\n| `pkg` | Manage package.json fields programmatically |\n| `ci` | Clean install from lockfile (for CI) |\n| `run-script` | Run scripts defined in package.json |\n| `link` | Symlink a local package for development |\n| `cache` | Manage the npm cache |\n\n## Examples\n\n**Publish a scoped package:**\n```\npublish({ path: \"/home/user/my-lib\", access: \"public\" })\n```\n\n**Bump version and publish:**\n```\nversion({ path: \"/home/user/my-lib\", bump: \"patch\" })\npublish({ path: \"/home/user/my-lib\" })\n```\n\n**Check what's inside before publishing:**\n```\npack({ path: \"/home/user/my-lib\", dryRun: true })\n```\n\n**Search for existing packages:**\n```\nsearch({ query: \"react state management\", limit: 5 })\n```\n\n**View package details:**\n```\nview({ package: \"@yourorg/lib\", field: \"versions\" })\n```\n\n**Install packages:**\n```\ninstall({ path: \"/home/user/my-app\", packages: [\"express\", \"cors\"], saveDev: false })\n```\n\n**Check outdated dependencies:**\n```\noutdated({ path: \"/home/user/my-app\" })\n```\n\n**Compare versions:**\n```\ndiff({ specs: [\"lodash@4.17.20\", \"lodash@4.17.21\"] })\n```\n\n**Generate SBOM:**\n```\nsbom({ path: \"/home/user/my-app\", format: \"spdx\", production: true })\n```\n\n**Query dependencies:**\n```\nquery({ path: \"/home/user/my-app\", selector: \":root > .prod\" })\n```\n\n## Auth\n\n| Method | How |\n|--------|-----|\n| **NPM_TOKEN** (recommended) | Set `NPM_TOKEN` env var in MCP config. Get token from npmjs.com > Access Tokens |\n| **npm login** | Run `npm login` in terminal first. Token saved in `~/.npmrc` is used automatically |\n\nFor 2FA-enabled accounts, pass `otp` parameter to publish/unpublish/deprecate/owner/access/token tools.\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `NPM_TOKEN` | -- | npm authentication token |\n| `NPM_PATH` | `npm` | Path to npm binary (if not in PATH) |\n\n## License\n\nMIT\n",
  "bytes": 5952,
  "sha": "72a1a7f8bf0a50b87c9c8fd76386000c297688550757188c784ac853c95b4afb",
  "repo_slug": "mikusnuz/npm-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_mikusnuz_npm_0ad6ebd4/readme"
}