Skip to content

MCP Server

NPM Skills ships an MCP (Model Context Protocol) server that exposes NPM Registry operations as 31 tools, callable from any MCP-compatible AI client — Claude Code, Cursor, Windsurf, and more.

Architecture

The client and server talk over JSON-RPC (stdio transport); the server translates each tool call into a Registry SDK method call:

Full sequence of a single tool call (querying a package summary):

Install

bash
# Build from source (builds both CLI and MCP server)
bash scripts/install.sh

# Or go install (produces a binary named mcp-server, from the dir name)
go install github.com/scagogogo/npm-skills/cmd/mcp-server@latest

Note: go install produces an executable named mcp-server (from the cmd/mcp-server directory name); the prebuilt binary from the Releases page is named npm-mcp-server. The config examples below use npm-mcp-server — if you installed via go install, change command to mcp-server.

Configuration

Claude Code

json
{
  "mcpServers": {
    "npm-registry": {
      "command": "npm-mcp-server",
      "args": ["--mirror", "npm-mirror"]
    }
  }
}

Cursor / Generic MCP Client

json
{
  "mcpServers": {
    "npm-registry": {
      "command": "npm-mcp-server",
      "args": ["--token", "npm_xxxxx", "--proxy", "http://127.0.0.1:7890"]
    }
  }
}

Flags

FlagDefaultDescription
--mirrorofficialMirror source name (env: NPM_MIRROR)
--registryCustom registry URL (env: NPM_REGISTRY)
--tokenAuth token (env: NPM_TOKEN)
--proxyHTTP proxy (env: NPM_PROXY)
--timeout120Timeout in seconds (env: NPM_TIMEOUT)

Tools (31)

The 31 tools split by whether they need a token: 17 read-only tools need no auth, 14 require a valid token configured on the server (--token or NPM_TOKEN):

Read Tools (no token)

ToolDescription
npm_registry_infoRegistry status and stats (package count, disk size, etc.)
npm_mirrorsList all mirror sources with URLs, regions, descriptions
npm_packageFull package metadata (can be 10MB+; prefer summary)
npm_package_summaryLightweight package metadata (name, description, dist-tags, versions) — recommended
npm_searchSearch packages by keyword (pagination, score weighting)
npm_versionMetadata for a specific version (deps, scripts, dist)
npm_versionsAll published version numbers (ascending)
npm_latest_versionLatest version number (dist-tags only; fast)
npm_dist_tagsAll dist-tags (latest / next / beta …)
npm_dist_tag_getVersion a single dist-tag points to
npm_download_statsDownload total for a period (always queries api.npmjs.org)
npm_download_rangeDaily download trend array (always queries api.npmjs.org)
npm_auditQuick security audit (submit name→version map, get vuln counts by severity)
npm_audit_advisoryGet a single security advisory by ID
npm_starred_by_packageUsers who starred a package
npm_starred_by_userPackages starred by a user
npm_changesRegistry changes feed (for mirroring / incremental sync)

Token-Required Tools

ToolDescription
npm_dist_tag_setSet/update a dist-tag to a version
npm_dist_tag_deleteDelete a dist-tag (deleting latest is risky)
npm_package_accessPackage access/permission settings
npm_package_collaboratorsPackage collaborators
npm_user_getUser profile info
npm_whoamiCurrent auth status (returns username)
npm_token_listAPI token list for the current user
npm_org_getOrganization details
npm_org_membersOrganization members
npm_org_packagesPackages owned by an organization
npm_team_listTeams in an organization
npm_team_membersTeam members
npm_hook_listWebhook list for the current user
npm_hook_getSingle webhook details

Call Sequence

MCP clients (Claude / Cursor / etc.) talk to this server over stdio: the client first calls tools/list to get all 31 tool schemas, the AI picks one and calls tools/call, and the server dispatches through the SDK and returns structured content:

Next Steps

Released under the MIT License.