Hacker News MCP

by pskill9

25 stars
1 downloads
Not rated
GitHub

About

Parses the HTML content from news.ycombinator.com (Hacker News) and provides structured data for different types of stories (top, new, ask, show, jobs).

Details

Author
pskill9
Repository
pskill9/hn-server
GitHub stars
25
Downloads
1
License
MIT License
Categories
Web Scraping, Other
Tags
#data

- 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

Setting up with Highlight

Follow these steps to add this server as a custom Highlight plugin:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Hacker News MCP
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 /path/to/hn-server/build/index.js

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

The server provides a tool called get_stories that can be used to fetch stories from Hacker News.

get_stories

Fetch stories from Hacker News. Parameters: type (string) - type of stories to fetch ('top', 'new', 'ask', 'show', 'jobs', default 'top'); limit (number) - number of stories to return (range: 1-30, default 10).

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "hacker news mcp": {
            "cwd": "string",
            "env": {},
            "args": [
                "/path/to/hn-server/build/index.js"
            ],
            "shell": false,
            "command": "node"
        }
    }
}

Linux

{
    "cwd": "string",
    "env": [],
    "args": [
        "/path/to/hn-server/build/index.js"
    ],
    "shell": false,
    "command": "node"
}

Macos

{
    "cwd": "string",
    "env": [],
    "args": [
        "/path/to/hn-server/build/index.js"
    ],
    "shell": false,
    "command": "node"
}

Windows

{
    "cwd": "string",
    "env": [],
    "args": [
        "/path/to/hn-server/build/index.js"
    ],
    "shell": false,
    "command": "node"
}

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).

- 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

git clone https://github.com/pskill9/hn-server cd hn-server

- Add to your MCP settings configuration file (location depends on your system):

{ "mcpServers": { "hacker-news": { "command": "node", "args": ["/path/to/hn-server/build/index.js"] } } }

The server provides a tool calledget_storiesthat can be used to fetch stories from Hacker News.

- type(string): Type of stories to fetch

- Options: 'top', 'new', 'ask', 'show', 'jobs'
- Default: 'top'

use_mcp_tool with: server_name: "hacker-news" tool_name: "get_stories" arguments: { "type": "top", "limit": 5 }
[ { "title": "Example Story Title", "url": "https://example.com/story", "points": 100, "author": "username", "time": "2024-12-28T00:03:05", "commentCount": 50, "rank": 1 }, // ... more stories ]

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

For the Claude desktop app, add the server configuration to:

// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) // %APPDATA%\Claude\claude_desktop_config.json (Windows) { "mcpServers": { "hacker-news": { "command": "node", "args": ["/path/to/hn-server/build/index.js"] } } }

For the VSCode Claude extension, add to:

// VSCode Settings JSON { "mcpServers": { "hacker-news": { "command": "node", "args": ["/path/to/hn-server/build/index.js"] } } }

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.

- title(string): The story title
- url(string, optional): URL of the story (may be internal HN URL for text posts)
- points(number): Number of upvotes
- author(string): Username of the poster
- time(string): Timestamp of when the story was posted
- commentCount(number): Number of comments
- rank(number): Position in the list

- TypeScript
- Model Context Protocol SDK
- Axios for HTTP requests
- Cheerio for HTML parsing

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.

Contributions are welcome! Please feel free to submit a Pull Request.

MIT License - feel free to use this in your own projects.

Fetches and caches daily articles from GeekNews using web scraping.

Fetches and caches RSS feeds using a SQLite database for use with LLMs via the MCP protocol.

Real-time news aggregation from AP, BBC, NPR, Hacker News, and Google News

Fetches RSS feeds and returns entries as formatted text, with support for OPML configuration.

Collects and summarizes technical articles from sources like Qiita, Dev.to, NewsAPI, and Hacker News using the Gemini API.

Extracts factual claims from text using the Claimify methodology. Requires an OpenAI API key.

Company intelligence in one tool call — funding, tech stack, employees, competitors, news from public APIs

A server for web crawling and content extraction using the Crawl4AI library.

Scrape any URL with JavaScript rendering and get back clean markdown — built for AI agents, LLM pipelines, and autonomous research workflows.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.