pskill9/hn-server logo

pskill9/hn-server

Free

解析 news.ycombinator.com (Hacker News) 的 HTML 内容,并为不同类型的故事提供结构化数据。

FreeFree tier
Type
Open Source

About pskill9/hn-server

A Model Context Protocol (MCP) server that parses HTML from news.ycombinator.com and provides structured data for different types of Hacker News stories (top, new, ask, show, jobs). Built with TypeScript, Axios, and Cheerio, it returns detailed story information including titles, URLs, points, authors, timestamps, comment counts, and rank. Supports configurable story limits (1-30) and clean error handling. Designed for integration with MCP-compatible clients like Claude to enable natural language queries to Hacker News.

Key Features

Fetch different types of stories (top, new, ask, show, jobs)
Get structured data including titles, URLs, points, authors, timestamps, and comment counts
Configurable limit on number of stories returned (1-30, default 10)
Clean error handling and validation
Built with TypeScript, Model Context Protocol SDK, Axios, and Cheerio

Pros & Cons

Pros
  • Free and open source (MIT license)
  • Easy to set up with Claude desktop app or VSCode extension
  • Supports multiple story categories in one tool
  • Returns detailed, structured JSON for each story
  • Configurable number of results per request
Cons
  • Only fetches from Hacker News (limited to that single source)
  • Requires Node.js runtime and an MCP-compatible client
  • Maximum of 30 stories returned per request

Best For

Integrating Hacker News data into AI assistants and chatbotsFetching top stories for analysis or reportingBuilding dashboards to track Hacker News trendsAutomating retrieval of specific story types like Show HN or Ask HNNatural language interaction with Hacker News via Claude

FAQ

How do I install the Hacker News MCP server?
Clone the repository (git clone https://github.com/pskill9/hn-server), install dependencies with npm install, then build with npm run build.
How do I configure the server with Claude?
Add the server configuration to your MCP settings file (e.g., claude_desktop_config.json) with command 'node' and args pointing to the built index.js file.
What story types are supported?
The tool supports 'top', 'new', 'ask', 'show', and 'jobs' story types, with 'top' as the default.
What is the output format of a story?
Each story object includes title, url (optional), points, author, time (ISO timestamp), commentCount, and rank.