Skip to main content
Glama
joeswann

Hacker News MCP Server

by joeswann

Hacker News MCP Server

A read-only MCP (Model Context Protocol) server for Hacker News. Enables Claude Desktop, Claude Code, and other MCP clients to browse stories, read comments, search posts, and view user profiles. No authentication required.

Features

  • Story Listings: Browse top, new, best, ask, show, and job stories

  • Comments: View full comment threads with nesting

  • Search: Full-text search via Algolia

  • User Profiles: View user info and submission history

Related MCP server: Hacker News MCP Server

Installation

Prerequisites

  • Node.js >= 18.0.0

From Source

  1. Clone this repository

  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Configuration

Environment Variables

Variable

Required

Default

Description

HN_USERNAME

No

Optional HN username for context

HN_API_BASE_URL

No

https://hacker-news.firebaseio.com/v0

Firebase API endpoint

HN_ALGOLIA_BASE_URL

No

https://hn.algolia.com/api/v1

Algolia search endpoint

No credentials needed. All data is publicly accessible.

Usage with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "hackernews": {
      "command": "node",
      "args": ["/path/to/hackernews-mcp/build/index.js"]
    }
  }
}

Usage with Claude Code

claude mcp add hackernews -- node /path/to/hackernews-mcp/build/index.js

Available Tools

Tool

Description

list_stories

List stories by type (top, new, best, ask, show, job)

get_item

Get a specific item (story, comment, job)

get_comments

Get full comment thread with nesting

search

Full-text search via Algolia

get_user

View a user's profile

get_user_submissions

List a user's posts

Development

  • npm run dev — Watch mode with TypeScript compilation

  • npm run build — Build the project

  • npm start — Start the built server

License

MIT

Available Tools

6 tools
get_commentsA

Get threaded comments for a Hacker News story. Returns comments with indentation showing reply depth. Skips dead and deleted comments.

ParametersJSON Schema
NameRequiredDescriptionDefault
depthNoMaximum reply depth to fetch (1-5). Default: 3
limitNoMaximum total comments to return (1-100). Default: 30
story_idYesThe HN story ID to get comments for

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations available, the description carries the full burden and adds meaningful behavioral context: it mentions that comments are threaded with indentation to show reply depth and that dead/deleted comments are skipped. This goes beyond a simple 'get comments' and helps set expectations for output format and content filtering.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exceptionally concise: two sentences, no fluff, and the key information is front-loaded. Every word contributes to understanding the tool's purpose and behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with three parameters, no output schema, and no annotations, the description covers the essential return format (threaded, indented) and a key filtering behavior (skipping dead/deleted). It lacks details like pagination or order, but given the tool's simplicity, it is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already covers all three parameters with clear descriptions (depth, limit, story_id), so schema description coverage is 100%. The description adds minimal extra parameter meaning beyond what the schema provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves threaded comments for a Hacker News story, which is a specific verb and resource. It is distinct from siblings like search or get_user, though it shares possible overlap with get_item, but the focus on 'threaded' and 'indentation' makes the purpose clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives like get_item. The description implies usage for fetching story comments but does not state when not to use it or mention any prerequisites/alternatives, offering minimal directional value.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_itemA

Get any Hacker News item by ID (story, comment, job, poll). Returns full details including text content.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe HN item ID

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations, so the description must carry the burden of behavioral disclosure. It states that the tool returns full details including text content, which conveys a read-only fetch. However, it does not mention behavior for missing IDs, error responses, or any rate limits or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that conveys the core action and return value without superfluous words. It is immediately scannable and appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-parameter fetch tool, the description is sufficiently complete. It specifies what is returned and covers multiple item types, though 'full details' is slightly vague and no error handling is mentioned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully documents the single 'id' parameter with 100% coverage. The description adds no additional parameter semantics beyond saying 'by ID', which is already represented in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool gets any Hacker News item by ID, covering stories, comments, jobs, and polls. This distinguishes it from siblings like list_stories, get_comments, and search, which operate on collections or specific types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage context is clear: use when you have a specific item ID and want the full item. It does not explicitly name alternatives or exclusions, but the ID-based scope is a clear differentiator from siblings that list or search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_userA

Get a Hacker News user profile by username. Returns karma, account age, about text, and submission count.

