When I started experimenting with the Model Context Protocol (MCP), I was fascinated by its potential to bridge AI tools with external data sources. As a regular Hacker News reader, I thought: what if Claude could fetch and analyze HN posts in real-time?
That's how mcp-hacker-news
was born, a TypeScript-based MCP server that connects the official Hacker News API directly to AI tools like Claude and Cursor.
Getting it running
Setting up the server is straightforward. For Claude Desktop, add this to your configuration (claude_desktop_config.json
):
{
"mcpServers": {
"mcp-hacker-news": {
"command": "npx",
"args": ["-y", "mcp-hacker-news"]
}
}
}
For Cursor, add it to your MCP settings, or for any other MCP-compatible client, follow their specific configuration format.
And that's it! Your AI tool can now access live Hacker News data.

Development setup
For contributors or those wanting to run from source:
git clone https://github.com/paablolc/mcp-hacker-news.git
cd mcp-hacker-news
pnpm install
pnpm build
Testing with the MCP Inspector:
pnpm inspector
# or from source:
npx @modelcontextprotocol/inspector node dist/index.js

Requirements
Node.js version 18 or higher is required. Check your version with node --version
and upgrade if needed.
Resources
The server exposes three core resources that map to Hacker News endpoints:
hackernews://top
→ Top stories (/v0/topstories
)hackernews://new
→ Newest stories (/v0/newstories
)hackernews://best
→ Best algorithmic stories (/v0/beststories
)
These match the main list endpoints officially provided by the Hacker News API.
Tools
Beyond the fixed resources, the server provides tools for advanced queries:
getTopStories
/getBestStories
/getNewStories
→ Fetch stories with customizable limitsgetAskHNStories
/getShowHNStories
/getJobStories
→ Fetch specific story typesgetItem
→ Retrieve specific items (stories, comments, etc.)getUser
→ Fetch user profiles by usernamegetComments
/getMaxItemId
/getUpdates
→ Additional utilities
Understanding MCP by building it
I built this to understand how MCP works in practice. The concept is simple: write one server that connects any API to any AI tool that supports MCP.
The same pattern works for any API you care about, one MCP server bridges all your favorite AI tools to the data they need.
Try it yourself
GitHub Repository → github.com/paabloLC/mcp-hacker-news