Hacker News助手MCP工具
获取并处理Hacker News讨论,以便Claude生成高质量的摘要,处理评论结构和元数据以帮助Claude理解不同评论的相对重要性。
服务介绍
Hacker News Companion MCP
使用 Claude 对 Hacker News 讨论进行总结的模型上下文协议 (MCP)。
概述
此 MCP 用于获取和处理 Hacker News 的讨论,并将其准备成 Claude 可以使用的格式,以便生成高质量的总结。它不仅处理评论的层次结构,还处理其元数据(如得分、反对票等),帮助 Claude 理解不同评论之间的相对重要性和关系。
特性
- 处理 Hacker News 的 URL 或帖子 ID
- 从 HN 下载并分析评论结构
- 根据社区参与度对评论打分
- 为 Claude 的总结优化数据格式
安装
-
克隆仓库:
git clone https://github.com/yourusername/hn-companion-mcp.git cd hn-companion-mcp -
安装依赖项:
npm install
使用
命令行界面
node index.js <post-id-or-url>
示例:
node index.js 43448075
# or
node index.js https://news.ycombinator.com/item?id=43448075
API 服务器
启动服务器:
npm start
发起请求:
curl -X POST http://localhost:3000/api/summarize \
-H "Content-Type: application/json" \
-d '{"input": "https://news.ycombinator.com/item?id=43448075"}'
API 参考
POST /api/summarize
请求体:
{
"input": "https://news.ycombinator.com/item?id=43448075"
}
响应:
{
"status": "success",
"data": {
"systemPrompt": "...",
"userPrompt": "...",
"commentPathIdMapping": { ... },
"postTitle": "...",
"postId": "...",
"commentCount": 123
}
}
与 Claude 集成
此 MCP 设计用于为 Claude 准备数据以进行总结。当用户要求 Claude 总结 Hacker News 的讨论时,
Claude 可以调用这个 MCP 获取格式化的数据,然后根据提供的系统和用户提示生成摘要。
"hn-companion": {
"command": "node",
"args": ["<full path to src>/hn-companion-mcp/server.js"]
}
}
许可证
MIT