Hacker News MCP server

Integrates with Hacker News to fetch stories, comments, and user data, enabling tech news aggregation, trend analysis, and community engagement tracking.
Back to servers
Provider
Ricky
Release date
Dec 29, 2024
Language
Python
Package
Stats
5.8K downloads
41 stars

The Hacker News MCP server allows you to fetch stories, comments, search results, and user information from Hacker News through the Model Context Protocol. This integration enables AI assistants to retrieve real-time data from Hacker News when responding to your queries.

Installation

Setting Up the Server

To install and use the Hacker News MCP server with Claude Desktop:

  1. First, ensure the uvx and mcp-hn packages are installed on your system
  2. Update the Claude Desktop configuration file to include the MCP server:

On MacOS:

# Edit the configuration file
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows:

# Edit the configuration file
notepad %APPDATA%/Claude/claude_desktop_config.json
  1. Add the following configuration to the file:
{
  "mcpServers": {
    "mcp-hn": {
      "command": "uvx",
      "args": ["mcp-hn"]
    }
  }
}
  1. Save the file and restart Claude Desktop for the changes to take effect

Available Tools

The Hacker News MCP server provides the following tools:

  • get_stories - Fetch top, new, ask_hn, or show_hn stories
  • get_story_info - Retrieve comments associated with a story
  • search_stories - Search for stories by query
  • get_user_info - Fetch information about a user

Usage Examples

Basic Examples

You can interact with the Hacker News MCP server using natural language queries:

  • To get today's top stories:

    What are the top stories on Hacker News today?
    
  • To fetch story details and comments:

    Show me the details and comments for the story about AI that's trending today
    
  • To search for stories by topic:

    What does Hacker News say about careers in AI?
    
  • To get information about a user:

    What has the user 'pg' been up to lately?
    

Advanced Usage

You can combine the Hacker News MCP server with other MCP servers like puppeteer:

Can you use the puppeteer tool to read the top AI article on Hacker News today, and then use the Hacker News tool to get the comments and summarize the main points of discussion?

This command will:

  1. Use get_stories to find the top AI article
  2. Use puppeteer to read the full article
  3. Use get_story_info to retrieve the comments
  4. Provide a summary of the main discussion points

For effective use, try to clearly specify which HN section (top, new, ask_hn, show_hn) you want to access and provide specific search terms when using the search functionality.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later