Get the FREE Ultimate OpenClaw Setup Guide →

Hackernews -Typescript

HackerNews MCP Server - A comprehensive Model Context Protocol (MCP) server that provides seamless integration with the HackerNews API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio traves-theberge-hackernews-mcp-typescript node dist/server.js \
  --env LOG_LEVEL="info" \
  --env SERVER_NAME="hackernews-mcp-server" \
  --env CACHE_MAX_SIZE="1000" \
  --env SERVER_VERSION="1.0.0" \
  --env CACHE_TTL_SECONDS="300" \
  --env HACKERNEWS_API_TIMEOUT="10000" \
  --env HACKERNEWS_API_BASE_URL="https://hacker-news.firebaseio.com/v0"

How to use

This MCP server exposes a set of tools to interact with Hacker News data through the Model Context Protocol. It provides five interactive commands: search_posts to filter and locate stories by keywords, author, score, and date range; get_post to retrieve full post details including metadata, comments, and engagement metrics; search_user to analyze user profiles and activity patterns; search_trending to identify current trending topics from top stories; and search_comments to analyze discussion engagement and identify top commenters. You can use these tools to perform research, build content analysis dashboards, or power assistants that need up-to-date Hacker News insights. To begin, ensure the server is running (npm start) and connect your MCP client (e.g., Cursor) to the configured MCP endpoint. The client will present these tools for you to invoke with natural language commands or structured queries, eliciting responses that include story data, user stats, or discussion analytics.

How to install

Prerequisites:

  • Node.js 18+
  • npm or yarn

Installation steps:

  1. Clone the repository and install dependencies:
git clone <repository-url>
cd hackernews-mcp-server
npm install
  1. Build the project:
npm run build
  1. Configure the MCP client (Cursor):
  • The .cursor/mcp.json file is already configured
  • Restart Cursor to load the MCP server
  1. Start the MCP server:
npm start
  1. Connect with your MCP client and begin issuing the supported MCP tool commands.

Additional notes

Tips and considerations:

  • Environment variables are optional but can customize behavior. See the Configuration section in the README for details.
  • The server performs caching to reduce API calls (default TTL 300 seconds, max size 1000 items).
  • If you modify code, re-run npm run build before npm start to ensure the latest changes are deployed.
  • Common issues: network timeouts talking to the Hacker News API; adjust HACKERNEWS_API_TIMEOUT if you're behind constrained networks. Ensure Node.js 18+ is used for compatibility with TypeScript build outputs.
  • The MCP tool names and capabilities are listed under MCP Tools & Capabilities in the README; use these exact tool names when issuing requests.

Related MCP Servers

Sponsor this space

Reach thousands of developers