mcpField
H
Hacker News MCP Server

Hacker News MCP Server

本地服务
github.com/erithwik社交媒体7667 周前更新

关于 Hacker News MCP Server

Hacker News MCP Server 是一个用于获取 Hacker News 信息的 MCP 服务,可读取故事列表、评论、搜索结果和用户信息。它适合希望在助手中直接查阅 Hacker News 内容的用户。

主要功能

  1. 01获取 top、new、ask_hn、show_hn 故事列表
  2. 02获取故事的评论内容
  3. 03按关键词搜索故事
  4. 04查询用户信息与活动

适用场景

  1. 01让助手汇总当天的热门故事
  2. 02查看某个故事下的评论并生成摘要
  3. 03搜索 Hacker News 上关于某个主题的讨论

MCP 相关

该项目是 MCP 服务,向 MCP 客户端暴露 get_stories、get_story_info、search_stories 和 get_user_info 等工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"hn": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
启动命令npx -y @smithery/cli

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@smithery/cli

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

Hacker News MCP 服务

smithery badge

一个 Model Context Protocol(MCP)服务,提供用于获取 Hacker News 信息的工具。

mcp-hn MCP 服务

工具

  • get_stories 获取(top、new、ask_hn、show_hn)故事
  • get_story_info 获取与故事相关的评论
  • search_stories 根据查询搜索故事
  • get_user_info 获取用户信息

示例用法

使用如下提示词:

User: Get the top stories of today
  Output: Uses `get_stories` tool and returns a story about AI
User: What does the details of the story today that talks about the future of AI
  Output: Uses `get_story_info` tool based on the results of the previous tool
User: What has the user `pg` been up to?
  Output: Uses `get_user_info` tool and returns a summary of the user's activity
User: What does hackernews say about careers in AI?
  Output: Uses `search_stories` tool and returns a summary of the comments

下面是一个与 puppeteer MCP 服务配合使用的更详细示例:

User: What are the top stories of today?
  Output: Uses `get_stories` tool and returns a story about AI
User: Can you use the puppeteer tool to read the article about <AI> and also use the hackernews tool to view the comments and give me a summary of what the main comments are about the article?
  Output: Uses puppeteer tool to read the article about AI and then uses the `get_story_info` hn tool to get the comments and returns a summary of the comments

快速开始

通过 Smithery 安装

要通过 Smithery 为 Claude Desktop 自动安装 Hacker News MCP 服务:

npx -y @smithery/cli install mcp-hn --client claude
Claude Desktop:

更新以下文件:

在 MacOS 上:~/Library/Application\ Support/Claude/claude_desktop_config.json

在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json

在生产环境中使用以下配置:

{
  "mcpServers": {
    "mcp-hn": {
      "command": "uvx",
      "args": ["mcp-hn"]
    }
  }
}

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。