npm-trends-mcp
npm-trends-mcp
面向AI助手的npm包趋势数据 追踪任意npm包的每周下载量。包下载趋势能够揭示开发者正在采用哪些JavaScript库和框架、哪些正在失势、以及生态系统的未来走向。
完整文档和在线演示: https://trendsmcp.ai/npm-trends
属于 Trends MCP 的一部分 —— 提供来自12+来源的实时趋势数据的MCP服务器。 查看主仓库:https://github.com/trendsmcp/trends-mcp
快速入门(两步完成)
第一步: 在 trendsmcp.ai 免费获取API密钥 每天100次请求,无需信用卡。
第二步: 添加到你的AI客户端(替换YOUR_API_KEY):
Cursor / Windsurf / Cline (~/.cursor/mcp.json 或等效文件)
{
"mcpServers": {
"trends-mcp": {
"url": "https://api.trendsmcp.ai/mcp",
"transport": "http",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}VS Code / GitHub Copilot (.vscode/mcp.json)
{
"servers": {
"trends-mcp": {
"type": "http",
"url": "https://api.trendsmcp.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}Claude Desktop (claude_desktop_config.json)
用户 → 设置 → 开发者 → 编辑配置 —— 添加到 mcpServers 中
{
"mcpServers": {
"trends-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.trendsmcp.ai/mcp",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer YOUR_API_KEY"
}
}
}
}Claude.ai(浏览器) Settings -> Connectors -> Add custom connector:
https://api.trendsmcp.ai/mcpRelated MCP server: npm-trends-mcp
示例查询
连接后,向你的AI提问:
get_trends(keyword='react', source='npm', data_mode='weekly')可用工具
工具 | 功能说明 |
| 获取该来源中某个关键词的时间序列数据 |
| 获取1周、1个月、3个月、6个月、1年等时期的增长率 |
| 获取该来源当前的热门趋势 |
| 按搜索量排名获取热门话题 |
常见问题
Trends MCP 返回哪些npm数据?
返回任意npm包的每周下载量,标准化为0-100的分数,同时包含原始下载量、标准周期(7天、1个月、3个月、1年)的增长率,以及最长可达5年的历史时间序列数据。
如何查询特定包?
请使用准确的npm包名称 —— 例如'react'、'lodash'、'express'或'@anthropic-ai/sdk'。作用域包使用@org/package格式。
能否比较多个包?
可以。使用get_growth并传入逗号分隔的包名,或分别为每个包调用get_trends并比较标准化后的序列。在框架比较中尤为实用,如React vs Vue vs Svelte。
npm数据对投资研究有何价值?
npm下载趋势是开发者生态系统采用情况的领先指标。某个库下载量快速增长,往往预示着其底层平台或框架即将迎来更广泛的商业应用。
npm下载数据如何标准化?
原始周下载量会根据包自身的历史峰值标准化为0-100的得分。这使得即使下载量绝对值差异巨大的不同包之间,也能够比较采用速度。
所有数据来源
Trends MCP 一次连接覆盖12+来源: 谷歌搜索、YouTube、TikTok、Reddit、亚马逊、维基百科、 新闻情绪、网站流量、应用下载、Steam、npm等。
浏览全部:https://trendsmcp.ai/data-sources
同样支持作为Python客户端使用
相同的API密钥可直接在Python中使用 —— 无需MCP主机。
pip install npm-trends-mcpimport os
from npm_trends_mcp import TrendsMcpClient, SOURCE
client = TrendsMcpClient(api_key=os.environ["TRENDSMCP_API_KEY"])
series = client.get_trends(source=SOURCE, keyword="your keyword")
growth = client.get_growth(source=SOURCE, keyword="your keyword", percent_growth=["1M", "3M", "12M"])
top = client.get_top_trends(type="Npm", limit=10)完整Python文档:trendsmcp.ai/docs
许可证
MIT © Trends MCP
Available Tools
3 toolsget_growthARead-onlyIdempotentInspect
Point-to-point growth for a keyword on one or more sources. Each window is a preset string (12M, 3M, YTD, and the other listed periods). Values are on a 0-100 scale, plus absolute volume when available. Prefer this over get_time_series for growth questions. app downloads and app rankings are keyword sources (Android bundle ID). They are not the App Store / Google Play live boards on get_top_trends. If the request is rate limited or the monthly quota is used up, tell the user their plan limit is reached.
Inputs: source (required), keyword (required), percent_growth. Returns: result
get_time_seriesARead-onlyIdempotentInspect
Full historical series for one keyword and one source (0-100 values, plus volume when available). Use for charting or custom math. Not for live 'what's trending now' boards (use get_top_trends). For most growth questions, use get_growth. If the request is rate limited or the monthly quota is used up, tell the user their plan limit is reached.
Inputs: source (required), keyword (required). Returns: result
get_top_trendsARead-onlyIdempotentInspect
Live top-trending board for exactly one feed type. No keyword. For 'Amazon Best Sellers by Category', 'Google Trends by Category', 'Top Websites', and 'Substack by Category', always pass category. Default sort is current rank. Use sort='rank_change' for climbers vs a prior snapshot (window 1d, 3d, 7d, 14d, or 30d). App Store Top Free, App Store Top Paid, and Google Play are live store boards, not keyword lookups. For an app's history use get_growth or get_time_series with source app downloads or app rankings and an Android bundle ID. Do not use get_time_series for live boards. If the request is rate limited or the monthly quota is used up, tell the user their plan limit is reached.
Inputs: type (required), sort, limit, offset, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The tools are largely distinct: get_top_trends targets live boards, while get_growth and get_time_series both handle historical keyword data and could be confused. However, the descriptions explicitly separate 'point-to-point growth' from 'full historical series' and tell agents which to prefer, so the boundary is workable.
All three tools follow a clean get_<noun> pattern: get_growth, get_top_trends, get_time_series. There is no mixing of styles or inconsistent verbs, making the naming predictable and easy to navigate.
Three tools is a focused, sensible scope for a trends data server. Each tool covers a distinct core user need: current top boards, point-to-point growth, and full time-series data, so each earns its place.
The set covers the main trend-related workflows: live rankings, growth comparisons, and historical charting data. Minor gaps exist, such as no explicit endpoint for listing available feeds, categories, or discovering keywords, but agents can work around those with known values and guidance in the descriptions.
Maintenance
Related MCP Connectors
npm package download trends and adoption growth over time. Free key at trendsapi.ai
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Provide AI-powered real-time analysis and intelligence on NPM packages, including security, depend…
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides comprehensive contextual information about npm packages including README files, versions, dependencies, download statistics, and search functionality. Enables users to explore and analyze npm packages through natural language queries with intelligent GitHub README fetching and branch fallback.9MIT
- AlicenseNot gradedqualityCmaintenanceProvides weekly download counts and trend data for npm packages, enabling comparison of adoption velocity across JavaScript libraries.MIT
- AlicenseAqualityDmaintenanceEnables AI coding agents to search the npm registry and retrieve package metadata, READMEs, download stats, GitHub details, and usage snippets via the Model Context Protocol.914 npmMIT
- AlicenseBqualityDmaintenanceEnables querying NPM package download statistics, metadata, and dependency information through natural language.2MIT