Get Hacker News on Claude: A Simple Guide
Want to access the latest Hacker News stories, top discussions, and insightful comments right within Claude? This guide shows you how to set up the MCP Claude Hacker News integration for a seamless experience.
Why Integrate Hacker News with Claude?
- Stay Informed: Browse the latest stories without leaving Claude.
- Save Time: Quickly find the most relevant and best-rated content.
- Improve Readability: Enjoy a cleaner, more readable format of Hacker News content.
- Natural Language Interaction: Use simple commands to get information.
Easy Installation and Setup Guide
Let's get started! Here's how to install and configure the MCP (Model Context Protocol) Claude Hacker News integration:
Prerequisites
Before you begin, ensure you have the following:
- Node.js 16 or higher.
- Claude Desktop installed.
- A stable Internet connection.
Step-by-Step Installation
- Clone the Repository:
- Open your terminal and run:
- Install Dependencies:
- Run the following command:
- Build the Project:
- Execute this command to build the project
Running the MCP Server
You have two options for running the MCP server:
Option 1: Manual Start
- Open a new terminal window.
- Navigate to the project directory.
- Run the server:
node build/index.js
. - Keep the terminal window open while using Claude.
Option 2: Auto-Start with Claude Desktop (Recommended)
Configure Claude Desktop to automatically start the server:
- Locate the Configuration File:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
- Edit the Configuration File:
If the file doesn't exist, create it. Add the "hackerNews" section inside the "mcpServers" object.
Important: Replace ABSOLUTE_PATH_TO_DIRECTORY
with the correct path.
Example Paths:
- macOS/Linux:
/Users/username/mcp-claude-hackernews
- Windows:
C:\\Users\\username\\mcp-claude-hackernews
Using the MCP Server with Claude
- Restart Claude Desktop after modifying the configuration file.
- Use the
hn
command within Claude to interact with Hacker News.
Hacker News Commands and Examples
The Hacker News MCP provides the hn
tool with several commands:
Direct Commands:
hn latest --50
: Shows the 50 latest stories from Hacker News. Great for catching up on recent discussions in tech.hn top --20
: Displays the top 20 stories currently trending.hn best --30
: Lists the 30 best-rated stories.hn history --29384756
: Fetches the story details using the provided id.hn comments --5
: Get the story with id 5 comments.
Natural Language Queries:
Claude can interpret natural language requests:
- "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?"
You can also ask Claude to translate the content:
- "Show me the top 30 stories on Hacker News today in Spanish."
- "Get the 20 latest Hacker News posts and translate them to French."
Troubleshooting Common Issues
"Server disconnected" error:
- Verify Server Status: Manually run
node build/index.js
in a terminal. If it works, use Claude while keeping the terminal open. - Check Configuration: Double-check the absolute path in
claude_desktop_config.json
. For Windows, use double backslashes (\\
). - Try Auto-Start: Configure the auto-start script as described earlier.
Tools not appearing in Claude:
- Restart Claude Desktop.
- Check Claude Logs: Look for MCP communication errors.
- Verify Server is Running: Run the server manually to confirm.
- Check MCP Registration: Ensure the server is registered in the Claude Desktop MCP registry.
How to check if the server is running:
- Windows: Open Task Manager, go to "Details," 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.