- Explore MCP Servers
- hn-server
Hn Server
What is Hn Server
hn-server is a Model Context Protocol (MCP) server designed to fetch and provide structured data from Hacker News stories, including various types such as top, new, ask, show, and jobs.
Use cases
Use cases for hn-server include integrating with applications to display Hacker News stories, fetching the latest news for analysis, and providing updates on specific topics or job postings.
How to use
To use hn-server, clone the repository, install dependencies, build the server, and configure it in your MCP settings. You can then utilize the ‘get_stories’ tool to fetch stories by specifying the type and limit of stories.
Key features
Key features include fetching different types of stories, structured data output (titles, URLs, points, authors, timestamps, comment counts), configurable story limits, and robust error handling.
Where to use
undefined
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Hn Server
hn-server is a Model Context Protocol (MCP) server designed to fetch and provide structured data from Hacker News stories, including various types such as top, new, ask, show, and jobs.
Use cases
Use cases for hn-server include integrating with applications to display Hacker News stories, fetching the latest news for analysis, and providing updates on specific topics or job postings.
How to use
To use hn-server, clone the repository, install dependencies, build the server, and configure it in your MCP settings. You can then utilize the ‘get_stories’ tool to fetch stories by specifying the type and limit of stories.
Key features
Key features include fetching different types of stories, structured data output (titles, URLs, points, authors, timestamps, comment counts), configurable story limits, and robust error handling.
Where to use
undefined
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Hacker News MCP Server
A Model Context Protocol (MCP) server that provides tools for fetching stories from Hacker News. This server parses the HTML content from news.ycombinator.com and provides structured data for different types of stories (top, new, ask, show, jobs).
Features
- Fetch different types of stories (top, new, ask, show, jobs)
- Get structured data including titles, URLs, points, authors, timestamps, and comment counts
- Configurable limit on number of stories returned
- Clean error handling and validation
Installation
- Clone the repository:
git clone https://github.com/pskill9/hn-server
cd hn-server
- Install dependencies:
npm install
- Build the server:
npm run build
- Add to your MCP settings configuration file (location depends on your system):
For VSCode Claude extension:
{
"mcpServers": {
"hacker-news": {
"command": "node",
"args": [
"/path/to/hn-server/build/index.js"
]
}
}
}
Usage
The server provides a tool called get_stories that can be used to fetch stories from Hacker News.
Tool: get_stories
Parameters:
type(string): Type of stories to fetch- Options: ‘top’, ‘new’, ‘ask’, ‘show’, ‘jobs’
- Default: ‘top’
limit(number): Number of stories to return- Range: 1-30
- Default: 10
Example usage:
use_mcp_tool with:
server_name: "hacker-news"
tool_name: "get_stories"
arguments: {
"type": "top",
"limit": 5
}
Sample output:
Integrating with Claude
To use this MCP server with Claude, you’ll need to:
- Have the Claude desktop app or VSCode Claude extension installed
- Configure the MCP server in your settings
- Use Claude’s natural language interface to interact with Hacker News
Configuration
For the Claude desktop app, add the server configuration to:
For the VSCode Claude extension, add to:
Example Interactions
Once configured, you can interact with Claude using natural language to fetch Hacker News stories. Examples:
- “Show me the top 5 stories from Hacker News”
- “What are the latest Ask HN posts?”
- “Get me the top Show HN submissions from today”
Claude will automatically use the appropriate parameters to fetch the stories you want.

Story Object Structure
Each story object contains:
title(string): The story titleurl(string, optional): URL of the story (may be internal HN URL for text posts)points(number): Number of upvotesauthor(string): Username of the postertime(string): Timestamp of when the story was postedcommentCount(number): Number of commentsrank(number): Position in the list
Development
The server is built using:
- TypeScript
- Model Context Protocol SDK
- Axios for HTTP requests
- Cheerio for HTML parsing
To modify the server:
- Make changes to
src/index.ts - Rebuild:
npm run build
Error Handling
The server includes robust error handling for:
- Invalid story types
- Network failures
- HTML parsing errors
- Invalid parameter values
Errors are returned with appropriate error codes and descriptive messages.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - feel free to use this in your own projects.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










