Skip to main content
Glama

HackerNews MCP Server

by wei

hn-mcp-server

npm version License: MIT Node.js Version TypeScript Coverage MCP

A Model Context Protocol server that provides AI assistants with structured access to HackerNews content via the Algolia API.

Features

Search Posts - Search HackerNews for stories, comments, and discussions by keyword
Front Page - Get currently trending HackerNews posts
Latest Posts - Monitor newest content sorted by date
Item Details - Retrieve complete posts with nested comment trees
User Profiles - View author information, karma, and bios

Prerequisites

  • Node.js 18.0.0 or higher

  • npm 9.0.0 or higher

  • MCP Client - Claude Desktop, Continue.dev, or any MCP-compatible client

Installation

From npm (Coming Soon)

npm install -g hn-mcp-server

From Source

# Clone the repository git clone https://github.com/yourusername/hn-mcp-server.git cd hn-mcp-server # Install dependencies npm install # Build the project npm run build # Link globally (optional) npm link

Configuration

For Claude Desktop

Add to your Claude Desktop configuration file:

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

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

Or if installed globally:

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

Available Tools

1. search-posts

Search HackerNews by keyword with optional filters.

{ query: "AI", tags: ["story"], numericFilters: ["points>=100"], page: 0, hitsPerPage: 20 }

2. get-front-page

Get current HackerNews front page posts.

{ page: 0, hitsPerPage: 30 }

3. get-latest-posts

Get most recent posts sorted by date.

{ tags: ["story"], page: 0, hitsPerPage: 20 }

4. get-item

Retrieve complete item details with nested comments.

{ itemId: "38456789" }

5. get-user

Get user profile information.

{ username: "pg" }

Development

Install Dependencies

npm install

Build

npm run build # Build once npm run build:watch # Build and watch for changes npm run clean # Clean build output

Testing

npm test # Run tests npm run test:coverage # Run tests with coverage npm run test:ui # Run tests with UI

Linting & Formatting

npm run lint # Check code quality npm run lint:fix # Fix linting issues npm run format # Format code npm run format:check # Check formatting

Documentation

Examples

See the Quick Start Guide for comprehensive usage examples.

License

MIT License - See LICENSE for details

Resources

Deploy Server
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables AI assistants to access HackerNews content through structured search, front page retrieval, latest posts monitoring, detailed item fetching with comment trees, and user profile viewing via the Algolia API.

  1. Prerequisites
    1. Installation
      1. From npm (Coming Soon)
      2. From Source
    2. Configuration
      1. For Claude Desktop
    3. Available Tools
      1. 1. search-posts
      2. 2. get-front-page
      3. 3. get-latest-posts
      4. 4. get-item
      5. 5. get-user
    4. Development
      1. Install Dependencies
      2. Build
      3. Testing
      4. Linting & Formatting
    5. Documentation
      1. Examples
        1. License
          1. Resources

            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/wei/hn-mcp-server'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server