UNPKG

io.github.unpkg由 GitHub 帳號 unpkg 發布v1.0.0更新於 Nov 7, 2026

Live npm and UNPKG data for AI agents: resolution, audits, import maps, malware/CVE checks.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取開發者工具安全與監控

概覽

AI 產生的概覽

遠端 MCP 伺服器,為助理提供即時的 npm 與 UNPKG 資料,用來解析套件版本、建立並驗證檔案 URL、稽核相依套件,以及檢查套件的惡意程式與 CVE。

可以做什麼
  • 解析套件並檢視檔案:依標籤或版本範圍解析版本、搜尋 npm 並標註瀏覽器可用性、列出某版本的真實檔案、建立標準檔案 URL、驗證 URL 可解析。
  • 稽核與轉換專案:分類 package.json 相依套件表,從裸模組名稱產生 import map,並整體驗證現有 import map 的解析、檔案存在性與版本一致性。
  • 估算移轉影響:提供頻寬卸載區間,若提供每 GB 費率再給出金額區間。
  • 檢查套件安全性:針對指定套件版本給出惡意程式判定與 CVE,並在稽核中附上同類資料;登入 Shield 後還可使用帳號、網域、監控清單與固定/封鎖模擬工具。
適用情境
適合把網站前端相依套件改為直接引用 UNPKG 檔案時使用,也適合助理需要準確的 npm 版本、真實檔案路徑與瀏覽器進入點,而非憑記憶回答的情況。在載入某個確切套件版本前查核惡意程式或 CVE 時同樣有用。
執行需求
需要連線到 mcp.unpkg.com 遠端端點;未宣告需要安裝套件、API 金鑰或請求標頭。一般工具與匿名套件安全檢查不需帳號。Shield 帳號工具需要已核准的 Shield 帳號,並在 MCP 用戶端完成 OAuth 登入。
安裝前請注意
Shield 工具需要 OAuth 登入,並會揭露組織資料,例如已驗證網域、監控清單與固定策略。稽核與 import map 工具會讀取你提供的專案相依套件與 HTML 資料,這些內容會傳送到遠端服務。移轉估算只是附帶假設的區間而非保證,伺服器也建議不要轉換已由打包工具或框架管理的套件。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 UNPKG,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.unpkg%2Funpkg-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "unpkg": {
      "type": "http",
      "url": "https://mcp.unpkg.com/mcp"
    }
  }
}

README

unpkg-mcp

[UNPKG MCP connector – tool definition quality and endpoint health on Glama]

A remote MCP server for UNPKG. It gives AI agents live npm and UNPKG data for direct UNPKG file lookups: https://unpkg.com/<package>@<version>/<file>.

Agents often recall npm details incorrectly — versions that don't exist, file paths that were never published, Node entry points offered as browser modules. This server resolves versions, lists real package files, audits projects for UNPKG conversion, validates import maps, and checks packages for malware and CVEs, all from live data.

Deployed at https://mcp.unpkg.com (landing page at /, MCP endpoint at /mcp).

Tools

ToolPurpose
resolve_packageResolve an exact version, tag, or range to a real version and its browser entry points
search_packagesSearch npm, with results annotated for browser readiness
list_filesList the real files in a package version, via the ?meta API
build_file_urlBuild a canonical file URL with a version policy (preserve, exact, patch, or range)
audit_dependenciesClassify a package.json dependency map (convert_now / convert_carefully / keep_bundled / needs_review / not_found), with suggested URLs, an import map, and framework detection; packages already loading from UNPKG are reported separately from conversion candidates
verify_urlCheck that a UNPKG URL resolves
generate_importmapGenerate an import map from bare specifiers
check_importmapValidate an import map as a whole: resolution, file existence, version consistency, and framework-managed packages
estimate_migration_impactEstimate bandwidth offload for a migration as a range with stated assumptions
shield_check_packagesMalware verdicts and CVEs for exact package versions. Anonymous (25 per call; Shield login raises the limit to 200)
shield_whoami(Shield login) Account, organization, and entitlements for the connected user
shield_domain_packages(Shield login) Packages observed on your verified domains, optionally annotated with malware verdicts and CVEs ranked by traffic
shield_simulate_request(Shield login) Preview Shield's pin/block decision for a package version
shield_watchlist_status(Shield login) Your monitored packages, blocklist, and pin policies

