hackernews-mcp
This server provides two MCP tools to search and read Hacker News content via the Algolia API.
search_hackernews: Search stories, comments, Ask HN, and Show HN posts using a text query, with options to:Filter by item type:
story,comment,ask_hn,show_hn, orallFilter by time range: past 24 hours, past week, past month, or all time
Sort by relevance or newest-first
Limit results (1–50)
Returns structured hits including id, title, URL, points, author, comment count, timestamp, and an excerpt snippet
get_hackernews_thread: Fetch the full comment tree for any HN story by item ID, returned flattened depth-first with configurablemax_commentsandmax_depthto manage response size. Includes a truncated flag if limits were applied.
You can combine these tools — use a story ID from search results to immediately fetch its comment thread.
Provides search capabilities for Hacker News content via Algolia's API.
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., "@hackernews-mcpsearch Hacker News for 'Rust async'"
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
An MCP server that lets Claude (or any MCP client) search and read Hacker News, backed by HN's free Algolia search API. Ask in plain language; Claude calls the tools.

You: What's the discussion on Rust async runtimes been like this past month?
Claude: → search_hackernews(query="rust async runtime", time_range="past_month")
Here are the threads HN has been talking about… [summary of real stories]
You: Dive into the comments on the top one.
Claude: → get_hackernews_thread(item_id="…", max_comments=30)
The top commenters are split on… [summary of the thread]The two tools compose — a follow-up like “pull comments on the first item”
feeds the story id straight from the search into get_hackernews_thread:

See
examples/for full transcripts, anddocs/claude-desktop.mdto wire it into Claude Desktop in about five minutes.
What's in this repo
Two MCP tools:
search_hackernews— search stories and comments by query, with filters for tag (story/comment/ask_hn/show_hn/all), time range, sort (relevance or date), and result limit.get_hackernews_thread— fetch a story's comment tree by id, flattened depth-first and bounded bymax_comments/max_depthto keep the response within an honest token budget (with atruncatedflag when it was trimmed).
Tech stack: Python 3.11+, the official MCP Python SDK,
httpx, and — for development —
pytest, ruff,
and pyright.
Related MCP server: HackerNews MCP Server
Install
Uses uv:
git clone https://github.com/ccozad/hackernews-mcp.git
cd hackernews-mcp
uv syncRun the stdio server directly with uv run hackernews-mcp (it speaks the MCP
protocol on stdout, so you normally let a client launch it rather than running it
by hand).
Use it with Claude Desktop
Add this to your claude_desktop_config.json (full guide, config-file locations,
and troubleshooting in docs/claude-desktop.md):
{
"mcpServers": {
"hackernews": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/hackernews-mcp", "run", "hackernews-mcp"]
}
}
}Restart Claude Desktop, then ask it to "search HN for Rust async" and confirm a tool call happens. The first time Claude uses a tool, Claude Desktop asks you to approve it:

