Hacker News MCP Server — 10 tools
contains code
The Hacker News DADL turns Hacker News's API into an MCP server that Claude, GPT or any MCP-compatible agent can consume directly. One YAML file declares all 10 tools — job, story, ask, best, item, max, and more — and ToolMesh serves them at runtime. No Python boilerplate, no per-endpoint code, no separate MCP server process.
Below: the endpoint coverage matrix, a two-block ToolMesh setup, the full tool reference grouped by Hacker News feature area.
Source: Hacker News API (Firebase)
Which Hacker News endpoints are covered?
100% (11 of ~11 endpoints)
Focus: items (stories, comments, polls, jobs), users, story feeds (top, new, best, ask, show, job), updates, max item ID
Missing: none — full coverage of the public Firebase API
How do you configure the Hacker News DADL?
- No credentials required — the Hacker News API is fully public
- No signup or API key needed
Completely public API — no authentication, no API keys, no rate limit headers. Be respectful with request volume. The API is backed by Firebase and returns JSON for all endpoints. Append .json to all paths. For real-time updates consider the Firebase SDK (Server-Sent Events) instead of polling.
How do you install the Hacker News MCP server with ToolMesh?
Add to your backends.yaml:
- name: hackernews
transport: rest
dadl: hackernews.dadl
url: "https://hacker-news.firebaseio.com/v0"
Set the credential:
CREDENTIAL_HACKERNEWS_TOKEN=your-token-hereWhat 10 tools does the Hacker News DADL expose?
GETget_itemGet any item by ID. Items are polymorphic — the "type" field indicates whether it is a story, comment, job, poll, or pollopt. Returns null for non-existent IDs. Key fields: id, type, by, time, text, url, score, title, kids (child comment IDs), parent, descendants (total comment count for stories), deleted, dead.
GETget_userGet a user profile by username. Returns karma, creation date, about (HTML bio), and submitted (array of all item IDs the user has posted). Username is case-sensitive. Returns null for non-existent users.
GETget_top_storiesGet up to 500 top story IDs, ordered by ranking on the HN front page. Returns an array of integer item IDs — call get_item for full details.
GETget_new_storiesGet up to 500 newest story IDs, ordered by submission time (newest first). Returns an array of integer item IDs — call get_item for full details.
GETget_best_storiesGet up to 500 best story IDs (all-time highest-voted recent stories). Returns an array of integer item IDs — call get_item for full details.
GETget_ask_storiesGet up to 200 latest Ask HN story IDs. These are posts where users ask the HN community a question. Returns an array of integer item IDs.
GETget_show_storiesGet up to 200 latest Show HN story IDs. These are posts where users showcase their projects to the HN community. Returns an array of integer item IDs.
GETget_job_storiesGet up to 200 latest job posting IDs from the HN jobs board. Returns an array of integer item IDs.
GETget_max_itemGet the current largest item ID. Useful for polling: fetch items between your last known ID and max ID to catch new submissions. Returns a single integer.
GETget_updatesGet recently changed item IDs and user profiles. Returns an object with "items" (array of changed item IDs) and "profiles" (array of changed usernames). Useful for building a polling-based sync.
What composite workflows does the Hacker News DADL provide? ⚠ contains code
FNget_top_stories_fullGet the top N stories with full item details (default: 10). Fetches story IDs then resolves each to its full item object.FNget_story_with_commentsGet a story and its top-level comments resolved to full item objects. Returns the story with a 'comments' array containing the full comment items.FNget_user_storiesGet a user's most recent stories (not comments). Fetches the user profile, then resolves their most recent submitted items and filters to type=story. Scans 20 recent submissions to stay within the 50-call sandbox limit — users who mostly post comments may return fewer stories than the limit.