hn-mcp
Provides search capabilities over Hacker News submissions via the Algolia API.
Click on "Deploy 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., "@hn-mcpCheck my recent HN submissions"
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.
🟠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 |
| Login to HN (persists cookies across restarts) |
| Submit a story (link post or Ask HN) |
| Post a comment or reply |
| Check your recent posts with scores |
| Search HN via Algolia |
Related MCP server: @cyanheads/hn-mcp-server
Setup
cd hn-mcp
uv syncClaude 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:
Logs in via HTTP POST with session cookies
Extracts FNID/HMAC CSRF tokens from forms
Submits via POST (same as clicking "submit" in the browser)
Persists cookies to
~/.hn-mcp-cookies.pklfor reuse
Security
Credentials via environment variables (never in code)
Session cookies at
~/.hn-mcp-cookies.pklNo data sent anywhere except
news.ycombinator.comandhn.algolia.com
License
MIT — booklib-ai
Available Tools
5 toolshn_commentADestructive
Post a comment on a Hacker News story or reply to a comment. Requires login.
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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_submissionsARead-only
Get your recent HN submissions with their scores and comment counts.
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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_searchBRead-only
Search Hacker News stories via Algolia.
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark it readOnlyHint=true; description only adds 'via Algolia' without additional behavioral context like rate limits or caching.
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?
A single, clear sentence with no wasted words.
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?
Minimal but adequate given the simple interface and presence of an output schema; could include result format or search behavior.
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?
Schema has 0% description coverage and the tool description adds no extra meaning beyond the parameter names and defaults.
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 clearly states it searches Hacker News stories via Algolia, distinguishing it from siblings like hn_comment and hn_submit.
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?
No guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
hn_submitADestructive
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).
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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.
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.
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.
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.
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.
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.
5 tool updates
v0.1.0- First observed
hn_comment - First observed
hn_login - First observed
hn_my_submissions - First observed
hn_search - First observed
hn_submit
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: login, search, submit, comment, and viewing own submissions. There is no overlap or ambiguity between them.
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.
With 5 tools covering login, search, submission, comments, and personal submissions, the count is well-scoped for a Hacker News client without being excessive.
The set covers basic HN interactions but misses common actions like upvoting, viewing specific stories, or reading comments. These gaps may require workarounds.
Maintenance
Related MCP Connectors
Dive into the latest and greatest from the tech world with our Hacker News MCP server.
Hacker News MCP — search and retrieve stories from Hacker News
Deterministic Hacker News developer sentiment, themes & feature requests via MCP. No API key.
Remote MCP server for SeenThis AI Hub. Supports browsing, searching, and posting to AI boards.
Related MCP Servers
- AlicenseDqualityDmaintenanceAn MCP server that enables AI assistants to access real-time Hacker News data including top stories, story details, comments, and search functionality.118 npm3MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Hacker News providing tools to fetch stories, threads, users, and search content via Firebase and Algolia APIs.279 npm4Apache 2.0
- AlicenseAqualityCmaintenanceMCP server for Hacker News that enables AI agents to search stories, read comments, and track tech trends via the public Hacker News API and Algolia HN Search.107 npm4MIT
- AlicenseAqualityCmaintenanceMCP 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.65MIT