Hacker News MCP Server

Hacker News MCP Server

Fetch and structure Hacker News stories via the Model Context Protocol.

35
Stars
9
Forks
35
Watchers
2
Issues
Provides an MCP server that enables fetching and parsing stories from Hacker News with structured output. Supports retrieval of different types of stories, configurable limits, and clean error handling. Designed for integration with Claude and other MCP-compatible interfaces, offering a standardized tool for AI-driven access to Hacker News data.

Key Features

Fetches top, new, ask, show, and jobs stories from Hacker News
Parses HTML content into structured JSON objects
Configurable limit on returned stories
Returns detailed story metadata including title, URL, author, points, timestamp, comments, and rank
Clean error handling for invalid parameters and network issues
Simple configuration for integration with Claude (desktop and VSCode extension)
Built with TypeScript for type safety
Uses Axios for HTTP requests
Leverages Cheerio for HTML parsing
Easy integration as an MCP server in AI toolchains

Use Cases

Automatically curating top Hacker News stories for AI models
Fetching newest or trending tech news for context-aware agents
Aggregating Ask HN or Show HN posts for research or summary
Integrating real-time news into conversational agents like Claude
Generating news digests for productivity tools
Supplying structured story feeds to dashboards or analytics systems
Enabling developer tools to surface Hacker News trends on demand
Custom story filtering and retrieval for content recommendation engines
Providing context to summarization or question answering models
Monitoring job openings or career discussions on Hacker News

README

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

  1. Clone the repository:
bash
git clone https://github.com/pskill9/hn-server
cd hn-server
  1. Install dependencies:
bash
npm install
  1. Build the server:
bash
npm run build
  1. Add to your MCP settings configuration file (location depends on your system):

For VSCode Claude extension:

json
{
  "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:

typescript
use_mcp_tool with:
server_name: "hacker-news"
tool_name: "get_stories"
arguments: {
  "type": "top",
  "limit": 5
}

Sample output:

json
[
  {
    "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
]

Integrating with Claude

To use this MCP server with Claude, you'll need to:

  1. Have the Claude desktop app or VSCode Claude extension installed
  2. Configure the MCP server in your settings
  3. Use Claude's natural language interface to interact with Hacker News

Configuration

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

json
// ~/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:

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

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.

Claude using the Hacker News MCP server

Story Object Structure

Each story object contains:

  • 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

Development

The server is built using:

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

To modify the server:

  1. Make changes to src/index.ts
  2. Rebuild:
bash
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.

Star History

Star History Chart

Repository Owner

pskill9
pskill9

User

Repository Details

Language JavaScript
Default Branch main
Size 820 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

JavaScript
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Notion MCP Server

    Notion MCP Server

    Enable LLMs to interact with Notion using the Model Context Protocol.

    Notion MCP Server allows large language models to interface with Notion workspaces through a Model Context Protocol server, supporting both data retrieval and editing capabilities. It includes experimental Markdown conversion to optimize token usage for more efficient communication with LLMs. The server can be configured with environment variables and controlled for specific tool access. Integration with applications like Claude Desktop is supported for seamless automation.

    • 834
    • MCP
    • suekou/mcp-notion-server
  • MCP Manager for Claude Desktop

    MCP Manager for Claude Desktop

    A desktop app to manage Model Context Protocol (MCP) servers for Claude Desktop on MacOS.

    MCP Manager for Claude Desktop provides a user-friendly interface to manage Model Context Protocol (MCP) servers, enabling Claude to access private data, APIs, and local or remote services securely from a MacOS desktop. It facilitates rapid configuration and integration with a wide variety of MCP servers, including productivity tools, databases, and web APIs. The app runs locally to ensure data privacy and streamlines connecting Claude to new sources through simple environment and server settings management.

    • 270
    • MCP
    • zueai/mcp-manager
  • TikTok MCP

    TikTok MCP

    Integrate TikTok video analysis and search into AI systems via the Model Context Protocol.

    TikTok MCP enables integration of TikTok video access and analysis into AI applications such as Claude AI using the Model Context Protocol. It provides tools to extract subtitles, retrieve video details, and search TikTok content, facilitating contextual understanding for models. Built on Node.js and requiring a TikNeuron API key, it offers seamless connectivity between AI systems and TikTok's data. The tool supports retrieving metadata, engagement metrics, and advanced search with pagination capabilities.

    • 112
    • MCP
    • Seym0n/tiktok-mcp
  • Model Context Protocol Server for Home Assistant

    Model Context Protocol Server for Home Assistant

    Seamlessly connect Home Assistant to LLMs for natural language smart home control via MCP.

    Enables integration between a local Home Assistant instance and language models using the Model Context Protocol (MCP). Facilitates natural language monitoring and control of smart home devices, with robust API support for state management, automation, real-time updates, and system administration. Features secure, token-based access, and supports mobile and HTTP clients. Designed to bridge Home Assistant environments with modern AI-driven automation.

    • 468
    • MCP
    • tevonsb/homeassistant-mcp
  • MCP Claude Hacker News

    MCP Claude Hacker News

    Seamless Hacker News integration for Claude Desktop via Model Context Protocol.

    MCP Claude Hacker News is an MCP server that enables Claude Desktop to access, browse, and interact with Hacker News content. It allows users to view the latest, top, and best-rated stories, retrieve detailed information, and read story comments in a clean, structured format. Designed for easy integration, it supports both manual launch and automated startup with Claude Desktop.

    • 9
    • MCP
    • imprvhub/mcp-claude-hackernews
  • Hacker News MCP Server

    Hacker News MCP Server

    An MCP server for accessing and analyzing Hacker News stories, comments, and users.

    Hacker News MCP Server implements the Model Context Protocol to provide tools for fetching and searching Hacker News stories, retrieving story comments, and accessing user information. It integrates seamlessly with AI assistants like Claude Desktop and supports use via Smithery. The server is designed for structured information retrieval, contextual exploration, and summarization of Hacker News content.

    • 55
    • MCP
    • erithwik/mcp-hn
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results