Skip to main content
Glama
yuchen814

npm-registry-mcp-server

by yuchen814

npm-registry-mcp-server

A Model Context Protocol (MCP) server that looks up package metadata from the npm registry, powered by package-json by Sindre Sorhus.

  • Transport: stdio

  • Validation: zod input/output schemas on every tool

  • Monitoring: Sentry (@sentry/node) initialized before the server starts, with automatic MCP instrumentation via wrapMcpServerWithSentry

  • Runtime: Node.js >= 18 (matches the package-json engines requirement)

Repository: https://github.com/yuchen814/npm-registry-mcp-server

Tools

get_package_metadata

Fetch metadata for a package from the npm registry.

Argument

Type

Required

Description

packageName

string

yes

Package name, scoped packages supported (react, @sindresorhus/df). Validated against npm naming rules.

version

string

no

Exact version (1.0.0), dist-tag (latest, next), or semver range (1, 1.2, ^1.2.3, ~1.2.3). Defaults to latest.

fullMetadata

boolean

no

Return full (non-abbreviated) metadata. Defaults to false.

allVersions

boolean

no

Return the registry main entry containing all versions. Defaults to false.

omitDeprecated

boolean

no

Omit deprecated versions when resolving ranges (explicit versions/dist-tags still resolve). Defaults to true.

Package-not-found and version-not-found conditions are reported as tool errors with clear messages (PackageNotFoundError / VersionNotFoundError from package-json).

get_package_versions

List every published version and all dist-tags of a package.

Argument

Type

Required

Description

packageName

string

yes

Package name, scoped names supported

Returns { name, distTags, versions, total } as structured content.

Related MCP server: mcp-server-npm

Install & run

npm install
npm run build
npm start          # runs node dist/server.js on stdio

Development (no build step):

npm run dev        # tsx server.ts

Try it with the MCP Inspector:

npm run inspector

Client configuration

Example entry for an MCP client such as Claude Desktop (claude_desktop_config.json):

{
	"mcpServers": {
		"npm-registry": {
			"command": "node",
			"args": ["/absolute/path/to/npm-registry-mcp-server/dist/server.js"],
			"env": {
				"SENTRY_DSN": "https://examplePublicKey@o0.ingest.sentry.io/0"
			}
		}
	}
}

Environment variables

Variable

Default

Description

SENTRY_DSN

(unset)

Sentry DSN. When unset, Sentry is disabled and the server runs normally.

SENTRY_ENVIRONMENT

production

Sentry environment tag.

SENTRY_TRACES_SAMPLE_RATE

0.1

Sample rate (0.0–1.0) for performance tracing of MCP requests.

Copy .env.example to get started. Registry selection (including private registries and auth) follows your .npmrc, exactly like npm itself, courtesy of package-json.

Error monitoring

Sentry.init() runs before the MCP server is constructed or connected. Expected lookup failures (unknown package/version) are returned to the client as tool errors and are not sent to Sentry; unexpected failures are captured and flushed before the tool responds. Fatal startup errors are also captured.

License

MIT

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuchen814/npm-registry-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server