npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mcp-hacker-news

v1.0.3

Published

Hacker News MCP Server

Readme

mcp-hacker-news

A Model Context Protocol (MCP) server for Hacker News built with TypeScript.

This MCP server acts as a bridge between the official Hacker News API and AI-powered tools that support the Model Context Protocol, such as Claude and Cursor.

It enables these tools to fetch and interact with live Hacker News data (posts, comments, users) via standardized MCP endpoints.

Usage with Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "mcp-hacker-news": {
      "command": "npx",
      "args": ["-y", "mcp-hacker-news"]
    }
  }
}

Demo: Claude using MCP Hacker News

Features

  • Integrates with the official Hacker News API to fetch posts, comments, and user information.
  • Exposes standard Model Context Protocol endpoints for seamless integration with Claude, Cursor, and other LLM-based tools.
  • Fetches the latest Hacker News data for AI and automation workflows.

Requirements

  • Node.js version 18 or higher is required.
  • npm or pnpm as a package manager.

⚠️ If you are unsure about your Node.js version, run node --version in your terminal. Make sure it shows v18.x.x or higher.
How to upgrade Node.js


Want to contribute? Just follow the steps below

Clone the repository and install dependencies:
git clone https://github.com/paablolc/mcp-hacker-news.git
cd mcp-hacker-news
pnpm install
pnpm build
  • To test the server with the MCP Inspector:
pnpm inspector
  • or, if running from the source:
npx @modelcontextprotocol/inspector node dist/index.js

mcp-inspector

Resources

This MCP server exposes the following fixed resources, each corresponding to a core Hacker News endpoint:

| Resource URI | Description | Hacker News API Endpoint | | ------------------- | -------------------------- | ------------------------ | | hackernews://top | Top stories | /v0/topstories | | hackernews://new | Newest stories | /v0/newstories | | hackernews://best | Best (algorithmic) stories | /v0/beststories |

These three collections match the main list endpoints officially provided by the Hacker News API.
Other types of stories (Ask HN, Show HN, Jobs, etc.) and item-specific lookups are available as tools (see below), allowing for flexible querying with custom parameters.

Tools

The following tools are available for advanced or parameterized queries. These allow you to fetch other Hacker News content beyond the fixed resources above:

| Tool Name | Description | | ------------------ | ----------------------------------------------- | | getTopStories | Fetch top stories (customizable limit) | | getBestStories | Fetch best stories (customizable limit) | | getNewStories | Fetch newest stories (customizable limit) | | getAskHNStories | Fetch "Ask HN" posts | | getShowHNStories | Fetch "Show HN" posts | | getJobStories | Fetch job postings | | getItem | Retrieve a specific item (story, comment, etc.) | | getUser | Retrieve a user profile by username | | getComments | Fetch comments for a specific item | | getMaxItemId | Get the current maximum item ID | | getUpdates | Fetch recently updated items and profiles |

Check the code or inline documentation for supported arguments and usage examples for each tool.


Tip:
Make sure you have pnpm installed for development setup.
You can substitute npm or yarn if you prefer, but pnpm is recommended for consistency.