Skip to main content
Glama
adjacentai

necl-hn-mcp

by adjacentai

necl-hn-mcp

License: MIT MCP Python Built by NeCL

Hacker News tools for AI agents. Top stories, story details, comments thread, full-text search.

Zero credentials. Public HN API. Install and use.

Built by NeCL — AI engineering studio. Production-tested: this is the exact HN layer that powers our internal content agent, running 3× daily for months.

Tools

Tool

What it does

hn_top_stories(limit, hours)

Top N stories from the last N hours, ranked by score. Default: top 10 from last 24h.

hn_get_story(id)

Full story metadata: title, url, score, author, comments count, posted time.

hn_get_comments(id, limit)

Top-level comments thread for a story, sorted by HN ranking.

hn_search(query, sort)

Full-text search across HN posts and comments (via Algolia HN API).

hn_category(category, limit)

Stories from a specific category: top, new, best, ask, show, job.

Related MCP server: HackerNews MCP Server

Why this MCP

  • Zero credentials, zero config — public HN API, no rate limits worth worrying about, no signup.

  • Battle-tested code — extracted from our internal HN-to-drafts content engine that's been running 3×/day for months.

  • Built for AI agents — every tool returns clean structured data that LLMs can chain together (search → top story → comments → summary).

  • Use case — content research, trend monitoring, automatic news digests, prompt-context enrichment.

Install

uvx runs the package in an ephemeral env. No pip install, no venv. Add to your mcp.json (Claude Desktop, Claude Code, or any MCP client):

{
  "mcpServers": {
    "necl-hn": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/adjacentai/necl-hn-mcp.git",
        "necl-hn-mcp"
      ]
    }
  }
}

Don't have uvx? Install it: pip install uv or brew install uv.

Via pip + python -m

pip install git+https://github.com/adjacentai/necl-hn-mcp.git

Then in mcp.json:

{
  "mcpServers": {
    "necl-hn": {
      "command": "python",
      "args": ["-m", "necl_hn_mcp"]
    }
  }
}

From source (for development)

git clone https://github.com/adjacentai/necl-hn-mcp.git
cd necl-hn-mcp
pip install -e ".[dev]"

Then use the same python -m necl_hn_mcp config as above.

Example use in Claude

Once installed, just ask Claude things like:

  • "What are the top 5 stories on HN in the last 6 hours?"

  • "Get the comments thread for HN story 38420000"

  • "Search HN for posts about RAG performance, sorted by date"

  • "Show me everything in the Ask HN category right now"

  • "Find the top 3 Show HN posts about AI agents this week"

Claude will call the right tool, no further setup.

What you can build with this

  • Daily content brief — pull top HN stories, summarize, generate cross-platform posts.

  • Competitive research bot — search HN for mentions of your competitors, surface negative comments.

  • Trend detector — monitor new and best categories on a cron, alert when a topic spikes.

  • Newsletter pipeline — search by keyword window, cluster results, generate editorial digest.

  • Customer-discovery agent — search Ask HN for problems your product solves, generate cold-outreach drafts.

  • Tech-radar updater — periodically scan show category for new tools in your stack.

Troubleshooting

"mcp command not found" / install errors. Make sure your Python is 3.10+. If using uvx, ensure uv is installed (pip install uv). For pip install: pip install necl-hn-mcp then verify python -m necl_hn_mcp --help doesn't error.

Tool calls timeout. HN's Firebase API can be slow when fetching many items (e.g. hn_top_stories(limit=30, hours=168) scans 200 stories). Default timeout is 10s per request. For long-window queries, use lower limit.

Algolia returns no hits. Algolia indexes HN content with a delay (~5-15 min for fresh items). Try sort="date" for recent activity.

Comments thread is empty for a story I see on HN. hn_get_comments returns only top-level comments. Replies aren't recursively fetched (to keep token cost predictable for LLMs). Use the replies_count field on each comment to know if there's deeper discussion.

Tools don't show up in Claude. After editing mcp.json, fully restart Claude Desktop / Claude Code (not just reload). Check the MCP logs in Settings → Developer.

Pair with

  • necl-content-poster Skill — turn HN stories into ready-to-publish posts for TG/LinkedIn/Threads.

Full pipeline:

necl-hn-mcp (find story) → necl-content-poster (write 3 posts) → you publish

Built by NeCL

neclco.com — production AI engineering. RAG systems, voice agents, Telegram bots, custom MCPs and content engines for companies that need more than wrappers.

Need a custom MCP wired to your internal APIs / databases / SaaS? Visit neclco.com.

Development

git clone https://github.com/adjacentai/necl-hn-mcp.git
cd necl-hn-mcp
pip install -e ".[dev]"

# Run locally with MCP inspector
mcp dev src/necl_hn_mcp/server.py

License

MIT — see LICENSE.


Follow NeCL: Telegram · LinkedIn · X · Site

Available Tools

5 tools
hn_categoryA

Get stories from a specific HN category.

Args: category: One of "top", "new", "best", "ask", "show", "job". limit: Number of stories to return (1-30). Default 10.

Returns: List of story dicts.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
categoryNotop

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description must convey behavior. It states that the tool returns a list of story dicts, implying a read-only operation, but it does not explicitly confirm this or mention rate limits, authentication, or any other behavioral constraints.

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 extremely concise, using a clear three-line structure: purpose, Args, Returns. Every sentence adds value without 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?