Architecture
As shown in the diagram at the top, Claude Desktop is the MCP client: on startup it spawns this server as a subprocess and talks to it over stdio. The server exposes two tools and forwards their work to HN's Algolia API over HTTPS.
Exchange sequence
A typical two-tool session — search surfaces a story, then a follow-up dives into its comments:
sequenceDiagram
actor User
participant Desktop as Claude Desktop
participant Server as hackernews-mcp
participant Algolia as HN Algolia API
Note over Desktop,Server: On launch, Desktop spawns the server<br/>and negotiates initialize + tools/list over stdio
User->>Desktop: "search HN for Rust async"
Desktop->>Server: tools/call search_hackernews(query="rust async")
Server->>Algolia: GET /search?query=rust+async&tags=story
Algolia-->>Server: matching hits (JSON)
Server-->>Desktop: hits array
Desktop-->>User: ranked list of stories
User->>Desktop: "pull comments on the first item"
Desktop->>Server: tools/call get_hackernews_thread(item_id="…")
Server->>Algolia: GET /items/{item_id}
Algolia-->>Server: full nested thread (JSON)
Note over Server: flatten depth-first, then bound<br/>by max_comments / max_depth
Server-->>Desktop: root, comments, truncated
Desktop-->>User: thread summaryHow it works
Both tools are thin wrappers over HN's Algolia API. search_hackernews maps its
arguments to Algolia's /search (or /search_by_date) endpoint — tag filters,
a numericFilters time window, and hitsPerPage. get_hackernews_thread pulls
the full nested thread from /items/{id} and trims it client-side. Input is
validated before any network call; upstream errors, timeouts, and empty results
all have defined behavior. See the tool docstrings in
src/hackernews_mcp/ for the full contract.
Development
uv sync --extra dev # install dev tools
uv run pytest # run the test suite (network-mocked)
uv run ruff check . # lint
uv run ruff format --check .
uv run pyright # type-checkAll four checks run in CI on every pull request across Python 3.11 and 3.12. The
suite mocks Algolia and never hits the network; a gated live smoke test runs only
when HACKERNEWS_MCP_LIVE_TEST=1 is set.
License
Available Tools
1 toolsearch_hackernewsA
Search Hacker News stories and comments via HN's Algolia API.
Use this to find HN discussion on a topic, surface Ask HN / Show HN posts, or
pull the most recent items in a time window. Returns a JSON object with a
hits array.
Parameters:
query (str, required): the search phrase, e.g. "rust async runtime".
tag (str): which item kind to search. One of "story" (default), "comment", "ask_hn", "show_hn", or "all".
time_range (str): restrict by recency. One of "past_24h", "past_week", "past_month", or "all_time" (default).
sort (str): "relevance" (default) ranks by Algolia relevance; "date" returns newest first.
limit (int): number of hits to return, 1-50 (default 10).
Each hit has: id, title, url, points, author, num_comments, created_at (ISO8601), and excerpt (a highlighted snippet when Algolia provides one). For comment hits, title/url/points are usually null and the matched text appears in excerpt. An empty search returns {"hits": []} rather than an error.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search phrase. | |
| tag | No | Which item kind to search. | story |
| time_range | No | Restrict results by recency. | all_time |
| sort | No | Ranking: relevance or newest-first. | relevance |
| limit | No | Number of hits to return (1-50). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description fully shoulders the behavioral disclosure. It details the return type ('JSON object with a hits array'), describes each hit's fields (id, title, url, points, author, num_comments, created_at, excerpt), and explains special cases such as comment hits where title/url/points are null and excerpt contains matched text. It also notes that an empty search returns {'hits': []} rather than an error. This comprehensive disclosure compensates well for the absent annotations.
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?
The description is concise and well-structured: a two-sentence intro, bullet points for parameters, and a final paragraph about response shape and edge cases. Every sentence contributes meaningful information; there is no redundancy or fluff. The structure is easy to parse for an AI agent.
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?
Given the tool's complexity (5 parameters, no output schema), the description covers all necessary aspects: parameter details, return format, and edge-case behavior (empty search). Minor omission: it does not mention pagination or whether multiple pages can be retrieved. The limit parameter suggests a single page, but explicit clarification would improve completeness.
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?
The input schema has 100% description coverage, so the baseline is 3. The description adds value beyond the schema by providing a concrete example for 'query' (e.g., 'rust async runtime'), reiterating enums with defaults, and clarifying the limit range. While some content mirrors the schema, the examples and additional phrasing enhance understanding for an AI agent.
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?
The description begins with a clear verb+resource: 'Search Hacker News stories and comments via HN's Algolia API.' It further elaborates use cases like 'find HN discussion on a topic, surface Ask HN / Show HN posts, or pull the most recent items,' making the purpose unmistakable. No siblings exist to differentiate, but the description is fully specific.
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?
The description provides explicit context on when to use the tool (e.g., 'find HN discussion on a topic, surface Ask HN / Show HN posts, or pull the most recent items'). It does not include exclusions or alternatives because no sibling tools exist, but the use cases are clearly stated. Slight room for improvement: could mention that this is read-only and does not mutating Hacker News.
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. Dates show when Glama detected each change.
1 tool update
v0.0.1- First observed
search_hackernews
TDQS
Only one tool exists, so there is no possibility of confusion between tools. The search_hackernews tool has a clear, distinct purpose.
With a single tool, naming consistency is not an issue. The name 'search_hackernews' follows a clear verb_noun pattern.
For a server named hackernews-mcp, a single search tool is too few. Users would expect additional tools for fetching stories, comments, user info, and posting, making the scope feel incomplete.
The server lacks basic operations for Hacker News interaction, such as getting a story by ID, fetching top stories, or user information. Only search is supported, leaving significant gaps.
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
Browse Hacker News feeds, threads, and user profiles with full-text search.
HN front-page, Algolia full-text search, and Show HN launch tracker.
Hacker News MCP — search and retrieve stories from Hacker News
Read-only Reddit search API for AI agents: posts, comments, comment trees, subreddit rules.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to access HackerNews content through structured search, front page retrieval, latest posts monitoring, detailed item fetching with comment trees, and user profile viewing via the Algolia API.5637MIT
- 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.963MIT
- FlicenseAqualityCmaintenanceEnables 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
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/ccozad/hackernews-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server