MCP Claude Hacker News is an MCP (Model Context Protocol) integration that lets Claude Desktop interact with Hacker News.
Purpose This project connects Hacker News capabilities to Claude Desktop, enabling Claude to browse, search, and view content on Hacker News through natural language or by directly calling tools.
Main capabilities
- Browse the latest stories on Hacker News
- View top and best-rated stories
- Search stories by keyword, with support for sorting by relevance or most recent time (Algolia HN Search API)
- Get story details
- Read story comments, with a cap on the number of comments to avoid a busy discussion thread filling up the context
- Cleanly format Hacker News content, including HTML entity decoding, to improve readability
Requirements
- Node.js 20 or later
- A network connection with access to the Hacker News API
Installation methods
- Install via Smithery: install the packaged version from the Smithery server page, or install using the CLI.
- Manual installation: clone or download the repository, install dependencies, and build the project.
Running the MCP server There are two ways:
- Run manually: open a terminal, go to the project directory, and run the server directly (node build/index.js). When using Claude Desktop, you need to keep that terminal window open; the server will run until the terminal is closed.
- Start automatically with Claude Desktop (recommended for regular use): Claude Desktop can automatically start the MCP server when needed.
Claude Desktop configuration file locations: 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 toadd the Hacker News MCP configuration; create the file if it does not exist. You need to replace ABSOLUTE_PATH_TO_DIRECTORY with the full absolute path where the MCP is installed. For example: macOS/Linux: /Users/username/mcp-claude-hackernews Windows: C:\Users\username\mcp-claude-hackernews
If you already have other MCP configurations, just add the hackerNews section inside the mcpServers object. After modifying the configuration, you need to restart Claude Desktop. Once configured, the MCP server will start automatically when Claude Desktop needs it, and will run as a child process managed by Claude Desktop.
Available tools Hacker News MCP provides 6 dedicated tools for different functions:
- limit (optional): the number of stories to fetch, type number, range 1-50, default 10
- query (required): search term, type string, for example "model context protocol"
- limit (optional): number of results, 1-50, default 10
- sort (optional): relevance (default) or date, used to sort with the newest first
- story_id (required): the story ID to fetch, type number, for example 12345678
- story_id (optional): the story ID to fetch comments for, type number, for example 12345678
- story_index (optional): the index of the story in the previously fetched list, type number (starting from 1), for example 3 means the 3rd story in the previous list
- limit (optional): the maximum number of top-level comments to return, type number, range 1-50, default 20
Note: For hn_comments, you must provide either story_id or story_index. Only top-level comments are fetched, each comment reports its reply count, and the response will state how many top-level comments of that thread were returned.
Usage examples Use the tools directly, or query through natural language, for example:
- "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”
- “Search Hacker News for stories about machine learning”
- “Get the comments for story number 5 from the last list”
- “Show me the details of story ID 12345678”
Language
- “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 “Server disconnected” error:
- Verify the server is running: manually run node build/index.js in the project directory; if it starts successfully, keep the terminal open and use Claude
- Check the configuration: make sure the absolute paths in claude_desktop_config.json are correct; Windows paths must use double backslashes (\); make sure to use the full path starting from the filesystem root
- Try the auto-start option
Tool does not appear in Claude:
- Confirm that Claude Desktop has been restarted after configuration
- Check the Claude Desktop logs for MCP communication errors
- Make sure 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
Check whether the server is running:
- Windows: open Task Manager, go to the "Details" tab, and look for "node.exe"
- macOS/Linux: open a terminal and run ps aux | grep node If you do not see the server running, start it manually or use the auto-start method.
Testing Run the test suite (no network required).
Contributing and License Welcometo submit a Pull Request. The project is licensed under the Mozilla Public License 2.0.
References
- Model Context Protocol
- Hacker News API