Given the tool's low complexity (2 simple parameters, no required fields), the description covers the core functionality and parameter details. The presence of an output schema (not shown) reduces the need to describe return structure, but the description could still benefit from mentioning error cases or context about the source.

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

Parameters5/5

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

The description explicitly lists valid enum values for category and the allowed range for limit (1-30), adding meaningful context beyond the input schema which only shows types and defaults. This fully compensates for the 0% schema coverage indicated in context.

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 stories from a specific HN category, with a list of valid categories. However, it does not distinguish itself from the sibling tool hn_top_stories, which might be interpreted as similar.

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?

The description provides no guidance on when to use this tool versus alternatives like hn_search or hn_top_stories. No when-not conditions or prerequisites are mentioned.

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

hn_get_commentsA

Get the top-level comments thread for a story, in HN ranking order.

Args: story_id: The HN item id of the parent story. limit: Number of comments to return (1-30). Default 10.

Returns: List of comment dicts with id, author, text, posted_unix, replies_count.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
story_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It specifies that comments are top-level and in ranking order, and outlines the return structure, but does not disclose error behavior, rate limits, or what happens with invalid story_id.

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 extremely concise with a clear front-loaded purpose, followed by structured Args and Returns sections. Every sentence is informative with no 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?

Given the tool has two parameters and an output schema described in the Returns section, the description covers the core functionality well. It lacks details on error handling or edge cases, but is adequate for a simple tool.

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

Parameters4/5

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

Schema coverage is 0%, but the description provides clear meaning for both parameters: story_id is the HN item id and limit is the number of comments (1-30, default 10). This adds value beyond 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 top-level comments for a story in HN ranking order, using specific verb and resource, and distinguishes from sibling tools like hn_get_story.

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 like hn_get_story or hn_search. There is no mention of context, prerequisites, or exclusions.

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

hn_get_storyA

Get full metadata for a single HN story by id.

Args: story_id: The HN item id.

Returns: Story dict with id, title, url, score, author, comments_count, posted_unix, hn_url, type, text. Returns {"error": "..."} if not found.

ParametersJSON Schema
NameRequiredDescriptionDefault
story_idYes

TDQS

A4.1/5.0
Behavior4/5

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

No annotations provided, so description must convey behavior. It states the tool returns a story dict with specific fields and an error dict if not found. This covers basic behavior for a read-only operation, but lacks details like authentication or rate limits, though not critical for this simple public API.

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?

Description is concise, front-loaded with purpose, followed by clear Args and Returns sections. No wasted words; every sentence adds value.

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

Completeness5/5

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

For a single-story retrieval tool with one parameter and no output schema, the description adequately explains input, output format (including error case), and purpose. No additional context is necessary.

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 0%, so description must explain parameters. It states 'story_id: The HN item id.' This provides some context beyond the schema's type and title, but is minimal. It compensates partially but could be more specific.

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 retrieves full metadata for a single HN story by ID, using a specific verb ('Get') and resource ('story'), and distinguishes it from siblings like hn_search or hn_get_comments.

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

Usage Guidelines3/5

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

Usage is implied: when you have a story ID and want metadata. However, no explicit when-to-use or when-not-to-use guidance is given, and alternatives are not mentioned.

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

hn_top_storiesA

Get the top Hacker News stories from the last N hours, ranked by score.

Args: limit: Number of stories to return (1-30). Default 10. hours: Time window in hours back from now. Default 24.

Returns: List of story dicts with id, title, url, score, author, comments_count, posted_unix, hn_url, type, text (for Ask/Show HN posts).

ParametersJSON Schema
NameRequiredDescriptionDefault
hoursNo
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

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

Without annotations, description carries full burden. It states returned fields but doesn't disclose read-only nature, potential API rate limits, or error cases. Adequate but not thorough.

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?

Two clear sections (Args, Returns) with no fluff. Every sentence adds value. Appropriate length for the tool's simplicity.

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?

Covers parameters, defaults, return fields (with output schema support). Missing error handling or preconditions, but sufficient for a straightforward read tool.

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

Parameters5/5

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

Schema coverage is 0%, so description fully compensates. It explains limit (1-30) and hours (window back from now), adding constraints and defaults beyond the schema's empty descriptions.

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 retrieves top Hacker News stories from a time window, ranked by score. It distinguishes from siblings like hn_search (search) and hn_get_story (specific story), making intent unambiguous.

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 on when to use this tool over alternatives (e.g., hn_search, hn_category). The description only explains functionality without context on preferred use cases.

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. 5 tool updatesv0.1.1
    • First observedhn_category
    • First observedhn_get_comments
    • First observedhn_get_story
    • First observedhn_search
    • First observedhn_top_stories

TDQS

A4.1/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: retrieving stories by category, by time window, by search, a single story by ID, and comments for a story. No overlap or ambiguity.

Naming Consistency5/5

All tools follow the `hn_` prefix with a consistent verb_noun pattern in snake_case (e.g., hn_category, hn_get_story, hn_search). No mixing of conventions.

Tool Count5/5

Five tools cover the main read operations for Hacker News without being too few or too many. Each tool serves a necessary function in the domain.

Completeness4/5

Covers story retrieval, search, detail, and comments well. Missing user info or nested replies, but these are minor gaps for typical HN consumption use cases.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    15
    63
    5
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables 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.
    5
    63
    7
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Enables 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
    -

Latest Blog Posts

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/adjacentai/necl-hn-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server