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.
Using with Claude Desktop or Cursor
Add to your Claude desktop config (claude_desktop_config.json
) or your Cursor config file (mcp.json
) :
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
⚠️ If you are unsure about your Node.js version, run
node --version
in your terminal. Make sure it showsv18.x.x
or higher.
How to upgrade Node.js
Want to contribute? Just follow the steps below
Clone the repository and install dependencies:
- To test the server with the MCP Inspector:
- or, if running from the source:
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 substitutenpm
oryarn
if you prefer, butpnpm
is recommended for consistency.
You must be authenticated.
Tools
A Model Context Protocol server that enables AI tools like Claude and Cursor to fetch and interact with live Hacker News data (posts, comments, users) via standardized MCP endpoints.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides tools for searching and fetching information from Hacker News.Last updated -46PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enhances Claude in Cursor AI with advanced reasoning capabilities including Monte Carlo Tree Search, Beam Search, R1 Transformer, and Hybrid Reasoning methods.Last updated -1TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol (MCP) server that allows Claude AI to interact with custom tools, enabling extension of Claude's capabilities through the MCP framework.Last updated -TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with microCMS content management system through six core tools for performing CRUD operations on microCMS list-type APIs.Last updated -1252TypeScriptMIT License