Package safety checks

Every package the server resolves can also be checked against Shield's security data, in two ways:

  • Named packages. shield_check_packages takes exact package@version pairs and returns, for each one, a malware verdict with its review state (confirmed or provisional), the CVEs that affect that version, and the first patched version to upgrade to. Verdicts and CVE matches are computed for the exact version asked about — a clean result never comes from checking a different version.
  • Inside audits. audit_dependencies attaches the same verdict and CVE data to every version it resolves, so a flagged package is visible in the audit result next to its conversion recommendation.

No account is needed for either: named-package checks are anonymous (25 per call), and audit enrichment works the same signed out. A provisional verdict is reported as provisional; it is not presented as confirmed malicious.

With a Shield login, the checks extend to your own estate: shield_domain_packages (with threats enabled) returns the packages observed on your verified domains annotated with verdicts and CVEs, ranked by each domain's traffic, so the packages that matter most surface first.

Example prompts:

  • "Is [email protected] safe to load? Check it for malware and CVEs, and tell me what to upgrade to."
  • "Check the packages in this audit for known compromises or CVEs before we convert anything."
  • (Shield login) "Which packages on my domains have CVEs or malware verdicts, worst first?"

Shield login

The general tools are anonymous. With a Shield account approved from the beta waitlist, your MCP client can also sign in via OAuth and the shield_* account tools unlock, scoped to your own organization.

Package-safety checks are not login-gated: shield_check_packages works anonymously for packages you name, and audit_dependencies includes verdicts and CVEs either way. Signing in adds your own domains, watchlist, and edge simulation.

