Token导航 LogoToken导航TokenDH.com
npm MCP logo
AI代理未说明官方级别未说明来源级核验

npm MCP

MCP Server

一个允许AI助手管理npm包的服务,支持发布、版本控制、搜索、审核、安装等功能。

工具数

38

提示词数

0

GitHub Stars

0

资源数

0
包管理JavaScriptClaude自动化Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mikusnuz

提供方

mikusnuz

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

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

npm-mcp

](https://www.npmjs.com/package/@mikusnuz/npm-mcp) ](https://lobehub.com/mcp/mikusnuz-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.

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 > Account > Access Tokens > Generate New Token (Automation type recommended).

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
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
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

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

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

For 2FA-enabled accounts, pass otp parameter to publish/unpublish/deprecate/owner/access/token tools.

Environment Variables

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

License

MIT

目录标签

目录标签

包管理JavaScriptClaude自动化npm管理本地部署AI助手自动化工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

38

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP