Provides programmatic access to Hacker News content via the HN Algolia API, allowing for searching stories and comments, browsing the front page, and retrieving detailed user profiles and nested comment trees.
Click on "Install 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., "@HackerNews MCP Servershow me the top stories about AI from today"
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.
HackerNews MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to Hacker News content via the HN Algolia API. This server enables AI assistants like Claude to search stories, retrieve comments, access user profiles, and explore the HN front page in real-time.
Features
โ 9 MCP Tools for comprehensive HN access
๐ Search: Stories by relevance or date, comments with filters
๐ฐ Browse: Front page, latest stories, Ask HN, Show HN posts
๐ค Details: Retrieve specific stories with nested comments and user profiles
โก Rate Limiting: Respects HN API limits (10,000 req/hr)
๐ก๏ธ Type-Safe: Full TypeScript with strict mode
๐ Observable: Structured JSON logging with correlation IDs
๐งช Tested: Unit, integration, and contract tests
Installation
NPM (when published)
From Source
Quick Start (VS Code)
The fastest way to get started is with VS Code and GitHub Copilot:
Clone and build:
git clone <your-repo-url> cd hn-mcp-server npm install npm run buildOpen in VS Code:
code .Reload VS Code (Ctrl+Shift+P โ "Developer: Reload Window")
Follow the complete setup checklist: docs/VSCODE_CHECKLIST.md
Open Copilot Chat and try:
@workspace What MCP tools are available?or
Show me the top stories from Hacker News
๐ Step-by-step setup guide: docs/VSCODE_CHECKLIST.md
๐ For detailed VS Code setup instructions, see
โ ๏ธ Tools not appearing? See docs/TROUBLESHOOTING_VSCODE.md
๐ก Tip: MCP support in VS Code is experimental. For the best experience, use Claude Desktop (see configuration below).
Configuration
VS Code with GitHub Copilot
The easiest way to use this server is directly in VS Code with GitHub Copilot:
Build the server:
npm run buildConfiguration is already set up in
.vscode/mcp.json:{ "hackernews": { "command": "node", "args": ["${workspaceFolder}/dist/index.js"], "env": { "DEBUG": "0" } } }Reload VS Code or restart the Copilot extension
Test it by asking Copilot:
"Show me the top stories from Hacker News"
"Search HN for stories about AI"
"Get the user profile for 'pg'"
Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
Or if installed from source:
Restart Claude Desktop to activate the server.
Available Tools
1. search_stories
Search HN stories by relevance with advanced filtering.
2. search_by_date
Search stories/comments sorted by date (most recent first).
3. search_comments
Search comments with optional story/author filtering.
4. get_front_page
Retrieve current HN front page stories.
5. get_latest_stories
Get most recently submitted stories.
6. get_ask_hn
Retrieve Ask HN posts (community questions).
7. get_show_hn
Retrieve Show HN posts (project showcases).
8. get_story
Get a specific story by ID with full nested comment tree.
9. get_user
Retrieve user profile by username.
Example Usage in Claude
Search for AI stories:
Get front page:
Find user information:
Advanced search:
Development
Prerequisites
Node.js 20 LTS or higher
npm or yarn
Setup
Commands
Project Structure
Rate Limiting
The HN Algolia API has a limit of 10,000 requests per hour per IP address. This server:
Tracks request count automatically
Warns at 90% (9,000 requests)
Throws error at 95% (9,500 requests)
Resets counter every hour
Logging
Structured JSON logging with correlation IDs:
Error Handling
All errors return MCP-formatted responses with:
Clear error messages
Error codes (RATE_LIMIT_EXCEEDED, ITEM_NOT_FOUND, etc.)
Context for debugging
Suggested user actions
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes following the constitution principles
Run quality gates (
npm run ci)Commit (
git commit -m 'Add amazing feature')Push (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT License - see LICENSE file for details.
Links
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Built with โค๏ธ following MCP best practices and constitution principles