Skip to main content
Glama

HackerNews MCP Server

HackerNews MCP Server

A comprehensive Model Context Protocol (MCP) server that provides seamless integration with the HackerNews API, enabling AI assistants to access, analyze, and understand HackerNews content through standardized MCP interfaces.

๐Ÿš€ Quick Start

# Install dependencies npm install # Build the project npm run build # Start the server npm start

Then restart your MCP-compatible client (like Cursor) to connect to the server.

โœจ Features

๐Ÿ”ง Tools (5 Interactive Commands)

  1. search_posts - Search and filter HackerNews posts

    • Filter by keywords, author, score, and date range

    • Example: "Find stories about 'AI' with score > 100"

  2. get_post - Get comprehensive post details

    • Includes metadata, comment trees, and engagement metrics

    • Example: "Get full details of story 44473319 with comments"

  3. search_user - Analyze user profiles and activity

    • User statistics, top stories, and contribution patterns

    • Example: "Analyze user 'pg' and show their activity"

  4. search_trending - Find current trending topics

    • Keyword frequency analysis from top stories

    • Example: "What topics are trending on HackerNews today?"

  5. search_comments - Analyze comment engagement

    • Comment statistics, top commenters, and discussion patterns

      • Example: "Analyze the comments on story 44473319"

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Node.js 18+

  • npm or yarn

Installation Steps

  1. Clone and install:

    git clone <repository-url> cd hackernews-mcp-server npm install
  2. Build the project:

    npm run build
  3. Configure MCP client (Cursor):

    • The .cursor/mcp.json file is already configured

    • Restart Cursor to load the MCP server

  4. Start using:

    npm start

๐ŸŽฎ Real Usage Examples (Tested & Working)

๐Ÿ” Search Posts - Find Stories by Topic

# What we tested: search_posts with query="AI", minScore=50, limit=10 # Results we got: - "'Positive review only': Researchers hide AI prompts in papers" (100 points, 52 comments) - "Cops in [Spain] think everyone using a Google Pixel must be a drug dealer" (65 points, 50 comments)

Use cases:

  • Find high-engagement stories on specific topics

  • Filter by author, score thresholds, or date ranges

  • Research trending discussions in your field

๐Ÿ“„ Get Post Details - Deep Story Analysis

# What we tested: get_post for story ID 44473319 (AI prompts story) # What we learned: - Full story metadata (age: 3.2 hours, domain: asia.nikkei.com) - Complete comment tree (57 comments from 38 authors) - Engagement metrics and discussion quality

Use cases:

  • Analyze specific stories that interest you

  • Get complete comment discussions

  • Understand community reaction to news

๐Ÿ‘ค Search Users - Profile Analysis

# What we tested: search_user for "zczc" (Google Pixel story author) # What we discovered: - 8.6 years on HN, 876 karma, steady contributor - Research-oriented: provides primary sources - Cross-domain expertise: tech, policy, programming - Quality over quantity approach

Use cases:

  • Research authors of interesting posts

  • Find domain experts and thought leaders

  • Understand user contribution patterns

๐Ÿ“ˆ Search Trending - Topic Analysis

# What we tested: search_trending analyzing 49 current top stories # Current trends we found: - "software", "game", "first" (6.1% each) - "systems", "local", "google" (4.1% each) - Space tech: "satellite", "geostationary" - Focus on local-first software and gaming

Use cases:

  • Track what the tech community is discussing

  • Identify emerging technology trends

  • Monitor shifts in community interests

๐Ÿ’ฌ Search Comments - Discussion Analysis

# What we tested: search_comments on the Google Pixel Spain story # What we found: - 56 comments from 38 unique authors - Active discussion (multiple users with 4+ comments) - International perspectives on privacy/surveillance - Quality moderation (5 deleted, 1 flagged)

Use cases:

  • Analyze community sentiment on topics

  • Find the most engaged discussants

  • Understand discussion quality and patterns

๐Ÿ—๏ธ Architecture

Smart Caching System

  • Three-tier caching: Items, users, and story lists

  • Configurable TTL: Default 5 minutes, adjustable

  • LRU eviction: Automatic cleanup when cache is full

  • Performance: Reduces API calls by ~80%

API Client Features

  • Comprehensive coverage: All HackerNews API endpoints

  • Batch operations: Efficient multiple item loading

  • Error handling: Robust retry and timeout logic

  • Rate limiting: Respectful API usage

Enhanced Data

  • Story metadata: Age, domain, comment count calculations

  • User statistics: Average scores, top stories, activity patterns

  • Comment analysis: Engagement metrics, discussion trees

  • Trending analysis: Keyword frequency, topic extraction

๐Ÿ”ง Configuration

Environment variables (optional):