Prompts, resources, and skill

  • Prompts: audit_project_for_unpkg, convert_this_page, find_browser_package.
  • Resources: the conversion playbook and version-specifier policy (unpkg://guidance/…), also served at GET /playbook.md.
  • Skill: skill/unpkg/SKILL.md provides the same guidance to agents without MCP.

Connect a client

Clients connect by URL. Per-client configuration is in examples/clients.md and in the picker on the landing page at https://mcp.unpkg.com/.

Claude Code:

sh
claude mcp add --transport http unpkg https://mcp.unpkg.com/mcp

For agents without MCP, copy skill/unpkg/ into the client's skills directory. At the project level, you can also paste examples/AGENTS.snippet.md into your project's AGENTS.md.

Try it out

With an agent connected, some useful prompts:

  • "Resolve react@^18 with the UNPKG MCP — what's the resolved version and browser entry point? Now try a version of react that doesn't exist."
  • "List the files in [email protected]/dist, build a patch-policy URL for the module file, and verify it resolves."
  • "Audit this project for UNPKG conversion."
  • "Check this import map with the UNPKG MCP: …" (paste a map)
  • "Is [email protected] safe to load? Check it for malware and CVEs, and tell me what to upgrade to."
  • "Based on the audit, estimate the migration impact for a site with 1M page views a month at $0.09/GB."

The server reports what it can verify and declines what it can't: import maps are validated as a system, audits keep framework-managed packages bundled, and estimates come back as ranges with assumptions rather than a single figure.

MCP Registry

server.json in this repo is the listing manifest for the official MCP Registry, under the namespace io.github.unpkg/unpkg-mcp.

Publishing (maintainers): install the mcp-publisher CLI from the MCP Registry project, then from this repo:

sh
mcp-publisher login githubmcp-publisher publish

Note: the organization namespace requires an owner-level GitHub credential — the interactive device flow only grants your personal namespace. Use a classic PAT with read:org scope (see the MCP Registry authentication docs), and revoke it afterwards.

Releasing

The server is a remote endpoint, so most channels update themselves: connected clients see new tools as soon as the Worker deploys, Glama re-crawls this repo and the endpoint, skills.sh serves the skill from GitHub, and directory listings (awesome lists, mcp.so) are static entries that only change if the URL or description changes.

For a version release:

  1. Bump the version everywhere it appears, keeping all of them equal: package.json, src/version.ts, server.json, plugin/.claude-plugin/plugin.json, plugin/plugin.json, plugin/.codex-plugin/plugin.json, and the plugin entry in .claude-plugin/marketplace.json. (Tests fail if any of these drift.)
  2. Deploy the Worker (wrangler deploy).
  3. Tag the release on GitHub (vX.Y.Z with release notes).
  4. Republish the registry manifest: mcp-publisher publish. Downstream directories (PulseMCP, Smithery, and others) ingest from the official MCP Registry, so this is the step that updates them.
  5. If the plugin changed, publish the new plugin version in the Claude developer portal; marketplace users get it via claude plugin marketplace update.

Claude plugin

This repo is also a Claude Code plugin (and its own plugin marketplace). The plugin lives in plugin/ and bundles the MCP server above with the unpkg skill, so one install gives Claude Code both:

sh
claude plugin marketplace add unpkg/unpkg-mcpclaude plugin install unpkg@unpkg

Connecting the plugin is the same anonymous-by-default server at https://mcp.unpkg.com/mcp; Shield tools still sign in only when used.

Run it locally

sh
pnpm installpnpm dev          # HTTP Worker on http://localhost:8787

For local client setup, use the same configurations as above with http://localhost:8787/mcp in place of the production URL.

Develop

sh
pnpm test         # unit, golden-project, and MCP protocol testspnpm typecheck    # tsc --noEmitpnpm build        # wrangler deploy --dry-run (production bundle check)

Layout: src/clients/ (npm, UNPKG, and Shield API clients), src/domain/ (audit, import-map checking, estimation, guidance), src/server.ts (MCP wiring). Golden projects in test/fixtures/projects/ pin audit classification behavior.

Environment (wrangler.jsonc vars): UNPKG_ORIGIN, NPM_REGISTRY, SHIELD_API_ORIGIN, OAUTH_ISSUER, OAUTH_RESOURCE, OAUTH_ENABLED.

Estimating impact

audit_dependencies reports entry-file byte totals. estimate_migration_impact turns those, plus a traffic figure, into a bandwidth-offload range (and a dollar range when a $/GB rate is supplied). It does not forecast latency: where a site already serves from a capable CDN, latency is usually unchanged, and the practical gains are bundle size, cacheability, and how quickly patched versions reach users.

來源:README.md,提交 ec56586

工具

14

resolve_package

Resolve an npm 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.

輸入參數package必填version

list_files

List files in a package version

List the real files inside an exact or resolvable package version via UNPKG ?meta. Use this before choosing a file path; never guess paths.

輸入參數pathlimitpackage必填version

build_file_url

Build a canonical UNPKG file URL

Build a direct UNPKG file URL (the original file lookup) with a deliberate version policy, verifying the file exists when a path is given.

輸入參數filepolicypackage必填subpathversion

audit_dependencies

Audit dependencies for UNPKG conversion

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.

輸入參數frameworkdependencies必填existingImports

verify_url

Verify a UNPKG URL resolves

Check that a UNPKG file URL actually resolves (follows redirects) before you put it in a project.

輸入參數url必填

generate_importmap

Generate an import map for UNPKG packages

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.

輸入參數entries必填

check_importmap

Validate an import map as a system

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.

輸入參數imports必填framework

search_packages

Search npm for browser-suitable packages

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.

輸入參數limitquery必填

estimate_migration_impact

Rough bandwidth/cost impact of a conversion

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.

輸入參數browserCacheRatemonthlyPageViews必填bandwidthCostPerGbUsdunpkgBytesPerPageLoad必填

shield_whoami

Shield account for the logged-in user

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.

無需輸入參數。

shield_simulate_request

Simulate a Shield edge decision

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.

輸入參數pathoriginpackage必填refererversion必填

shield_check_packages

Malware verdicts and CVEs for package versions

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.

輸入參數packages必填

shield_domain_packages

Shield-observed packages on your domains

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.

輸入參數daysdomainincludeThreats

shield_watchlist_status

Your Shield watchlist, pins, and blocks

Return the logged-in org's monitored packages, blocklist entries, and pin policies as Shield currently holds them. Requires Shield login.

無需輸入參數。

版本歷史

1
  1. v1.0.0最新Nov 7, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分