UNPKG
Live npm and UNPKG data for AI agents: resolution, audits, import maps, malware/CVE checks.
Should I use this
Quality & Safety
Based on automated analysis of tool definitions and protocol compliance.
Context Cost
This is the approximate number of tokens consumed each time the server's tools are loaded into a model's context. Higher counts reduce the attention available for other tasks.
Install
One-Click Install
Add this to your `claude_desktop_config.json` file:
{
"mcpServers": {
"unpkg-mcp": {
"url": "https://mcp.unpkg.com/mcp"
}
}
}Remote endpoints
https://mcp.unpkg.com/mcpstreamable-httpWhat it can do
Tool inventory
Tools (14)
🟢resolve_package(package, version)
Resolve a package name plus exact version, dist-tag, or semver range to the version that exists on npm today, with its browser entry points. Use this instead of recalling versions from memory.
Input Schema
{
"type": "object",
"properties": {
"package": {
"type": "string",
"description": "npm package name, e.g. react or @scope/name"
},
"version": {
"type": "string",
"description": "Exact version, dist-tag, or semver range. Defaults to latest."
}
},
"required": [
"package"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"requested": {
"type": "string"
},
"resolvedVersion": {
"type": "string"
},
"distTags": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"entryPoints": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"peerDependencies": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"name",
"requested",
"resolvedVersion",
"distTags",
"entryPoints",
"peerDependencies"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢list_files(package, version, path, limit)
List the real files inside an exact or resolvable package version via UNPKG ?meta. Use this before choosing a file path; never guess paths.
Input Schema
{
"type": "object",
"properties": {
"package": {
"type": "string"
},
"version": {
"type": "string",
"description": "Defaults to latest; resolved before listing."
},
"path": {
"type": "string",
"description": "Directory prefix inside the package, e.g. /dist/. Defaults to /."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 1000,
"description": "Max files to return. Defaults to 200."
}
},
"required": [
"package"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"package": {
"type": "string"
},
"version": {
"type": "string"
},
"prefix": {
"type": "string"
},
"totalFiles": {
"type": "number"
},
"truncated": {
"type": "boolean"
},
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": true
}
}
},
"required": [
"package",
"version",
"prefix",
"totalFiles",
"truncated",
"files"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢build_file_url(package, version, file, subpath, policy)
Build a direct UNPKG file URL (the original file lookup) with a deliberate version policy, verifying the file exists when a path is given.
Input Schema
{
"type": "object",
"properties": {
"package": {
"type": "string"
},
"version": {
"type": "string",
"description": "Exact version, dist-tag, or range to resolve. Defaults to latest."
},
"file": {
"type": "string",
"description": "File path inside the package. Defaults to the resolved entry point."
},
"subpath": {
"type": "string",
"description": "Package subpath import, e.g. hooks for preact/hooks. Resolved through the exports map, then file discovery. Ignored when file is given."
},
"policy": {
"type": "string",
"enum": [
"preserve",
"exact",
"patch",
"range"
],
"description": "preserve: keep the given spec (default). exact: resolved version. patch: major.minor (bug fixes flow). range: ^major.minor.patch."
}
},
"required": [
"package"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"url": {
"type": "string"
},
"package": {
"type": "string"
},
"specUsed": {
"type": "string"
},
"resolvedVersion": {
"type": "string"
},
"file": {
"type": "string"
},
"verifiedFileExists": {
"type": [
"boolean",
"null"
]
}
},
"required": [
"url",
"package",
"specUsed",
"resolvedVersion",
"file",
"verifiedFileExists"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢audit_dependencies(dependencies, framework, existingImports)
Classify a project's runtime dependencies for conversion to direct UNPKG file lookups, in framework context when given. Read the project's package.json yourself and pass its dependencies map; this tool checks each package against live npm/UNPKG data and returns convert_now / convert_carefully / keep_bundled / needs_review with suggested URLs and an import map for the safe conversions. IMPORTANT: suitability is not usage. Before calling, scan the project's HTML/files for an existing import map and CDN URLs and pass them as existingImports; entries already on UNPKG come back as already_on_unpkg, not conversion candidates. If you did not scan, say so — currentUsage will be absent rather than falsely 'not detected'. Only pass runtime dependencies, never devDependencies.
Input Schema
{
"type": "object",
"properties": {
"dependencies": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Map of package name to the version spec from package.json, e.g. { \"preact\": \"^10.25.4\" }"
},
"framework": {
"type": "string",
"enum": [
"next",
"nuxt",
"sveltekit",
"remix",
"astro",
"gatsby"
],
"description": "The project's framework, if any. Framework-managed packages (react/react-dom in Next, vue in Nuxt, ...) are classified keep_bundled in context. Auto-detected from the dependency map when omitted."
},
"existingImports": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Existing imports found in the project: bare specifier to current URL, typically an import map extracted from HTML (include subpath keys like preact/hooks). Pass {} if you scanned and found none. Omit only if you did not scan; the result then reports current usage as unknown instead of not detected."
}
},
"required": [
"dependencies"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"framework": {
"type": [
"string",
"null"
]
},
"frameworkNote": {
"type": [
"string",
"null"
]
},
"scopeNote": {
"type": "string"
},
"currentStateSummary": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"shieldVerdicts": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": true
}
},
{
"type": "null"
}
]
},
"shieldNote": {
"type": [
"string",
"null"
]
},
"summary": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"dependencies": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": true
}
},
"importmap": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"importmapScope": {
"type": "string"
},
"peerImportsAdded": {
"type": "array",
"items": {
"type": "string"
}
},
"peerNotes": {
"type": "array",
"items": {
"type": "string"
}
},
"mapValidation": {
"anyOf": [
{
"type": "object",
"properties": {},
"additionalProperties": true
},
{
"type": "null"
}
]
},
"impact": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"nextSteps": {
"type": "string"
}
},
"required": [
"framework",
"frameworkNote",
"scopeNote",
"currentStateSummary",
"shieldVerdicts",
"shieldNote",
"summary",
"dependencies",
"importmap",
"importmapScope",
"peerImportsAdded",
"peerNotes",
"mapValidation",
"impact",
"nextSteps"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢verify_url(url)
Check that a UNPKG file URL actually resolves (follows redirects) before you put it in a project.
Input Schema
{
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "A full https://unpkg.com/... file URL."
}
},
"required": [
"url"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"status": {
"type": "number"
},
"finalUrl": {
"type": "string"
},
"contentType": {
"type": [
"string",
"null"
]
}
},
"required": [
"ok",
"status",
"finalUrl",
"contentType"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢generate_importmap(entries)
Resolve a set of bare specifiers to UNPKG file URLs and return a ready-to-paste import map. Entry files are resolved live from each package.
Input Schema
{
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"specifier": {
"type": "string",
"description": "Bare specifier used in imports, e.g. preact or preact/hooks"
},
"package": {
"type": "string"
},
"version": {
"type": "string"
},
"file": {
"type": "string",
"description": "Explicit file; defaults to the package entry point."
}
},
"required": [
"specifier",
"package"
],
"additionalProperties": false
}
}
},
"required": [
"entries"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"importmap": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"resolved": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"importmap",
"resolved"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢check_importmap(imports, framework)
Validate an existing or proposed import map: every UNPKG URL resolves, files exist, versions are mutually consistent (including react/react-dom pairing and duplicate-version skew), loose specs are flagged, and framework-managed packages are errors when a framework is given or detected. Run this after generate_importmap or an audit, before committing to a conversion.
Input Schema
{
"type": "object",
"properties": {
"imports": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "The import map's imports object: bare specifier to URL."
},
"framework": {
"type": "string",
"enum": [
"next",
"nuxt",
"sveltekit",
"remix",
"astro",
"gatsby"
]
}
},
"required": [
"imports"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"framework": {
"type": [
"string",
"null"
]
},
"entries": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": true
}
},
"globalIssues": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": true
}
}
},
"required": [
"ok",
"framework",
"entries",
"globalIssues"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢search_packages(query, limit)
Search npm for a need (e.g. 'date picker', 'markdown parser') and annotate each result with browser readiness for direct UNPKG file lookup: browser-ready ESM, CommonJS-only, or unclear, with the entry file and size when known. Ranking is npm's relevance order; readiness is annotated, never hidden, so a CJS-only result is visible as such rather than silently dropped.
Input Schema
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "What the package should do, e.g. 'confetti', 'sanitize html', 'date picker'."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"description": "Results to annotate. Defaults to 5."
}
},
"required": [
"query"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"query": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": true
}
},
"note": {
"type": "string"
}
},
"required": [
"query",
"results",
"note"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢estimate_migration_impact(monthlyPageViews, unpkgBytesPerPageLoad, browserCacheRate, bandwidthCostPerGbUsd)
Order-of-magnitude estimate of bandwidth offloaded (and hosting dollars, if a $/GB is given) when bytes move from first-party hosting to UNPKG. Range-based with explicit assumptions and caveats; it cannot forecast latency or Core Web Vitals. Get unpkgBytesPerPageLoad from audit_dependencies' impact.convertNowEntryBytes plus any transitive files the caller chooses to include.
Input Schema
{
"type": "object",
"properties": {
"monthlyPageViews": {
"type": "number",
"exclusiveMinimum": 0
},
"unpkgBytesPerPageLoad": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Raw bytes per page load moving to UNPKG."
},
"browserCacheRate": {
"type": "number",
"minimum": 0,
"maximum": 0.95,
"description": "Share of loads served from browser cache. Default 0.5."
},
"bandwidthCostPerGbUsd": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Current hosting $/GB, if known. Omit to skip dollars."
}
},
"required": [
"monthlyPageViews",
"unpkgBytesPerPageLoad"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}Output Schema
{
"type": "object",
"properties": {
"monthlyGbOffloaded": {
"type": "object",
"properties": {
"low": {
"type": "number"
},
"high": {
"type": "number"
}
},
"required": [
"low",
"high"
],
"additionalProperties": false
},
"monthlySavingsUsd": {
"anyOf": [
{
"$ref": "#/properties/monthlyGbOffloaded"
},
{
"type": "null"
}
]
},
"perLoadWireBytes": {
"$ref": "#/properties/monthlyGbOffloaded"
},
"transferTimeEquivalentMs": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"caveats": {
"type": "array",
"items": {
"type": "string"
}
},
"betterMetrics": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"monthlyGbOffloaded",
"monthlySavingsUsd",
"perLoadWireBytes",
"transferTimeEquivalentMs",
"assumptions",
"caveats",
"betterMetrics"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢shield_whoami
Return the Shield account, organization, and entitlements for the OAuth login on this connection. Requires an approved Shield account; anonymous connections get an authorization_required error with reconnect instructions.
Input Schema
{
"type": "object",
"properties": {},
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢shield_simulate_request(package, version, path, referer, origin)
Preview what Shield would do for one package@version request (optionally with referer/origin) under the logged-in user's effective pin/block rules, using the same rule-matching semantics as the edge.
Input Schema
{
"type": "object",
"properties": {
"package": {
"type": "string"
},
"version": {
"type": "string"
},
"path": {
"type": "string"
},
"referer": {
"type": "string"
},
"origin": {
"type": "string"
}
},
"required": [
"package",
"version"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢shield_check_packages(packages)
Check exact package@version pairs against Shield intel: malware verdict (with review state) and CVEs affecting that version, including the first patched version. Works anonymously for packages you name (25 per call); Shield login raises the cap to 200. Domain data still requires login. Missing pairs were not scanned yet — absence is not a clean verdict.
Input Schema
{
"type": "object",
"properties": {
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"name",
"version"
],
"additionalProperties": false
},
"minItems": 1,
"maxItems": 200
}
},
"required": [
"packages"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢shield_domain_packages(domain, includeThreats, days)
List the caller's verified domains with package counts, or the packages Shield has observed on one domain. With includeThreats, one domain's packages come back annotated with malware verdicts and CVEs, ranked by the domain's own traffic. Requires Shield login.
Input Schema
{
"type": "object",
"properties": {
"domain": {
"type": "string",
"description": "One verified domain. Omit to list domains with package counts."
},
"includeThreats": {
"type": "boolean",
"description": "Annotate one domain's packages with verdicts and CVEs. Requires domain."
},
"days": {
"type": "integer",
"minimum": 0,
"maximum": 365,
"description": "Lookback window for threats mode. Default 30; 0 = all-time."
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢shield_watchlist_status
Return the logged-in org's monitored packages, blocklist entries, and pin policies as Shield currently holds them. Requires Shield login.
Input Schema
{
"type": "object",
"properties": {},
"$schema": "http://json-schema.org/draft-07/schema#"
}Community
Evidence