GitHub - devrelopers/hackernews-mcp: A Rust MCP server exposing Hacker News to AI assistants over stdio. Read the front page and Ask/Show/job stories, walk full comment trees with depth control, fetch user profiles, and run full-text search. Backed by the official Firebase and Algolia APIs — no keys, no auth. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
devrelopers
hackernews-mcp
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>3 Commits<br>3 Commits
src
src
.gitignore
.gitignore
Cargo.lock
Cargo.lock
Cargo.toml
Cargo.toml
LICENSE
LICENSE
README.md
README.md
View all files
Repository files navigation
hackernews-mcp
A small, read-only Model Context Protocol server that gives<br>Claude Desktop and Claude Code first-class access to Hacker News. It speaks MCP over stdio and<br>talks to two public, no-auth APIs:
Official HN (Firebase) — https://hacker-news.firebaseio.com/v0/ — feeds, items, and users.
Algolia HN Search — https://hn.algolia.com/api/v1/ — full-text search.
No API keys, no accounts, nothing is mutated. Every tool is marked read-only.
Tools
Tool<br>When to reach for it
get_stories<br>Browse a ranked feed. Returns a compact list (id, title, author, score, comment count, url, hn_url) with no comment trees — ideal for scanning the front page or a section. Params: category (top/new/best/ask/show/job, default top), limit (default 30, max 100).
get_item<br>Go deep on one thread. Returns the item plus a nested comment tree walked breadth-first. The tree is hard-capped by max_comments (default 50) and max_depth (default 3) so it never blows up your context; a truncation_note tells you when replies were cut. Dead/deleted comments are skipped. Params: id (required), include_comments (default true), max_depth (default 3), max_comments (default 50).
get_user<br>Look up a profile by username (case-sensitive). Returns karma, the about text, account creation date, and submitted-item count. Param: id (required).
search<br>Full-text search across all of HN via Algolia. Params: query (required), sort (relevance default, or date), tags (e.g. story, comment, ask_hn, show_hn, front_page), min_points (int), limit (default 20, max 100). Returns hits with title, author, points, comment count, date, story URL, and hn_url.
Two conventions across all tools: every Unix timestamp is returned both raw (time) and as an ISO 8601<br>UTC string (time_iso), and every item carries a derived hn_url<br>(https://news.ycombinator.com/item?id=).
Quick rule of thumb: get_stories/search to find things, get_item to read one thing in depth.
Build
Requires a recent stable Rust toolchain (edition 2021).
git clone https://github.com/devrelopers/hackernews-mcp<br>cd hackernews-mcp<br>cargo build --release
The binary lands at target/release/hackernews-mcp.
Install in Claude Desktop
Add an entry to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
"mcpServers": {<br>"hackernews": {<br>"command": "/absolute/path/to/hackernews-mcp/target/release/hackernews-mcp"
Use the absolute path to the binary you just built (e.g.<br>/Users/you/hackernews-mcp/target/release/hackernews-mcp). Restart Claude Desktop; the four tools<br>will appear under the 🔌 tools menu.
Install in Claude Code
claude mcp add hackernews -- /absolute/path/to/hackernews-mcp/target/release/hackernews-mcp
Notes
Item fetches in get_stories and get_item run concurrently with a politeness cap of ~10<br>in-flight requests.
Logs are written to stderr so they never corrupt the JSON-RPC stream on stdout. Set<br>RUST_LOG=debug for verbose tracing.
Missing items/users return an actionable error<br>(Item not found — it may be deleted or the ID may be invalid.) rather than a panic.
Layout
src/<br>main.rs # tokio entrypoint + stdio transport wiring<br>client.rs # shared reqwest client over the Firebase + Algolia APIs<br>tools.rs # the four MCP tools + breadth-first comment-tree walker<br>types.rs # data...