
Npm Advisor Mcp
io.github.YashviGupta15由 GitHub 账号 YashviGupta15 发布v0.1.3更新于 Oct 25, 2026
MCP server to search, compare, and recommend npm packages by size, popularity, and maintenance.
概览
一个本地 MCP 服务器,让助手按体积、流行度、维护状况和 TypeScript 支持搜索、比较、审计并推荐 npm 包。
- 可以做什么
- 按功能或关键词搜索 npm 包,返回带体积、下载量和质量评分的排序结果。并排比较 2–5 个包,并针对浏览器、Node、React 或 CLI 场景给出加权推荐。查看单个包的详细元数据、回答技术问题、查找替代包并检查是否已弃用。审计已知 CVE 漏洞,并生成 npm、yarn、pnpm 和 bun 的安装命令。从 GitHub、GitLab 或 Bitbucket 获取更新日志,并诊断某个包解析到的仓库地址与认证信息。
- 适用场景
- 适合在挑选 JavaScript 库时,希望基于体积、采用度、维护状况和安全性的证据做比较,而不是凭感觉决定。也适合从已弃用的包迁移,或检查某个依赖是否存在已知漏洞。
- 运行要求
- 以 npm 包形式通过 stdio 在本地运行,需要 Node.js 18+ 和 npm 9+。无需 API 密钥,但需要访问 npm registry、npm downloads、npm audit、npms.io、Bundlephobia 以及 GitHub/GitLab/Bitbucket 的网络。若处于会拦截 TLS 的代理后,可能需要通过 NODE_EXTRA_CA_CERTS 指定企业 CA 证书路径。
安装
在 SourceWeft 中
- 打开 控制台中的 Npm Advisor Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
npm-advisor-mcp
A Model Context Protocol (MCP) server that acts as an intelligent npm package advisor. Describe the feature you need, and it will search the registry, compare candidates, audit for vulnerabilities, and recommend the best library based on bundle size, popularity, maintenance, TypeScript support, and more.
Features
- Search by feature — describe what you need (e.g., "date manipulation", "PDF generation") and get ranked results
- Side-by-side comparison — compare 2–5 packages on key metrics in a clean table format
- Deep package details — full breakdown of a single package: README, dependencies, scores, links
- Weighted recommendations — algorithm-driven pick with dynamic weights per use case (browser, Node.js, React, CLI)
- Security audit — check for known CVEs with severity breakdown and patch availability
- Deprecation check — detect deprecated, abandoned, or unmaintained packages with a clear verdict
- Find alternatives — discover competing packages when migrating away from a deprecated library
- Install command generator — copy-paste commands for npm, yarn, pnpm, and bun with peer deps included
- Changelog viewer — fetch recent release notes from GitHub, GitLab (cloud + self-hosted), or Bitbucket
- Technical Q&A — ask specific questions about a package and get contextual answers from its metadata
- In-memory caching — all API responses are cached with TTL to eliminate redundant network calls
Architecture
Prerequisites
- Node.js 18+ (uses native
fetch) - npm 9+
No API keys required — all data sources are public and free.
Installation
Configuration (Kiro MCP)
Add this to your ~/.kiro/settings/mcp.json inside the "mcpServers" object:
After saving, the server will appear in the Kiro MCP panel and reconnect automatically.
Tools Reference
1. search_packages
Search npm for packages matching a feature or keyword.
Example prompt:
"Search for packages that handle PDF generation in Node.js"
Returns: Ranked list with description, weekly downloads, gzip size, quality/maintenance/popularity scores, and tree-shaking support.
2. compare_packages
Compare 2–5 packages side-by-side on all key metrics.
Example prompt:
"Compare dayjs, date-fns, and moment for date manipulation"
Returns: Markdown table with version, gzip size, minified size, downloads/week, TypeScript support, tree-shaking, dependency count, maintenance score, quality score, last publish date, and license.
3. get_package_details
Deep dive into a single package with full metadata.
Example prompt:
"Get details about the zod package"
Returns: Version, description, quick stats table (downloads, sizes, deps, TS support, license, publish date), quality scores, dependency list, peer dependencies, links, keywords, and a README excerpt.
4. recommend_package
Get a weighted recommendation from a list of candidates. Scoring weights automatically adjust based on your target environment.
Example prompt:
"Recommend a date library from dayjs, date-fns, moment, and luxon for a browser app — must be under 10KB gzipped"
Returns: Winner with rationale, runner-up alternatives, a detailed score breakdown table, and a license compatibility column.
Default Scoring Weights (general)
Use Case Weight Adjustments
5. resolve_technical_doubt
Answer a specific technical question about a package.
Example prompts:
"Does dayjs support timezone conversion out of the box?" "Is lodash tree-shakeable?" "What are the peer dependencies of @angular/material?" "Is chalk still actively maintained?"
Returns: Contextual answer pulling from metadata, bundle analysis, dependency tree, scores, and README content. Automatically detects question category (size, TypeScript, dependencies, maintenance, tree-shaking) and surfaces relevant data.
6. audit_package
Check a package for known security vulnerabilities.
Example prompt:
"Are there any known vulnerabilities in lodash?"
Returns: Total vulnerability count, severity breakdown (critical/high/moderate/low), per-CVE details with affected version ranges, patch availability, advisory links, and a deprecation warning if applicable.
7. find_alternatives
Find similar or competing packages as alternatives to a given one.
Example prompts:
"Find alternatives to moment.js" "What can I use instead of request?"
Returns: Ranked list of alternatives with descriptions, weekly downloads, bundle sizes, quality scores, and tree-shaking support. Flags if the original package is deprecated.
8. check_deprecation
Detect if a package is deprecated, unmaintained, or potentially abandoned.
Example prompts:
"Is request still maintained?" "Is moment.js deprecated?"
Returns: npm deprecation flag, days since last publish, maintenance score, weekly downloads, and a clear verdict — actively maintained / moderately stale / potentially abandoned / officially deprecated.
9. generate_install_command
Generate ready-to-paste install commands across all major package managers.
Example prompts:
"Give me the install command for @tanstack/react-query" "How do I install eslint as a dev dependency with pnpm?"
Returns: Install commands for npm, yarn, pnpm, and bun. Automatically appends peer dependencies and adds a separate @types/ install block if the package lacks built-in TypeScript types.
10. get_changelog
Fetch recent release notes for a package from its git repository. Supports GitHub, GitLab (cloud and self-hosted), and Bitbucket.
Example prompts:
"What changed in the last few versions of zod?" "Show me the recent releases for vite" "What's new in @ATLAS/info-panel?"
Returns: Release history with version tags, publish dates, and formatted release notes (truncated at 800 chars per release).
Git host detection
The tool reads the repository field from the package's package.json and auto-detects the host:
Note for private/internal packages: The tool reads the
repositoryfield from the package metadata fetched from your registry. If your internalpackage.jsondoesn't include arepositoryfield, or uses an SSH URL likegit@internal-git:atlas/info-panelwithout a recognisable hostname, the tool won't be able to detect the host. Add a full HTTPS URL to fix this:
11. check_registry (diagnostic)
Shows which registry URL and auth credentials the server resolves for a given package name, based on ~/.npmrc. Run this first when debugging private registry access.
Example prompt:
"Check registry for @ATLAS/info-panel"
Returns: Resolved registry URL, whether an auth token was found, and guidance if it's resolving to the public registry unexpectedly.
Data Sources
All requests include timeouts (10–15s) and graceful fallbacks — if one API is slow or unavailable, the tool still returns partial results rather than failing. Responses are cached in-memory to avoid redundant calls within a session.
Private Registry Support (.npmrc)
The server reads ~/.npmrc directly to resolve the registry URL and auth token for each package. No shell subprocess is involved — it parses the file the same way npm does, so it works regardless of how the MCP server process was spawned.
This means scoped private packages like @your-company/some-lib work out of the box as long as your .npmrc is configured correctly — for example:
Scope names in .npmrc are matched case-insensitively — @ATLAS, @atlas, and @Atlas all match the same entry.
Registry resolution logic
For every package fetch, the server:
- Reads
~/.npmrcand looks for a scoped registry override matching the package scope (e.g.@ATLAS:registry=...) - If found, uses that registry URL with the corresponding auth token
- If not found, uses the default
registryvalue from.npmrc(orregistry.npmjs.orgif not set) - If the resolved registry fails and it wasn't already the public registry, automatically retries against
registry.npmjs.org— so public packages always work even if a custom default registry is configured
Use the check_registry tool to verify what registry and auth the server resolves for any package before running other tools.
Public vs private package support
For private packages, tools that depend on bundlephobia or npms.io (search_packages, find_alternatives, bundle size in comparisons) will show N/A for those fields but will still return all registry metadata correctly.
Caching
All API responses are cached in-memory with tiered TTLs:
The cache is process-scoped — it resets when the MCP server restarts.
Development
Project Scripts
Tech Stack
Zero runtime dependencies beyond the MCP SDK and zod. No database, no external auth.
How It Works
- User asks a question in Kiro (e.g., "find me a library for CSV parsing")
- Kiro routes to the appropriate tool based on the prompt
- The tool checks the in-memory cache — returns instantly if data is fresh
- On cache miss, fetches live data from npm registry, npms.io, bundlephobia, and GitHub in parallel
- Results are scored, formatted, and returned as structured markdown
- Kiro presents the answer in the chat with tables, scores, and actionable recommendations
The server runs as a stdio process — Kiro spawns it on demand and communicates via JSON-RPC over stdin/stdout.
Extending
To add a new tool:
- Create
src/tools/your-tool.tswith a handler function - Register it in
src/index.tsusingserver.tool(name, description, zodSchema, handler) - Add the tool name to
autoApproveinmcp-config.json - Rebuild:
npm run build
To add a new data source:
- Create
src/services/your-source.tswith fetch functions - Wrap responses with
cache.set/cache.getfromservices/cache.ts - Import and use it in the relevant tool handlers
- Add timeout + graceful fallback for resilience
Troubleshooting
If running behind a corporate proxy that intercepts HTTPS (e.g., Zscaler), add your corporate CA certificate to the MCP config:
This is the recommended fix. Node's native fetch does not respect NODE_TLS_REJECT_UNAUTHORIZED=0 in all cases, and disabling TLS verification entirely is a security risk. Using NODE_EXTRA_CA_CERTS adds your corporate CA to Node's trust store without disabling verification for everything else.
To find your corporate CA cert path, check with your IT team or look in your system certificate store. On Windows it is typically exported from certmgr.msc → Trusted Root Certification Authorities.
If you also need an explicit proxy:
License
ISC
来源:npm-advisor-mcp/README.md,提交 d6f033d
工具
0版本历史
1- v0.1.3最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。