The Hacker News MCP Server enables AI assistants to fetch and interact with real-time Hacker News content through dedicated tools:
- Get Top Stories: Retrieve up to 100 top stories (default 10) with optional text content inclusion.
- Get Story Details: Access comprehensive information about specific stories, including metadata, threaded comments, and extracted article content in markdown format.
- Get Story Comments: Fetch popular comments with configurable minimum score, thread depth (1-10 levels), and comment limits (1-100).
- Search Stories: Find recent stories by keywords in titles, content, and URLs, with adjustable time ranges (up to 168 hours) and result limits (up to 50 stories).
Utilized for making HTTP requests to the Hacker News API to fetch stories, comments, and other data.
Integrated for code quality enforcement, running static analysis on the codebase to maintain coding standards.
Used for repository hosting, issue tracking, and collaboration via pull requests.
Used for CI/CD processes to ensure code quality through automated builds, linting, and tests when changes are pushed or pull requests are submitted.
Supported as a platform for running the Claude Desktop client with this MCP server.
Supported for content extraction, with capabilities to convert HTML from linked articles into markdown format.
Required as the runtime environment for the server, with version 18+ specified as a prerequisite.
Used as one of the package managers for installing dependencies and running scripts.
Implemented for automatic code formatting to ensure consistent style across the codebase.
Utilized for type safety throughout the codebase, with explicit type guards for runtime argument validation.
Supported as an alternative package manager for installing dependencies.
📰 Hacker News MCP Server
A Model Context Protocol (MCP) server that provides tools to fetch and interact with Hacker News content. This server enables AI assistants to access real-time Hacker News data including top stories, story details, comments, and search functionality.
🚀 Features
🛠️ Available Tools
get_top_stories
- Fetch the latest top stories from Hacker News- Configurable count (1-100 stories)
- Optional text content inclusion
- Returns story metadata including title, URL, score, author, and comment count
get_story_details
- Get detailed information about a specific story- Fetch complete story metadata
- Optional comment inclusion with threaded structure
- Optional markdown content extraction from linked articles
get_story_comments
- Retrieve popular comments for a story- Configurable minimum score filtering
- Adjustable comment thread depth (1-10 levels)
- Limit number of comments returned (1-100)
- Formatted as readable text with thread structure
search_stories
- Search recent stories by keywords- Search through story titles, content, and URLs
- Configurable time range (1-168 hours)
- Limit results (1-50 stories)
📋 Prerequisites
- Node.js 18+
- npm or yarn
- An MCP-compatible client (like Claude Desktop)
🔧 Installation
1. Clone the repository
2. Install dependencies
3. Build the server
🎯 Usage
With Claude Desktop
Add the server to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
With Other MCP Clients
The server communicates via stdio and can be used with any MCP-compatible client:
🔍 Example Usage
Once connected, you can ask your AI assistant things like:
- "What are the top stories on Hacker News today?"
- "Get details about Hacker News story 12345678"
- "Show me comments for that viral AI story"
- "Search for recent stories about TypeScript"
🛠️ Development
Build the project
Watch mode for development
Lint and format the code
Run the MCP Inspector
For debugging and testing:
This will start the MCP Inspector, providing a web interface to test the server's tools and inspect the communication.
📦 Code Quality & Contributing
- Code Quality:
This project enforces code quality and style using ESLint and Prettier. All code is checked in CI (GitHub Actions) and must pass linting and formatting before merging. - Type Safety:
All tool handlers use explicit type guards for runtime argument validation and robust TypeScript types. - CI/CD:
Every push and pull request runs the full build, lint, and (future) test suite via GitHub Actions. - How to Contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Run
npm run lint
andnpm run format
before pushing - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📚 API Reference
get_top_stories
get_story_details
get_story_comments
search_stories
🏗️ Architecture
The server is built with:
- TypeScript for type safety and developer experience
- @modelcontextprotocol/sdk for MCP protocol implementation
- axios for HTTP requests to Hacker News API
- jsdom and turndown for HTML to Markdown conversion
- private-ip for security (blocks private IP access)
Key Components
src/index.ts
- Main server implementation with tool handlerssrc/fetcher.ts
- Utility class for fetching and converting web contentbuild/
- Compiled JavaScript output (auto-generated)
🔒 Security
- Blocks requests to private IP addresses to prevent local network access
- Rate limiting through Hacker News API natural limits
- Input validation for all tool parameters
- Error handling and graceful degradation
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Hacker News for providing the excellent API
- Model Context Protocol for the standard
- The open source community for the amazing tools and libraries
📞 Support
If you encounter any issues or have questions:
- Check the Issues page
- Use the MCP Inspector for debugging:
npm run inspector
- Create a new issue with detailed information about your problem
Made with ❤️ for the MCP community
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
An MCP server that enables AI assistants to access real-time Hacker News data including top stories, story details, comments, and search functionality.
- 🚀 Features
- 📋 Prerequisites
- 🔧 Installation
- 🎯 Usage
- 🔍 Example Usage
- 🛠️ Development
- 📦 Code Quality & Contributing
- 📚 API Reference
- 🏗️ Architecture
- 🔒 Security
- 📜 License
- 🙏 Acknowledgments
- 📞 Support
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides tools for searching and fetching information from Hacker News.Last updated -46PythonMIT License
- -securityAlicense-qualityAn MCP server that helps AI assistants access text content from websites that implement bot detection, bridging the gap between what you can see in your browser and what the AI can access.Last updated -1PythonApache 2.0
- -securityAlicense-qualityAn MCP server that provides real-time cryptocurrency news sourced from NewsData for AI agents.Last updated -3PythonMIT License
- -securityFlicense-qualityAn MCP server for interacting with the HackathonWatch API, allowing users to access hackathon data and related information through natural language commands.Last updated -Python