小贴士:按下Ctrl+D 或 ⌘+D,一键收藏本站,方便下次快速访问!
MIT License
0
最近更新:7天前

MCP for Hacker News 伴侣

Hacker News 伴侣 MCP

smithery 标记
Hacker News 伴侣 MCP 服务器

一个使用 Claude 总结 Hacker News 讨论的模型上下文协议 (MCP)。

概述

该 MCP 获取并处理 Hacker News 讨论,将其格式化为 Claude 可以用来生成高质量摘要的形式。它处理了评论的层次结构及其元数据(评分、负票数等),以帮助 Claude 理解不同评论之间的相对重要性和关系。

功能

  • 处理 Hacker News URL 或帖子 ID
  • 下载并分析来自 HN 的评论结构
  • 基于社区参与度对评论进行评分
  • 格式化优化为 Claude 摘要的数据

安装

通过 Smithery 安装

要通过 Smithery 自动安装 Hacker News 伴侣用于 Claude Desktop:

bash 复制代码
npx -y @smithery/cli install @georgeck/hn-companion-mcp --client claude

手动安装

  1. 克隆仓库:

    复制代码
    git clone https://github.com/yourusername/hn-companion-mcp.git
    cd hn-companion-mcp
  2. 安装依赖:

    复制代码
    npm install

使用

CLI

bash 复制代码
node index.js <post-id-or-url>

示例:

bash 复制代码
node index.js 43448075
# 或
node index.js https://news.ycombinator.com/item?id=43448075

API 服务器

启动服务器:

bash 复制代码
npm start

发送请求:

bash 复制代码
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

请求体:

json 复制代码
{
  "input": "https://news.ycombinator.com/item?id=43448075"
}

响应:

json 复制代码
{
  "status": "success",
  "data": {
    "systemPrompt": "...",
    "userPrompt": "...",
    "commentPathIdMapping": { ... },
    "postTitle": "...",
    "postId": "...",
    "commentCount": 123
  }
}

与 Claude 集成

该 MCP 设计用于为 Claude 提供摘要所需的数据。当用户要求 Claude 总结 Hacker News 讨论时,Claude 可以调用此 MCP 获取格式化的数据,并基于提供的系统和用户提示生成摘要。

json 复制代码
"hn-companion": {
      "command": "node",
      "args": ["<full path to src>/hn-companion-mcp/server.js"]
    }
  }

许可证

MIT