MCP 案例 | 本地搭建HackerNews-mcp-server
HackerNews API 提供了获取Hacker News网站数据的接口,用户可以通过GitHub上的API文档进行访问。此外,MCP hn_server是一个基于Node.js的服务器项目,允许用户获取Hacker News上的不同类型故事(如热门、最新、问答、展示、工作等),并返回结构化数据,包括标题、URL、点赞数、作者、时间戳和评论数。安装步骤包括克隆GitHub仓库、安装依赖、构建服
·
HackerNews接口
Hacker News:https://news.ycombinator.com/
HackerNews API: https://github.com/HackerNews/API
MCP hn_server: https://github.com/pskill9/hn-server
1. Hackernews-mcp-server: hn_server安装步骤
1.1 Features - 功能
- Fetch different types of stories (top, new, ask, show, jobs)
获取不同类型的故事(top, new, ask, show, jobs) - Get structured data including titles, URLs, points, authors, timestamps, and comment counts
特性获取结构化数据,包括标题,url,点,作者,时间戳和评论数可配置的故事数量 - Configurable limit on number of stories returned
限制返回 - Clean error handling and validation
干净的错误处理和验证
2. 安装
2.1 下载包
git clone https://github.com/pskill9/hn-server.git
2.2 安装依赖
npm install
2.3 Build server
npm run build
- 配置mcp-server
"hn-server": {
"command":"cmd",
"args":["/c","node","D:\\AIClass\\MCP\\hackernews-mcp-server\\build\\index.js\\"]
}
- 测试效果
我将为您获取Hacker News的热门新闻。
Ran tool 以下是Hacker News的热门新闻:
GNU Screen存在多个安全问题
- 链接:https://www.openwall.com/lists/oss-security/2025/05/12/1
- 99点赞,42条评论
- 作者:st_goliath
美国如何放弃了科学超级大国的地位
- 链接:https://steveblank.com/2025/05/13/how-the-united-states-became-a-science-superpower-and-how-quickly-it-could-crumble/
- 31点赞,3条评论
- 作者:enescakir
AI就像一个糟糕的顾问
- 链接:https://lukekanies.com/writing/ai-is-like-a-crappy-consultant/
- 33点赞,5条评论
- 作者:gpi
Ask HN: 你是如何获得第一百个用户的?
- 链接:https://news.ycombinator.com/item?id=43970837
- 182点赞,125条评论
- 作者:amanchanda
为什么咖啡渍在边缘更深?
- 链接:https://www.why.is/svar.php?id=5513
- 39点赞,18条评论
- 作者:michalpleban
如果软件优化是优先事项,世界可以在更老的硬件上运行
- 链接:https://twitter.com/ID_AA_Carmack/status/1922100771392520710
- 139点赞,119条评论
- 作者:turrini
FastVLM: 视觉语言模型的高效视觉编码
- 链接:https://github.com/apple/ml-fastvlm
- 297点赞,52条评论
- 作者:nhod
Mozilla Firefox - 官方GitHub仓库
- 链接:https://github.com/mozilla-firefox/firefox
- 583点赞,318条评论
- 作者:thefilmore
Launch HN: Miyagi (YC W25) 将YouTube视频转变为在线互动课程
- 链接:https://news.ycombinator.com/item?id=43972425
- 2点赞,0条评论
- 作者:bestwillcui
反人员计算 (2023)
- 链接:https://erratique.ch/writings/anti-personnel-computing
- 54点赞,18条评论
- 作者:transpute
更多推荐
所有评论(0)