Hacker News MCP Server
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.
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., "@Hacker News MCP Serverwhat are the top 10 stories on hacker news right now?"
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.
📰 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 NewsConfigurable 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 storyFetch complete story metadata
Optional comment inclusion with threaded structure
Optional markdown content extraction from linked articles
get_story_comments- Retrieve popular comments for a storyConfigurable 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 keywordsSearch through story titles, content, and URLs
Configurable time range (1-168 hours)
Limit results (1-50 stories)
Related MCP server: HackerNews MCP Server
📋 Prerequisites
Node.js 18+
npm or yarn
An MCP-compatible client (like Claude Desktop)
🔧 Installation
1. Clone the repository
git clone https://github.com/yourusername/hackernews-mcp.git
cd hackernews-mcp2. Install dependencies
npm install3. Build the server
npm run build🎯 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
{
"mcpServers": {
"hackernews-mcp": {
"command": "node",
"args": ["/path/to/hackernews-mcp/build/index.js"]
}
}
}With Other MCP Clients
The server communicates via stdio and can be used with any MCP-compatible client:
node build/index.js🔍 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
npm run buildWatch mode for development
npm run watchLint and format the code
npm run lint
npm run formatRun the MCP Inspector
For debugging and testing:
npm run inspectorThis 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 lintandnpm run formatbefore pushingPush to the branch (
git push origin feature/amazing-feature)Open a Pull Request
📚 API Reference
get_top_stories
{
count?: number; // Number of stories (1-100, default: 30)
include_text?: boolean; // Include story text content (default: false)
}get_story_details
{
story_id: number; // Required: HN story ID
include_comments?: boolean; // Include comments (default: false)
include_markdown?: boolean; // Extract article as markdown (default: false)
}get_story_comments
{
story_id: number; // Required: HN story ID
min_score?: number; // Minimum comment score (default: 1)
max_depth?: number; // Max thread depth (1-10, default: 3)
limit?: number; // Max comments (1-100, default: 20)
}search_stories
{
query: string; // Required: Search keywords
limit?: number; // Max results (1-50, default: 20)
time_range_hours?: number; // Hours to search back (1-168, default: 24)
}🏗️ 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 inspectorCreate a new issue with detailed information about your problem
Made with ❤️ for the MCP community
Available Tools
1 toolget_top_hackernews_storiesD
| Name | Required | Description | Default |
|---|---|---|---|
| count | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion or overlap between tools. The single tool has a clear, distinct purpose of retrieving top stories from Hacker News.
With only one tool, naming consistency is inherently perfect. The tool name follows a clear verb_noun pattern (get_top_hackernews_stories) that would be appropriate if more tools were added.
A single tool is too few for a server named 'Hacker News MCP Server', which suggests broader functionality. While get_top_hackernews_stories is useful, the server lacks tools for other common Hacker News operations like getting new stories, best stories, or individual items.
The server is severely incomplete for the Hacker News domain. It only provides access to top stories, missing essential operations like retrieving new stories, best stories, individual items, comments, user profiles, or search functionality that would be expected from a Hacker News API.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Dive into the latest and greatest from the tech world with our Hacker News MCP server.
Hacker News MCP — search and retrieve stories from Hacker News
Hosted MCP server for live public-data APIs and Skills for AI agents.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI tools like Claude and Cursor to fetch and interact with live Hacker News data (posts, comments, users) via standardized MCP endpoints.1111933MIT
- AlicenseAqualityDmaintenanceA server that enables AI assistants to access, analyze, and understand HackerNews content through standardized Model Context Protocol interfaces, providing tools for searching posts, analyzing users, and tracking trending topics.58MIT
- AlicenseAqualityDmaintenanceMCP server for Hacker News that enables AI agents to search stories, read comments, and track tech trends via the public Hacker News API and Algolia HN Search.10154MIT
- AlicenseAqualityCmaintenanceMCP server enabling AI agents to interact with Hacker News, including fetching full comment trees with depth control, searching stories and comments, and retrieving user profiles.65MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GeorgeNance/hackernews-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server