This server allows interaction with Hacker News via Claude Desktop using the Model Context Protocol (MCP).
Browse Stories: Access latest, top, and best-rated stories
Get Story Details: Retrieve information about specific stories
Read Comments: View comments for particular stories
Custom Quantity: Specify number of stories (default 10, max 50) using --parameter (e.g., --20)
Simple Commands: Use intuitive commands like
hn latest
,hn top
,hn best
,hn history
, andhn comments
Clean Formatting: Improved readability of Hacker News content
Translation Support: Translate content into different languages
Natural Language Queries: Interact using direct commands or conversational requests
Allows Claude Desktop to browse and interact with Hacker News content, including viewing latest/top/best stories, reading story details and comments, and formatting Hacker News content for better readability.
MCP Claude Hacker News
Features
Browse latest stories from Hacker News
View top and best-rated stories
Get story details
Read comments for stories
Clean formatting of Hacker News content for better readability
Demo
Requirements
Node.js 16 or higher
Claude Desktop
Internet connection to access Hacker News API
Installation
Installing Manually
Clone or download this repository:
Install dependencies:
Build the project:
Running the MCP Server
There are two ways to run the MCP server:
Option 1: Running manually
Open a terminal or command prompt
Navigate to the project directory
Run the server directly:
Keep this terminal window open while using Claude Desktop. The server will run until you close the terminal.
Option 2: Auto-starting with Claude Desktop (recommended for regular use)
The Claude Desktop can automatically start the MCP server when needed. To set this up:
Configuration
The Claude Desktop configuration file is located at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Linux:
~/.config/Claude/claude_desktop_config.json
Edit this file to add the Hacker News MCP configuration. If the file doesn't exist, create it:
Important: Replace ABSOLUTE_PATH_TO_DIRECTORY
with the complete absolute path where you installed the MCP
macOS/Linux example:
/Users/username/mcp-claude-hackernews
Windows example:
C:\\Users\\username\\mcp-claude-hackernews
If you already have other MCPs configured, simply add the "hackerNews" section inside the "mcpServers" object. Here's an example of a configuration with multiple MCPs:
The MCP server will automatically start when Claude Desktop needs it, based on the configuration in your claude_desktop_config.json
file.
Usage
Restart Claude Desktop after modifying the configuration
In Claude, use the
hn
command to interact with Hacker NewsThe MCP server runs as a child process managed by Claude Desktop
Available Commands
The Hacker News MCP provides a single tool named hn
with several commands:
Command | Description | Parameters | Example |
| Get the most recent stories from Hacker News |
: Optional number of stories (default: 10, max: 50) |
|
| Get the top stories from Hacker News |
: Optional number of stories (default: 10, max: 50) |
|
| Get the best stories from Hacker News |
: Optional number of stories (default: 10, max: 50) |
|
| Get detailed information about a specific story |
: Required story ID |
|
| Get comments for a story |
: Required index from last list or story ID |
or
|
Example Usage
Here are various examples of how to use the Hacker News MCP with Claude:
Direct Commands:
Natural Language Queries:
You can also interact with the MCP using natural language. Claude will interpret these requests and use the appropriate commands:
"Show me the top 30 stories on Hacker News today"
"What are the 40 latest posts on Hacker News?"
"I'd like to see the 20 best articles from Hacker News"
"Can you fetch me 30 recent tech news stories from Hacker News?"
"Tell me what's the top 50 trending topics on Hacker News"
"Show me 20 Hacker News stories about machine learning"
"Get me the 40 most recent Hacker News headlines"
"What are the 30 most active discussions on Hacker News right now?"
"I'm interested in reading the 40 most popular Hacker News articles this week"
"Show me a list of 20 best programming articles from Hacker News"
Language Translation Requests:
You can request Hacker News content to be translated into different languages:
"Show me the top 30 stories on Hacker News today in Spanish"
"Get the 20 latest Hacker News posts and translate them to French"
"I'd like to see the 40 best articles from Hacker News in German"
"Show me 30 recent Hacker News stories translated to Japanese"
"Get the top 20 Hacker News articles and present them in Portuguese"
Troubleshooting
"Server disconnected" error
If you see the error "MCP Hacker News: Server disconnected" in Claude Desktop:
Verify the server is running:
Open a terminal and manually run
node build/index.js
from the project directoryIf the server starts successfully, use Claude while keeping this terminal open
Check your configuration:
Ensure the absolute path in
claude_desktop_config.json
is correct for your systemDouble-check that you've used double backslashes (
\\
) for Windows pathsVerify you're using the complete path from the root of your filesystem
Try the auto-start option:
Set up the auto-start script for your operating system as described in the "Setting up auto-start scripts" section
This ensures the server is always running when you need it
Tools not appearing in Claude
If the Hacker News tools don't appear in Claude:
Make sure you've restarted Claude Desktop after configuration
Check the Claude Desktop logs for any MCP communication errors
Ensure the MCP server process is running (run it manually to confirm)
Verify that the MCP server is correctly registered in the Claude Desktop MCP registry
Checking if the server is running
To check if the server is running:
Windows: Open Task Manager, go to the "Details" tab, and look for "node.exe"
macOS/Linux: Open Terminal and run
ps aux | grep node
If you don't see the server running, start it manually or use the auto-start method.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.
Related Links
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
mcp-claude-hackernews
Related MCP Servers
- AsecurityAlicenseAqualityMCP Server for the Slack API, enabling Claude to interact with Slack workspaces.Last updated -11,12068,255MIT License
- AsecurityAlicenseAqualityFetches and processes Hacker News discussions to prepare them for Claude to generate high-quality summaries, handling comment structure and metadata to help Claude understand the relative importance of different comments.Last updated -1MIT License
- MIT License