Skip to main content
Glama

🟠 hn-mcp — Post to Hacker News via MCP

The only MCP server that can write to Hacker News. All 7+ existing HN MCP servers are read-only. This one submits stories, posts comments, and checks your submissions.

Tools

Tool

What it does

hn_login

Login to HN (persists cookies across restarts)

hn_submit

Submit a story (link post or Ask HN)

hn_comment

Post a comment or reply

hn_my_submissions

Check your recent posts with scores

hn_search

Search HN via Algolia

Related MCP server: @cyanheads/hn-mcp-server

Setup

cd hn-mcp
uv sync

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "hackernews": {
      "command": "uv",
      "args": ["run", "--directory", "/Users/YOU/path/to/hn-mcp", "python3", "server.py"],
      "env": {
        "HN_USERNAME": "your_hn_username",
        "HN_PASSWORD": "your_hn_password"
      }
    }
  }
}

Cursor / Windsurf

Add to your MCP config:

{
  "hackernews": {
    "command": "uv",
    "args": ["run", "--directory", "/Users/YOU/path/to/hn-mcp", "python3", "server.py"],
    "env": {
      "HN_USERNAME": "your_hn_username",
      "HN_PASSWORD": "your_hn_password"
    }
  }
}

Usage

Just talk naturally:

  • "Submit my dispatch to Hacker News as Show HN"

  • "Post a comment on item 12345 explaining our scanner"

  • "Check how my last HN submission is doing"

  • "Search HN for axios supply chain attack"

How it works

HN has no write API. This server:

  1. Logs in via HTTP POST with session cookies

  2. Extracts FNID/HMAC CSRF tokens from forms

  3. Submits via POST (same as clicking "submit" in the browser)

  4. Persists cookies to ~/.hn-mcp-cookies.pkl for reuse

Security

  • Credentials via environment variables (never in code)

  • Session cookies at ~/.hn-mcp-cookies.pkl

  • No data sent anywhere except news.ycombinator.com and hn.algolia.com

License

MIT — booklib-ai

Available Tools

5 tools
hn_commentA
Destructive

Post a comment on a Hacker News story or reply to a comment. Requires login.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

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?

Annotations already indicate destructiveHint=true. The description adds the requirement of login, which is useful behavioral context. However, it does not disclose other potential behaviors like rate limits, character limits, or that comments are publicly visible.

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 sentence that conveys the essential information efficiently. It is front-loaded and contains no unnecessary words 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?

Given that an output schema exists (not shown but indicated), the description does not need to explain return values. It covers purpose and login requirement, but lacks context about what constitutes a valid item_id (e.g., requiring an existing story or comment ID).

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 provides descriptions for both 'text' and 'item_id', so schema_description_coverage is high. The tool description does not add any additional meaning beyond what the schema provides, hence a 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 ('Post a comment') and the resource ('on a Hacker News story or reply to a comment'). It distinguishes itself from sibling tools like hn_submit (for submitting stories) and hn_login (for authentication).

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?

The description mentions a prerequisite ('Requires login') but does not provide explicit guidance on when to use this tool versus alternatives, such as when to use hn_submit instead. Usage is implied by the tool's purpose.

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

hn_loginA

Login to Hacker News. Persists session cookies to disk so you stay logged in across restarts.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

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

Annotations (readOnlyHint=false, destructiveHint=false) indicate mutation. The description adds behavior not covered by annotations: 'Persists session cookies to disk so you stay logged in across restarts.' No contradiction.

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 concise sentences that front-load the purpose and add a key behavioral detail. No unnecessary words.

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 login tool, the description covers purpose and persistence. It lacks details about authentication failure handling or session scope, but is largely complete given the simplicity.

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 provides descriptions for username and password, including fallback to environment variables. The description adds no further parameter semantics 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 explicitly states 'Login to Hacker News.' The verb 'Login' and resource 'Hacker News' are clear and distinct from sibling tools like hn_search or hn_submit.

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?

No explicit guidance on when to use or avoid using the tool. Usage is implied as a prerequisite for other actions, but no exclusions or alternative tool references are provided.

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

hn_my_submissionsA
Read-only

Get your recent HN submissions with their scores and comment counts.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

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?

Annotations already declare readOnlyHint=true, so description adds some value by mentioning return data (scores, comment counts). However, it omits details like authentication needs, what 'recent' means, or rate limits.

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?

Single sentence with clear subject and object. No fluff, front-loaded with the verb and resource.

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?

Simple tool with one parameter and output schema present. Description covers the basic return info (scores, comment counts). Could mention ordering (e.g., most recent first) but not critical.

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 only parameter (username) is well-described in the schema itself ('HN username. Defaults to logged-in user.'). Description adds nothing beyond schema, and schema coverage is effectively 100% for this single parameter.

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?

Description clearly states the action (Get) and resource (your recent HN submissions) and specifies the data included (scores, comment counts). It distinguishes from sibling tools like hn_submit (create) and hn_search (search).

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?

No explicit guidance on when to use this tool vs alternatives such as hn_search. It implies usage for the logged-in user or a specified username, but lacks when-not-to-use or alternative recommendations.

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

hn_submitA
Destructive

Submit a story to Hacker News. Requires login first. For link posts: provide title + url. For Ask HN / text posts: provide title + text (no url).

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior4/5

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

Annotations indicate destructiveHint true, and the description confirms it's a write operation. It adds the prerequisite of login. No contradictions, but could mention rate limits or error conditions.

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?

Three sentences, front-loaded with the main action, no wasted words. Each sentence adds essential information.

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?

Given the output schema exists, the description covers the two main use cases, prerequisites, and parameter interplay. No gaps for the tool's function.

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?

The schema has descriptions for parameters, but the description adds valuable context on when to use url vs. text, clarifying conditional usage 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 it submits a story to Hacker News, distinguishes between link and text posts, and contrasts with sibling tools like hn_comment and hn_search.

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

Usage Guidelines5/5

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

The description provides explicit usage instructions: requires login first, and specifies conditions for link vs. text posts. It implicitly guides not to use for commenting or searching.

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. 5 tool updatesv0.1.0
    • First observedhn_comment
    • First observedhn_login
    • First observedhn_my_submissions
    • First observedhn_search
    • First observedhn_submit

TDQS

A3.8/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: login, search, submit, comment, and viewing own submissions. There is no overlap or ambiguity between them.

Naming Consistency4/5

All tools use the 'hn_' prefix and mostly follow a verb pattern, but 'hn_my_submissions' is a noun phrase with a possessive, breaking the verb pattern slightly.

Tool Count5/5

With 5 tools covering login, search, submission, comments, and personal submissions, the count is well-scoped for a Hacker News client without being excessive.

Completeness3/5

The set covers basic HN interactions but misses common actions like upvoting, viewing specific stories, or reading comments. These gaps may require workarounds.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • 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
    C
    maintenance
    MCP server enabling AI agents to interact with Hacker News, including fetching full comment trees with depth control, searching stories and comments, and retrieving user profiles.
    6
    5
    MIT