hackernews-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hackernews-mcp-servershow me the top 10 stories on Hacker News right now"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
hackernews-mcp-server
A Model Context Protocol server that lets AI assistants read Hacker News.
Plug it into Cursor, Claude Desktop or Claude Code and ask things like:
"What is on the front page of Hacker News right now?"
"Summarize the top 5 Show HN posts."
"Are there any Ask HN threads about Rust today?"
It uses the official Hacker News API. No API key or account is needed.
Tool
fetch_hacker_news
Fetches current stories with title, link, score, author and comment count.
Parameter | Type | Default | Description |
| string |
|
|
| integer |
| Number of stories, from 1 to 30 |
The result comes in two forms: a compact text list for the model to read, and structured content for clients that support it.
{
"category": "top",
"stories": [
{
"id": 12345678,
"title": "Show HN: An example project",
"url": "https://example.com/project",
"discussionUrl": "https://news.ycombinator.com/item?id=12345678",
"score": 347,
"author": "someuser",
"comments": 72,
"postedAt": "2026-01-15T12:00:00.000Z"
}
]
}Ask HN and similar posts also carry a text field with the body in plain text, truncated to 500 characters.
Related MCP server: HackerNews MCP Server
Setup guide
1. Build the server
Requires Node.js 18 or newer.
git clone https://github.com/wallaceluis/hackernews-mcp-server.git
cd hackernews-mcp-server
npm install
npm run buildTake note of the absolute path to dist/index.js; every client below needs it. Examples:
macOS / Linux:
/Users/you/hackernews-mcp-server/dist/index.jsWindows:
C:\\Users\\you\\hackernews-mcp-server\\dist\\index.js(backslashes doubled inside JSON)
2. Connect your client
Cursor
Create .cursor/mcp.json in your project (or ~/.cursor/mcp.json to enable it everywhere):
{
"mcpServers": {
"hackernews": {
"command": "node",
"args": ["/absolute/path/to/hackernews-mcp-server/dist/index.js"]
}
}
}Then open Cursor Settings > MCP and check that hackernews is listed and enabled. The tool is available to the agent in chat.
Claude Desktop
Open Settings > Developer > Edit Config, which opens claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the server:
{
"mcpServers": {
"hackernews": {
"command": "node",
"args": ["/absolute/path/to/hackernews-mcp-server/dist/index.js"]
}
}
}Quit and reopen Claude Desktop. The fetch_hacker_news tool shows up in the tools menu of the chat input.
Claude Code
claude mcp add hackernews -- node /absolute/path/to/hackernews-mcp-server/dist/index.jsRun /mcp inside Claude Code to confirm the server is connected.
3. Try it
Ask your assistant: "Use Hacker News to tell me what developers are talking about today."
Troubleshooting
Problem | Fix |
Server does not show up or fails to start | Check that the path is absolute and that |
| The client may not share your shell's |
"The Hacker News API is unreachable" | The machine needs outbound HTTPS access to |
Changes to the code have no effect | Rebuild with |
To test the server on its own, use the MCP Inspector:
npm run inspectDevelopment
npm run dev # compile in watch mode
npm run typecheck
npm run inspect # open the MCP Inspector against the built serverFile | Responsibility |
| Entrypoint: connects the server to the stdio transport |
| MCP server and the |
| Hacker News API client and result formatting |
The server talks to the client over stdio, so stdout is reserved for the protocol. Log with console.error, never console.log.
How it works
The Hacker News API exposes a ranked list of ids per category and one endpoint per item. The server reads the list, loads the first limit items in parallel (10 second timeout each), drops deleted and dead posts, and converts HTML bodies to plain text. A story that fails to load is skipped instead of failing the whole call. Errors are returned as tool errors so the model can see what went wrong.
License
Available Tools
1 toolfetch_hacker_newsFetch Hacker NewsARead-onlyIdempotent
Fetch current stories from Hacker News (news.ycombinator.com) with title, link, score, author and comment count. Use it for questions about tech news, what is trending among developers, or recent Ask HN / Show HN posts.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many stories to return, from 1 to 30. | |
| category | No | Which list to read: top (front page), new (latest), best (highest voted recently), ask (Ask HN), show (Show HN) or job (job postings). | top |
Output Schema
| Name | Required | Description |
|---|---|---|
| stories | Yes | |
| category | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint and idempotentHint, so the safety and external-dependency profile is covered. The description adds only that it hits news.ycombinator.com and what fields come back, which is largely restated by the output schema; no rate limits, caching, or ordering behavior is disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences with the capability front-loaded and usage context second. Every clause carries information, though the field enumeration is slightly redundant given the output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With rich annotations, a 100%-covered schema and an existing output schema, the description covers source and scope adequately for an agent to invoke it correctly. Minor gaps (story ordering, freshness of 'current') are not critical for the call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both the 'limit' range and the 'category' enum semantics are fully documented in the schema. The description contributes no additional parameter meaning, so the baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (fetch) and resource (current stories from Hacker News) and enumerates the returned fields (title, link, score, author, comment count). An agent immediately knows exactly what this tool produces and from which source.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear triggering contexts — tech news questions, developer trending topics, recent Ask HN / Show HN posts. It does not name exclusions or alternatives, but with no sibling tools there is nothing to route away from, so the guidance is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
fetch_hacker_news
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of confusion or misselection between tools. Its purpose (fetching Hacker News stories) is unambiguous.
The single name 'fetch_hacker_news' follows a clear verb_noun convention with snake_case. With only one tool there is no pattern to validate against, so it cannot demonstrate full consistency across a set.
A single tool is too thin for a Hacker News domain server, which naturally spans stories, comments, users, jobs, and search. One generic fetch tool under-serves the apparent scope.
The surface covers only fetching current stories; there is no way to retrieve comments, look up users, search, or filter by category (top/new/best/ask/show). Agents asking about discussion threads or specific posts will hit dead ends.
Maintenance
Related MCP Connectors
Browse Hacker News feeds, threads, and user profiles with full-text search.
Hacker News MCP — search and retrieve stories from Hacker News
Scrape Hacker News stories, comments and user profiles as clean JSON with points, author…
Deterministic Hacker News developer sentiment, themes & feature requests via MCP. No API key.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables access to Hacker News data including top stories, new stories, specific story details, and search functionality. Integrates with Poke to provide Hacker News content through natural language interactions.1-
- AlicenseAqualityDmaintenanceProvides programmatic access to Hacker News content via the HN Algolia API. It enables AI assistants to search stories, retrieve comments, access user profiles, and explore the front page in real-time.948 npmMIT
- FlicenseAqualityDmaintenanceEnables AI assistants to read and search Hacker News for top stories, comments, user profiles, and job listings using the Firebase and Algolia APIs. It facilitates natural language research into community discussions and technological trends across the HN platform.8-
- AlicenseAqualityCmaintenanceProvides AI agents with access to Hacker News data including top stories, story details, comment threads, and full-text search for content research and trend monitoring.5MIT