ParametersJSON Schema
NameRequiredDescriptionDefault
usernameYesThe HN username

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full transparency burden. It discloses the return fields, which is useful, but it does not mention potential behavior for missing users, rate limits, or that this is a read-only operation. Some behavioral context is provided, but key edge-case behavior is absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, immediately front-loaded with the action, and every sentence adds value. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with no output schema or annotations, the description gives enough context about what the tool returns and the target resource. It is slightly incomplete by not addressing error cases or constraints, but the simplicity of the tool makes this acceptable territory for a 4 rather than a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (username described as 'The HN username'), so the schema already fully explains the parameter. The description adds no additional semantic detail beyond what the schema provides, fitting the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (get a user profile) and the resource (Hacker News user by username). It also lists the key return data (karma, account age, about text, submission count), which distinguishes it from the sibling tool get_user_submissions that focuses on submissions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It does not mention when to prefer get_user_submissions or search, and there are no usage context hints beyond the basic purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_user_submissionsB

Get recent submissions from a Hacker News user. Can filter by stories or comments.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeNoFilter by submission type. Default: all
limitNoNumber of submissions to return (1-30). Default: 10
usernameYesThe HN username

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'recent' submissions and the ability to filter, but does not disclose details like sorting order, time window, pagination, or the shape of the return value. The behavior is straightforward and not misleading, but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that conveys the essential information without any filler. It is front-loaded with the main action and includes a secondary capability, earning every word.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple with 3 parameters and no output schema. The description explains the core purpose and a filtering option, but it does not specify the return format or any edge cases. Given the schema fills in parameter details, a 3 reflects that the description is sufficient but not thorough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds minimal extra meaning by referring to 'filter by stories or comments,' which mirrors the 'type' enum. It does not elaborate on 'limit' or 'username' beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Get recent submissions from a Hacker News user' with an additional note about filtering by stories or comments. It is specific in verb and resource, but does not explicitly distinguish itself from siblings like get_user or list_stories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. The description does not mention any exclusions or prerequisites, and no sibling tools are referenced. The only usage hint is the filter capability, which is a feature rather than a selection guideline.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_storiesA

Browse Hacker News feeds (top, new, best, ask, show, job) with pagination. Returns titles, URLs, scores, and metadata.

ParametersJSON Schema
NameRequiredDescriptionDefault
feedNoFeed type to browse. Default: top
limitNoNumber of stories to return (1-50). Default: 20
offsetNoNumber of stories to skip for pagination. Default: 0

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses return content (titles, URLs, scores, metadata) and pagination, but lacks details on authentication, rate limits, or output structure. Since no annotations are present, it carries the full burden but does not go beyond basic transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One compact sentence, front-loaded with the primary action and resource, and includes necessary details without superfluous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately specifies the return content and feed types. It is sufficient for a straightforward listing tool, though more detail on the return structure could make it more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline of 3 applies. The description adds the concept of pagination, but the schema already describes each parameter (feed, limit, offset) comprehensively, so no significant additional meaning is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: browsing Hacker News feeds with specific feed types and pagination. It distinguishes itself from sibling tools like get_item or search by focusing on feed-based listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for feed browsing but does not explicitly mention alternatives or exclusions. The context is clear, and the feed types are enumerated, providing adequate guidance without stating when not to use it.

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.

  1. 6 tool updatesv1.0.0
    • First observedget_comments
    • First observedget_item
    • First observedget_user
    • First observedget_user_submissions
    • First observedlist_stories
    • First observedsearch

TDQS

A3.8/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a distinct purpose: feeds, item retrieval, comment threads, search, user profiles, and user submissions. No overlapping functionality that would cause confusion.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern (list_stories, get_item, get_comments, get_user, get_user_submissions). The lone 'search' is a valid verb but lacks a noun, making it a slight deviation from the pattern.

Tool Count5/5

Six tools is well-scoped for a Hacker News reader, covering browsing, retrieval, search, and user-related queries without over-expanding the surface.

Completeness4/5

The read-only surface is solid, covering stories, items, comments, search, and user data. Minor gaps exist around fetching a comment thread directly from a comment ID and write operations, but these are reasonable omissions for a typical HN MCP.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    A Model Context Protocol (MCP) server that provides tools for searching and fetching information from Hacker News.
    4
    76
    MIT
  • A
    license
    D
    quality
    D
    maintenance
    An MCP server that enables AI assistants to access real-time Hacker News data including top stories, story details, comments, and search functionality.
    1
    18 npm
    3
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server for Hacker News providing tools to fetch stories, threads, users, and search content via Firebase and Algolia APIs.
    279 npm
    4
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    The only MCP server that can write to Hacker News, enabling story submission, commenting, and submissions checking via natural language.
    5
    23 npm
    MIT