hn mcp

Local 2025-08-31 23:30:55 0

Adds powerful Hacker News integration to LLM clients, allowing users to access stories, comments, user profiles, and search functionality through the Model Context Protocol.


smithery badge Official Hacker News MCP Server - Adds powerful Hacker News integration to Cursor, Claude, and any other LLM clients. Access stories, comments, user profiles, and search functionality through the Model Context Protocol.

Hacker News Server MCP server

Features

  • Search stories and comments using Algolia's HN Search API
  • Get stories by type (top, new, best, ask, show, job)
  • Get individual stories with comments
  • Get comment trees and user discussions
  • Get user profiles and submissions
  • Real-time access to Hacker News data

Set Up

Running on Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "hackernews": {
      "command": "npx",
      "args": ["-y", "@devabdultech/hn-mcp-server"]
    }
  }
}

Installing via Smithery

To install Hacker News MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @devabdultech/hn-mcp --client claude

Tools

  1. search
  2. Search for stories and comments on Hacker News using Algolia's search API
  3. Inputs: * query (string): Search query * type (optional string): Filter by type ('story' or 'comment') * page (optional number): Page number for pagination * hitsPerPage (optional number): Results per page (max 100)
  4. Returns: Search results with stories and comments

  5. getStories

  6. Get multiple stories by type (top, new, best, ask, show, job)
  7. Inputs: * type (string): Type of stories to fetch ('top', 'new', 'best', 'ask', 'show', 'job') * limit (optional number): Number of stories to fetch (max 100)
  8. Returns: Array of story objects

  9. getStoryWithComments

  10. Get a story along with its comment thread
  11. Inputs: * id (number): Story ID
  12. Returns: Story details with nested comments

  13. getCommentTree

  14. Get the full comment tree for a story
  15. Inputs: * storyId (number): ID of the story
  16. Returns: Hierarchical comment tree structure

  17. getUser

  18. Get a User is profile information
  19. Inputs: * id (string): Username
  20. Returns: User profile details including karma, created date, and about text

  21. getUserSubmissions

  22. Get a User is submissions (stories and comments)
  23. Inputs: * id (string): Username
  24. Returns: Array of User is submitted stories and comments

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This MCP server is licensed under the MIT License. See the LICENSE file for details.

About

This MCP server is built and maintained by devabdultech. It uses the official Hacker News API and Algolia Search API to provide comprehensive access to Hacker News data through the Model Context Protocol.

[
  {
    "description": "Search for stories and comments on Hacker News",
    "inputSchema": {
      "properties": {
        "hitsPerPage": {
          "default": 20,
          "description": "The number of results per page",
          "type": "number"
        },
        "page": {
          "default": 0,
          "description": "The page number",
          "type": "number"
        },
        "query": {
          "description": "The search query",
          "type": "string"
        },
        "type": {
          "default": "all",
          "description": "The type of content to search for",
          "enum": [
            "all",
            "story",
            "comment"
          ],
          "type": "string"
        }
      },
      "required": [
        "query"
      ],
      "type": "object"
    },
    "name": "search"
  },
  {
    "description": "Get a single story by ID",
    "inputSchema": {
      "properties": {
        "id": {
          "description": "The ID of the story",
          "type": "number"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "name": "getStory"
  },
  {
    "description": "Get a story with its comments",
    "inputSchema": {
      "properties": {
        "id": {
          "description": "The ID of the story",
          "type": "number"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "name": "getStoryWithComments"
  },
  {
    "description": "Get multiple stories by type (top, new, best, ask, show, job)",
    "inputSchema": {
      "properties": {
        "limit": {
          "default": 30,
          "description": "The maximum number of stories to fetch",
          "type": "number"
        },
        "type": {
          "description": "The type of stories to fetch",
          "enum": [
            "top",
            "new",
            "best",
            "ask",
            "show",
            "job"
          ],
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "name": "getStories"
  },
  {
    "description": "Get a single comment by ID",
    "inputSchema": {
      "properties": {
        "id": {
          "description": "The ID of the comment",
          "type": "number"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "name": "getComment"
  },
  {
    "description": "Get comments for a story",
    "inputSchema": {
      "properties": {
        "limit": {
          "default": 30,
          "description": "The maximum number of comments to fetch",
          "type": "number"
        },
        "storyId": {
          "description": "The ID of the story",
          "type": "number"
        }
      },
      "required": [
        "storyId"
      ],
      "type": "object"
    },
    "name": "getComments"
  },
  {
    "description": "Get a comment tree for a story",
    "inputSchema": {
      "properties": {
        "storyId": {
          "description": "The ID of the story",
          "type": "number"
        }
      },
      "required": [
        "storyId"
      ],
      "type": "object"
    },
    "name": "getCommentTree"
  },
  {
    "description": "Get a user profile by ID",
    "inputSchema": {
      "properties": {
        "id": {
          "description": "The ID of the user",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "name": "getUser"
  },
  {
    "description": "Get a User is submissions",
    "inputSchema": {
      "properties": {
        "id": {
          "description": "The ID of the user",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "name": "getUserSubmissions"
  }
]