# Server Configuration SERVER_NAME=hackernews-mcp-server SERVER_VERSION=1.0.0 # API Configuration HACKERNEWS_API_BASE_URL=https://hacker-news.firebaseio.com/v0 HACKERNEWS_API_TIMEOUT=10000 # Cache Configuration CACHE_TTL_SECONDS=300 CACHE_MAX_SIZE=1000 # Logging LOG_LEVEL=info

๐Ÿงช Development

# Development mode with hot reload npm run dev # Run tests npm test # Lint code npm run lint npm run lint:fix # Type checking npm run build

๐Ÿ“Š MCP Tools & Capabilities

What you can actually do with our tested tools:

MCP Tool

What It Does

Real Example From Our Testing

search_posts

Find stories by criteria

Found 2 AI stories with 100+ and 65 points

get_post

Get full story details

Analyzed AI prompts story with 57 comments

search_user

Profile analysis

Profiled "zczc" - 8.6yr veteran, quality contributor

search_trending

Topic analysis

Found "software", "game", "systems" trending

search_comments

Discussion analysis

Analyzed 56 comments, 38 authors on Pixel story

Resource Access Patterns:

  • hackernews://stories/top โ†’ Current top stories

  • hackernews://user/username โ†’ User profiles

  • hackernews://item/12345 โ†’ Individual posts

  • hackernews://comments/12345 โ†’ Comment trees

๐Ÿค Real-World Use Cases (Based on Our Testing)

๐Ÿ“ฐ Content Research & Analysis

  • Find breaking tech stories: Like our AI prompts in papers discovery (100 points, active discussion)

  • Track controversial topics: Privacy issues like the Google Pixel profiling story

  • Analyze discussion quality: 57 comments from 38 authors shows real engagement

  • Monitor emerging trends: Space tech, local-first software, gaming developments

๐Ÿ‘ฅ Community Intelligence

  • Identify quality contributors: Found "zczc" as research-oriented, cross-domain expert

  • Understand user patterns: 8.6 years, steady karma growth, source verification habits

  • Find domain experts: Users with consistent high-quality contributions

  • Track thought leaders: Active users in specific technology areas

๐Ÿ“ˆ Trend & Sentiment Analysis

  • Current tech focus: "software", "systems", "game" trending at 6.1% each

  • Emerging technologies: Satellite/space tech discussions increasing

  • Community sentiment: International privacy concerns, academic integrity debates

  • Discussion patterns: Quality moderation, international perspectives

๐Ÿ” Research Applications

  • Academic research: Study tech community discussions and sentiment

  • Market research: Understand developer and tech community interests

  • Competitive intelligence: Monitor discussions about technologies and companies

  • Content strategy: Find topics that generate high engagement

๐Ÿš€ Performance

  • Caching: 80% reduction in API calls

  • Batch operations: 3x faster multi-item loading

  • Smart filtering: Client-side search reduces server load

  • Concurrent requests: Parallel processing for efficiency

๐Ÿ”’ Privacy & Ethics

  • Public data only: No private information access

  • Respectful usage: Rate limiting and caching

  • No data storage: Temporary caching only

  • Transparent: Open source implementation

๐Ÿ› Troubleshooting

Common Issues

  1. Server won't start

    # Check Node.js version node --version # Should be 18+ # Rebuild the project npm run build
  2. MCP connection issues

    • Restart your MCP client (Cursor)

    • Check .cursor/mcp.json configuration

    • Verify server is running with npm start

  3. API errors

    • Check network connectivity

    • Verify HackerNews API is accessible

    • Check cache configuration

Debug Mode

# Enable debug logging LOG_LEVEL=debug npm start # Check cache statistics # Use the hackernews://cache/stats resource

๐Ÿ“ˆ Roadmap

  • Real-time WebSocket updates

  • Advanced sentiment analysis

  • User network analysis

  • Export functionality

  • Custom filtering rules

  • Performance dashboard

๐Ÿค Contributing

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit changes (git commit -m 'Add amazing feature')

  4. Push to branch (git push origin feature/amazing-feature)

  5. Open a Pull Request


๐ŸŽ‰ Ready to Explore HackerNews Like Never Before?

๐Ÿš€ Quick Start Command

npm run build && npm start

๐Ÿ’ฌ Start Your First Conversation

Ask your AI assistant:

  • "What are the top AI stories on HackerNews right now?"

  • "Find trending topics in the tech community today"

  • "Analyze the most discussed story this week"


๐Ÿ™ Acknowledgments & Credits

๐Ÿงก Special Thanks to HackerNews

"The best technology discussions happen here"

We're incredibly grateful to HackerNews and Y Combinator for:

๐ŸŒŸ Creating the world's best tech community
๐Ÿ“ก Providing free, real-time API access
๐Ÿ”ฅ Fostering incredible discussions that inspire innovation
๐Ÿš€ Building a platform where the future of tech is discussed daily

โšก Powered By

  • ๐Ÿ”— HackerNews API - The data that drives everything

  • ๐Ÿ› ๏ธ Model Context Protocol - The standard that makes it possible

  • ๐Ÿ’ Open Source Community - The spirit that keeps us building


๐Ÿ“œ License & Usage

๐Ÿ†“ This MCP Server

MIT License - Use it, modify it, share it! See LICENSE file.
Created by: Traves Theberge Traves.Theberge@gmail.com

๐Ÿ“Š HackerNews API

Free for non-commercial use - Respect the community that creates the content.
Commercial usage: Check Y Combinator's terms


๐ŸŒŸ Join the Community

Found a bug? Open an issue!
Have an idea? Start a discussion!
Want to contribute? PRs welcome!

๐Ÿ”— Connect


๐Ÿงก Keep Hacking, Keep Exploring! ๐Ÿงก

Built with โค๏ธ for the HackerNews community

โญ Star this repo

Deploy Server
A
security โ€“ no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

A server that enables AI assistants to access, analyze, and understand HackerNews content through standardized Model Context Protocol interfaces, providing tools for searching posts, analyzing users, and tracking trending topics.

  1. ๐Ÿš€ Quick Start
    1. โœจ Features
      1. ๐Ÿ”ง Tools (5 Interactive Commands)
    2. ๐Ÿ› ๏ธ Installation & Setup
      1. Prerequisites
      2. Installation Steps
    3. ๐ŸŽฎ Real Usage Examples (Tested & Working)
      1. ๐Ÿ” Search Posts - Find Stories by Topic
      2. ๐Ÿ“„ Get Post Details - Deep Story Analysis
      3. ๐Ÿ‘ค Search Users - Profile Analysis
      4. ๐Ÿ“ˆ Search Trending - Topic Analysis
      5. ๐Ÿ’ฌ Search Comments - Discussion Analysis
    4. ๐Ÿ—๏ธ Architecture
      1. Smart Caching System
      2. API Client Features
      3. Enhanced Data
    5. ๐Ÿ”ง Configuration
      1. ๐Ÿงช Development
        1. ๐Ÿ“Š MCP Tools & Capabilities
          1. ๐Ÿค Real-World Use Cases (Based on Our Testing)
            1. ๐Ÿ“ฐ Content Research & Analysis
            2. ๐Ÿ‘ฅ Community Intelligence
            3. ๐Ÿ“ˆ Trend & Sentiment Analysis
            4. ๐Ÿ” Research Applications
          2. ๐Ÿš€ Performance
            1. ๐Ÿ”’ Privacy & Ethics
              1. ๐Ÿ› Troubleshooting
                1. Common Issues
                2. Debug Mode
              2. ๐Ÿ“ˆ Roadmap
                1. ๐Ÿค Contributing
                  1. ๐ŸŽ‰ Ready to Explore HackerNews Like Never Before?
                    1. ๐Ÿš€ Quick Start Command
                    2. ๐Ÿ’ฌ Start Your First Conversation
                  2. ๐Ÿ™ Acknowledgments & Credits
                    1. ๐Ÿงก Special Thanks to HackerNews
                    2. โšก Powered By
                  3. ๐Ÿ“œ License & Usage
                    1. ๐Ÿ†“ This MCP Server
                    2. ๐Ÿ“Š HackerNews API
                  4. ๐ŸŒŸ Join the Community
                    1. ๐Ÿ”— Connect
                    2. ๐Ÿงก Keep Hacking, Keep Exploring! ๐Ÿงก

                  Related MCP Servers

                  • -
                    security
                    F
                    license
                    -
                    quality
                    High-performance server enabling AI assistants to access web scraping, crawling, and deep research capabilities through Model Context Protocol.
                    Last updated -
                    18
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A Model Context Protocol server that enables AI tools like Claude and Cursor to fetch and interact with live Hacker News data (posts, comments, users) via standardized MCP endpoints.
                    Last updated -
                    11
                    17
                    28
                  • A
                    security
                    A
                    license
                    A
                    quality
                    An MCP server that enables AI assistants to access real-time Hacker News data including top stories, story details, comments, and search functionality.
                    Last updated -
                    1
                    17
                    1
                    MIT License
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that enables AI assistants to programmatically interact with the Hashnode API for creating, updating, searching, and retrieving blog content.
                    Last updated -
                    4
                    MIT License
                    • Apple

                  View all related MCP servers

                  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/Traves-Theberge/Hackernews-MCP-Typescript'

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