hacker-news
Click on "Install 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., "@hacker-newswhat's on the Hacker News front page 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.
hacker-news-mcp-server
A small, production-shaped Model Context Protocol server that gives any MCP client — Claude Desktop, Cursor, an agent framework — read access to Hacker News through four tools:
Tool | What it returns |
| the current front page, in ranking order |
| the highest-voted recent stories |
| the newest submissions |
| one item by id — story, comment, job or poll — with text and child-comment ids |
Every story comes back as a compact record (title, url, hn_url,
score, by, comments, posted_at, …) so the model gets what it needs
without the raw Firebase payload. No API key is required: the
Hacker News API is public.
Why
Wrapping an existing API as an MCP server is mostly plumbing — reading the API docs, turning endpoints into typed tools with good descriptions, wiring a transport, and handing the client a config snippet. This repo is that plumbing done once for Hacker News, in ~150 lines, with the parts that matter in practice: concurrent item fetches (the HN API is one request per item), a short-lived cache, input clamping, proper tool errors, stdio and HTTP transports, and an offline test-suite.
Related MCP server: HackerNews MCP Server
How it fits together
flowchart LR
C[MCP client<br/>Claude Desktop · Cursor · agent] -- "stdio (spawns server.py)<br/>or streamable-http" --> S
subgraph S["server.py · MCP server 'hacker-news'"]
T1[fetch_top_stories]
T2[fetch_best_stories]
T3[fetch_new_stories]
T4[get_story]
end
T1 & T2 & T3 & T4 --> H[hn_client.py<br/>HackerNewsClient<br/>cache · thread pool · summaries]
H -- "GET /v0/{top,best,new}stories.json<br/>GET /v0/item/{id}.json" --> API[(hacker-news.firebaseio.com)]server.py registers the four tools on an MCPServer (FastMCP on
mcp 1.x — both SDK generations are supported) and picks the transport.
hn_client.py does the HTTP work: story-list endpoints return up to 500
ids, so the client fetches the first limit items on a thread pool,
memoises responses for HN_CACHE_TTL seconds, skips deleted items and
projects each item onto the summary shape.
Quick start
git clone <this repo> && cd hacker-news-mcp-server
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m unittest discover -s tests -t . # offline: fixtures, no network
python smoke_client.py # spawn the server over stdio and list its tools
python smoke_client.py --call fetch_top_stories --limit 3
python smoke_client.py --call get_story --id 8863Run it for a remote client instead of stdio:
python server.py --transport streamable-http --port 8000Connect it to Claude Desktop
Claude Desktop → Settings → Developer → Edit Config opens
claude_desktop_config.json. Add the server with absolute paths (run
which python inside the virtualenv to get the interpreter path, the
equivalent of which node for a Node server):
{
"mcpServers": {
"hacker-news": {
"command": "/absolute/path/to/hacker-news-mcp-server/.venv/bin/python",
"args": ["/absolute/path/to/hacker-news-mcp-server/server.py"]
}
}
}With uv instead:
{
"mcpServers": {
"hacker-news": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/hacker-news-mcp-server", "run", "server.py"]
}
}
}Restart Claude Desktop; the four tools appear under the tools icon and
prompts like "what's on the Hacker News front page right now?" or
"summarize the discussion on story 8863" route to them. Cursor and
other clients use the same command/args shape.
claude_desktop_config.example.json in this repo is a ready-to-edit copy.
Configuration
Optional environment variables (see .env.example; nothing is required):
Variable | Default | Meaning |
|
| API root (point at a mirror or a recording proxy) |
|
| seconds to memoise list and item responses |
|
| concurrent item fetches per tool call |
limit is clamped to 1–100 per call.
Code map
hacker-news-mcp-server/
├── server.py MCP server: tool registration, descriptions, transports, ToolError handling
├── hn_client.py HackerNewsClient (cache, thread-pool item fetches, summarize_item, clamp_limit)
├── smoke_client.py stdio client that spawns server.py, lists tools, optionally calls one
├── tests/test_server.py fixture-backed client tests + in-process tool tests (no network)
├── claude_desktop_config.example.json config snippet for Claude Desktop / Cursor
├── .env.example optional settings
├── requirements.txt mcp
└── .gitignoreNotes
Tool errors (unknown id, bad limit) are raised as MCP
ToolErrors, so the client sees a proper error result instead of a crashed server.The HN API has no rate-limit documentation but is shared infrastructure; keep
limitmodest and leave the cache on.To adapt this to another public API, keep
server.pyand replacehn_client.py— the tool layer only depends onstories()anditem().
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hacker News MCP — search and retrieve stories from Hacker News
Browse Hacker News feeds, threads, and user profiles with full-text search.
Dive into the latest and greatest from the tech world with our Hacker News MCP server.
Live Hacker News front page: top tech stories, points, comments, links. $0.01/query.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to search, retrieve, and interact with HackerNews content including stories, comments, polls, and user information. Provides comprehensive access to all HackerNews API endpoints with 15 specialized tools for content discovery and analysis.15265MIT
- 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.926MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Desktop to interact with Hacker News, fetching articles, searching, and viewing comments.2Mozilla Public 2.0
- 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
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/crzyc0d3r/hacker-news-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server