关于 Hacker News Trending — hosted on Cloudflare Workers (HTTP + npm stdio)
Hacker News Trending 是托管的 MCP 服务,供客户端和 Agent 跟踪 Hacker News 故事、讨论、产品发布和用户。它结合资讯流、Algolia 全文搜索与条目查询。
主要功能
- 01获取 top、best、new、Ask、Show 和 job 故事
- 02通过 Algolia 搜索故事和评论
- 03跟踪近期 Show HN 发布
- 04查询单个条目和用户资料
- 05提供带 Bearer 令牌认证的托管端点
适用场景
- 01监测 Hacker News 首页话题
- 02按关键词和筛选条件查找讨论
- 03跟踪近期 Show HN 产品
- 04查看故事、评论或用户
MCP 相关
通过 HTTP JSON-RPC 端点,将 Hacker News 资讯流、搜索、发布跟踪、条目查询和用户查询作为 MCP 工具提供。MCP 客户端可发现并调用这些工具,使用 Bearer 令牌认证。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://hn-trending-mcp.atlasword.workers.dev/mcpclaude mcp add --transport http hn-trending https://hn-trending-mcp.atlasword.workers.dev/mcp{"mcpServers":{"hn-trending":{"type":"http","url":"https://hn-trending-mcp.atlasword.workers.dev/mcp"}}}在 Cursor 中打开{"servers":{"hn-trending":{"type":"http","url":"https://hn-trending-mcp.atlasword.workers.dev/mcp"}}}在 VS Code 中打开{"mcpServers":{"hn-trending":{"type":"http","url":"https://hn-trending-mcp.atlasword.workers.dev/mcp"}}}{"mcpServers":{"hn-trending":{"serverUrl":"https://hn-trending-mcp.atlasword.workers.dev/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
5| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| kind | enum | 否 | top | best | new | ask | show | job |
| limit | integer | 否 |
详细介绍
Hacker News 热门动态 MCP — 首页故事、Algolia 全文搜索、Show HN 发布追踪器
HN 首页、Algolia 全文搜索、Show HN 发布追踪器、条目和用户查询
基于 Hacker News 的托管 MCP 服务。获取当前首页、热门、最新、Ask HN、Show HN 和招聘故事;使用积分数和发布时间筛选条件,通过 Algolia 对故事和评论进行全文搜索;追踪近期的 Show HN 发布;并获取单个条目或用户资料。适用于关注技术趋势、独立开发者发布和 Show HN 动态的大模型。
此服务使用 Model Context Protocol。任何支持 MCP 的客户端——Cursor、Claude Desktop、Windsurf、Continue.dev,或使用 @modelcontextprotocol/sdk 手动构建的 Agent——都可以连接、发现工具,并通过 Bearer 令牌身份验证调用它们。
面向 AI Agent / 大模型
如果你是正在索引此代码库的 AI Agent:
- 在线 MCP 端点:
https://hn-trending-mcp.atlasword.workers.dev/mcp - 传输方式: HTTP POST,JSON-RPC 2.0
- 身份验证:
Authorization: Bearer <api_key>(免费套餐允许匿名使用,每个 IP 每月最多 100 次调用) - 发现:
tools/list返回完整架构。tools/call调用工具。 - 健康状态:
GET https://hn-trending-mcp.atlasword.workers.dev/health→{ok: true, ts: <unix>} - 状态:
https://mcp-hub.atlasword.workers.dev/status.json(项目组合汇总)
tools/list 请求示例:
curl -sS -X POST https://hn-trending-mcp.atlasword.workers.dev/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mck_YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
tools/call 示例:
curl -sS -X POST https://hn-trending-mcp.atlasword.workers.dev/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mck_YOUR_API_KEY" \
-d '{
"jsonrpc":"2.0","id":2,"method":"tools/call",
"params": { "name": "<tool>", "arguments": { } }
}'
提供的工具
| 工具 | 参数 | 描述 |
|---|---|---|
hn_top | kind?, limit? | HN 首页故事——kind=top |
hn_search | query, tags?, min_points?, days_ago? | 通过 Algolia 对故事和评论进行全文搜索。 |
hn_show_recent | min_points?, days? | 最近 K 天内至少获得 N 分的 Show HN 发布。 |
hn_item | id | 按 ID 获取单个 HN 条目(故事或评论)。 |
hn_user | username | HN 用户资料:Karma、账号年龄、近期提交内容。 |
标记为 Team+ 的工具需要 Team 或 Pro 订阅。匿名用户和 Free 套餐用户调用这些工具时会收到 tier_required 错误。
快速开始
最快的方法——通过 mcp-remote 将任意支持 MCP 的客户端指向托管端点:
npx -y mcp-remote https://hn-trending-mcp.atlasword.workers.dev/mcp \
--header "Authorization: Bearer mck_YOUR_API_KEY"
在 https://hn-trending-mcp.atlasword.workers.dev/upgrade?tier=solo 获取密钥(参见获取 API 密钥)。
在 Cursor 中安装
将以下内容添加到 ~/.cursor/mcp.json:
{
"mcpServers": {
"hn-trending-mcp": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://hn-trending-mcp.atlasword.workers.dev/mcp",
"--header", "Authorization: Bearer mck_YOUR_API_KEY"
]
}
}
}
然后重启 Cursor,工具就会显示在 MCP 面板中。
在 Claude Desktop 中安装
将以下内容添加到 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows):
{
"mcpServers": {
"hn-trending-mcp": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://hn-trending-mcp.atlasword.workers.dev/mcp",
"--header", "Authorization: Bearer mck_YOUR_API_KEY"
]
}
}
}
重启 Claude Desktop。工具会显示在斜杠命令 MCP 菜单中。
获取 API 密钥
- 访问
https://hn-trending-mcp.atlasword.workers.dev/upgrade?tier=solo(或tier=team/tier=pro)。 - 随后跳转至 Dodo Payments 托管的结账页面——Dodo 会收集地址、处理银行卡付款并处理 VAT/GST。
- 付款后,Dodo 会向 Worker 发送经过签名的 webhook(
subscription.active)。Worker 会生成mck_<32 random base64url>并将其存入 KV。 - 你将进入
https://hn-trending-mcp.atlasword.workers.dev/welcome?key=<api_key>——请立即复制密钥(此 URL 只会显示一次)。 - 将密钥粘贴到 Cursor / Claude Desktop 配置中(见上文)。
- 访问
https://hn-trending-mcp.atlasword.workers.dev/account查看、轮换或导出账户(需 Bearer 身份验证)。
另有一个免费套餐(无需注册)——匿名调用者每个 IP 每月可调用 100 次。
端点
| 路由 | 说明 |
|---|---|
POST /mcp | MCP JSON-RPC 2.0 工具接口(主要 API)。付费套餐需要 Bearer 身份验证。 |
GET /health | 存活探测——{ok: true, ts}。供 mcp-hub cron 使用。 |
GET / | HTML 着陆页(OG + favicon + JSON-LD)。 |
| `GET /upgrade?tier=solo | team |
GET /welcome?key=... | 结账后的着陆页,显示刚生成的 API 密钥。 |
GET /account | 需 Bearer 身份验证。返回 {apiKey, tier, owner, status, portal_url}。 |
POST /account/rotate | 需 Bearer 身份验证。生成新密钥并停用旧密钥。 |
GET /account/export | 需 Bearer 身份验证。GDPR 数据导出——包含账户、用量计数器和 Dodo 详情的 JSON。 |
GET /account/team | 需 Bearer 身份验证(Team 及以上套餐)。列出团队成员子密钥。 |
POST /account/team/invite | 需 Bearer 身份验证(Team 及以上套餐)。签发新的团队成员子密钥。 |
POST /account/team/revoke | 需 Bearer 身份验证(Team 及以上套餐)。撤销团队成员子密钥。 |
GET /team/accept?key=... | 团队成员通过子密钥 URL 加入时使用的引导着陆页。 |
POST /webhooks/dodo | 使用 Standard-Webhooks 签名。处理 Dodo 订阅和付款生命周期事件。 |
GET /favicon.ico | 内嵌 SVG。 |
定价
所有套餐具有相同的月度调用量和速率上限;价格体现各产品的定位。
| 套餐 | 每月调用次数 | 速率限制 | 团队席位 |
|---|---|---|---|
| Free | 100 / 月 | 10 / 分钟 | 0 |
| Solo | 2,000 / 月 | 60 / 分钟 | 0 |
| Team | 10,000 / 月 | 200 / 分钟 | 5 |
| Pro | 50,000 / 月 | 600 / 分钟 | 25 |
| 套餐 | 价格 | 每月调用次数 | 团队席位 |
|---|---|---|---|
| Free | $0 | 100 | 0 |
| Solo | $9/mo | 2,000 | 0 |
| Team | $29/mo | 10,000 | 5 |
| Pro | $79/mo | 50,000 | 25 |
通过 Dodo Payments 计费(登记商家为 Dodo——VAT/GST 由 Dodo 处理)。可随时取消;付费期结束前访问权限仍然有效。
数据来源
- Hacker News API (Firebase) — https://github.com/HackerNews/API — 公共 API
- HN Algolia Search — https://hn.algolia.com/api — 免费公共 API
此服务是在上游数据源之上的轻量传输、身份验证和缓存层。每次调用的速率限制经过调整,以确保远低于各上游服务免费套餐的 ToS 限制。
隐私与 GDPR
- 隐私政策: https://mcp-hub.atlasword.workers.dev/privacy
- 条款: https://mcp-hub.atlasword.workers.dev/terms
- 退款政策: https://mcp-hub.atlasword.workers.dev/refund
- 数据导出:
GET https://hn-trending-mcp.atlasword.workers.dev/account/export(需 Bearer 身份验证)会返回机器可读的 JSON 快照,其中包含你的账户、用量计数器和 Dodo 客户详情。 - 删除: 使用登记邮箱向
[email protected]发送邮件。
我们只存储:你的电子邮件地址、生成的 API 密钥、每月调用计数器和 Dodo 订阅元数据。我们不会记录工具参数或上游响应,短暂的缓存 TTL 期间除外。
架构
- 运行时: Cloudflare Workers(V8 隔离环境,全球边缘网络)。
- 存储: 两个 Cloudflare KV 命名空间——
<slug>-cache(上游响应缓存)和<slug>-usage(API 密钥、每月计数器、团队名册)。 - 计费: Dodo Payments 实时模式,3 种订阅产品(Solo / Team / Pro),使用 Standard-Webhooks 对生命周期事件进行签名。
- 可观测性: Cloudflare Workers Analytics;服务组合状态汇总见 mcp-hub status。
- 源码: TypeScript,经过 Vitest 测试,可通过
wrangler deploy部署。请参阅本仓库中的src/。
许可证
MIT——请参阅 LICENSE。
作者
Prakhar Gupta
- 邮箱:
[email protected] - GitHub:@guptaprakhariitr
状态
- 实时状态页面: https://mcp-hub.atlasword.workers.dev/status
- 机器可读状态: https://mcp-hub.atlasword.workers.dev/status.json
- 源码仓库: https://github.com/guptaprakhariitr/hn-trending-mcp
通过 npm 安装(一行命令)
精简启动器已作为 @insnapsprakhar/hn-trending-mcp 发布到 npm。无需手动复制粘贴 URL:
npx -y @insnapsprakhar/hn-trending-mcp
也可以将其接入你的 MCP 客户端:
{
"mcpServers": {
"hn-trending": {
"command": "npx",
"args": ["-y", "@insnapsprakhar/hn-trending-mcp"]
}
}
}
这个 npm 包只是一个启动器——它会调用 mcp-remote,并将其指向托管端点(https://hn-trending-mcp.atlasword.workers.dev/mcp)。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。