HackerNews MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install -g hn-mcp-server
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add hackernews-mcp -- node "<FULL_PATH_TO_HACKERNEWS_MCP>/dist/index.js"

Replace <FULL_PATH_TO_HACKERNEWS_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Programmatic access to Hacker News content via the HN Algolia API.

Hackernews_mcp

HackerNews MCP Server

A Model Context Protocol (MCP) server that provides programmatic access to Hacker News content via the HN Algolia API. This server enables AI assistants like Claude to search stories, retrieve comments, access user profiles, and explore the HN front page in real-time.

Features

  • โœ… 9 MCP Tools for comprehensive HN access
  • ๐Ÿ” Search: Stories by relevance or date, comments with filters
  • ๐Ÿ“ฐ Browse: Front page, latest stories, Ask HN, Show HN posts
  • ๐Ÿ‘ค Details: Retrieve specific stories with nested comments and user profiles
  • โšก Rate Limiting: Respects HN API limits (10,000 req/hr)
  • ๐Ÿ›ก๏ธ Type-Safe: Full TypeScript with strict mode
  • ๐Ÿ“Š Observable: Structured JSON logging with correlation IDs
  • ๐Ÿงช Tested: Unit, integration, and contract tests

Installation

NPM (when published)

npm install -g hn-mcp-server

From Source

git clone https://github.com/YOUR_USERNAME/hn-mcp-server.git
cd hn-mcp-server
npm install
npm run build
npm link

Quick Start (VS Code)

The fastest way to get started is with VS Code and GitHub Copilot:

  1. Clone and build:

    git clone <your-repo-url>
    cd hn-mcp-server
    npm install
    npm run build
    
  2. Open in VS Code:

    code .
    
  3. Reload VS Code (Ctrl+Shift+P โ†’ "Developer: Reload Window")

  4. Follow the complete setup checklist: docs/VSCODE_CHECKLIST.md

  5. Open Copilot Chat and try:

    @workspace What MCP tools are available?
    

    or

    Show me the top stories from Hacker News
    

๐Ÿ“– Step-by-step setup guide: docs/VSCODE_CHECKLIST.md

๐Ÿ“– For detailed VS Code setup instructions, see docs/VSCODE_SETUP.md

โš ๏ธ Tools not appearing? See docs/TROUBLESHOOTING_VSCODE.md

๐Ÿ’ก Tip: MCP support in VS Code is experimental. For the best experience, use Claude Desktop (see configuration below).

Configuration

VS Code with GitHub Copilot

The easiest way to use this server is directly in VS Code with GitHub Copilot:

  1. Build the server:

    npm run build
    
  2. Configuration is already set up in .vscode/mcp.json:

    {
      "hackernews": {
        "command": "node",
        "args": ["${workspaceFolder}/dist/index.js"],
        "env": {
          "DEBUG": "0"
        }
      }
    }
    
  3. Reload VS Code or restart the Copilot extension

  4. Test it by asking Copilot:

    • "Show me the top stories from Hacker News"
    • "Search HN for stories about AI"
    • "Get the user profile for 'pg'"

Claude Desktop

Add to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json

{
  "mcpServers": {
    "hackernews": {
      "command": "hn-mcp-server"
    }
  }
}

Or if installed from source:

{
  "mcpServers": {
    "hackernews": {
      "command": "node",
      "args": ["/path/to/hn-mcp-server/dist/index.js"]
    }
  }
}

Restart Claude Desktop to activate the server.

Available Tools

1. `search_stories`

Search HN stories by relevance with advanced filtering.

{
  query: "artificial intelligence",    // Search term
  tags: "story,front_page",           // Filter by tags
  numericFilters: "points>=100",      // Minimum points
  page: 0,                            // Pagination
  hitsPerPage: 20                     // Results per page
}

2. `search_by_date`

Search stories/comments sorted by date (most recent first).

{
  query: "TypeScript",
  tags: "story",
  numericFilters: "created_at_i>1640000000",  // Unix timestamp
  page: 0,
  hitsPerPage: 20
}

3. `search_comments`

Search comments with optional story/author filtering.

{
  query: "React hooks",
  tags: "author_pg",              // Filter by author
  sortByDate: false,              // Sort by relevance
  page: 0,

Tools (3)

search_storiesSearch HN stories by relevance with advanced filtering.
search_by_dateSearch stories or comments sorted by date.
search_commentsSearch comments with optional story or author filtering.

Environment Variables

DEBUGDebug mode toggle for the server

Configuration

claude_desktop_config.json
{"mcpServers": {"hackernews": {"command": "hn-mcp-server"}}}

Try it

โ†’Show me the top stories from the Hacker News front page right now.
โ†’Search Hacker News for recent stories about artificial intelligence with at least 100 points.
โ†’Find comments by the user 'pg' regarding React hooks.
โ†’Get the latest stories posted today about TypeScript.

Frequently Asked Questions

What are the key features of HackerNews MCP Server?

Search stories by relevance, date, or specific filters. Retrieve nested comments and user profiles. Browse front page, latest stories, Ask HN, and Show HN posts. Respects HN API rate limits of 10,000 requests per hour. Structured JSON logging with correlation IDs.

What can I use HackerNews MCP Server for?

Quickly summarizing top tech news for daily briefings. Researching historical discussions on specific programming topics. Monitoring community sentiment on new technology releases. Aggregating high-quality technical discourse for AI-assisted research.

How do I install HackerNews MCP Server?

Install HackerNews MCP Server by running: npm install -g hn-mcp-server

What MCP clients work with HackerNews MCP Server?

HackerNews MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep HackerNews MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare