Skip to main content

Hacker News MCP

MCP server for searching Hacker News stories through the Algolia Hacker News Search API.

The server is read-only and is designed to run through uvx.

The PyPI distribution name is mcp-hacker-news (the name hacker-news-mcp is rejected as too similar to existing projects).

Install and Run

Install from PyPI with pip:

pip install mcp-hacker-news
hacker-news-mcp

(mcp-hacker-news is also installed as a command.)

Or run with uv:

uvx mcp-hacker-news

During local development:

uv run hacker-news-mcp

MCP Configuration

{
  "mcpServers": {
    "hacker-news": {
      "command": "uvx",
      "args": ["mcp-hacker-news"]
    }
  }
}

Running from a Local Source Copy

If you want to run a local copy of this repository instead of resolving the package through uvx, clone the source code and install dependencies:

git clone https://github.com/m-higuchi/hacker-news-mcp
cd hacker-news-mcp
uv sync

Then use the following MCP configuration:

{
  "mcpServers": {
    "hacker-news": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/hacker-news-mcp",
        "run",
        "hacker-news-mcp"
      ]
    }
  }
}

Replace /path/to/hacker-news-mcp with the absolute path to the directory where you cloned this repository (the folder that contains pyproject.toml).

Backend API

This server uses Algolia's Hacker News Search API as the primary backend:

https://hn.algolia.com/api/v1

Story searches always include tags=story. Date range searches call /search_by_date and convert ISO dates into Algolia created_at_i numeric filters.

Tools

search_stories_by_date

Search stories within a date range.

Input:

{
  "query": "AI",
  "start_date": "2026-04-01",
  "end_date": "2026-04-27",
  "limit": 20,
  "page": 0
}

Behavior:

  • start_date and end_date accept YYYY-MM-DD or ISO datetime strings.
  • Date-only start_date is interpreted as 00:00:00Z.
  • Date-only end_date is interpreted as 23:59:59Z.
  • limit defaults to 20 and is capped at 100.
  • page is zero-based.

search_stories

Search stories by relevance or date.

Input:

{
  "query": "AI",
  "sort": "relevance",
  "limit": 20,
  "page": 0
}

sort can be relevance or date.

get_story

Fetch a story by Hacker News item ID.

Input:

{
  "story_id": 123456
}

get_user

Fetch a Hacker News user profile by username.

Input:

{
  "username": "pg"
}

Example Prompts

Once the MCP server is connected, you can ask the AI questions like the following.

Searching by keyword:

  • "Search Hacker News for recent stories about Rust."
  • "Find the most relevant Hacker News stories about LLM fine-tuning."
  • "Show me the latest 5 Hacker News stories mentioning WebAssembly."

Searching by date range:

  • "What were the top Hacker News stories about OpenAI in April 2026?"
  • "Find Hacker News stories about Kubernetes from March 1 to March 31, 2026."

Fetching a specific story:

  • "Get the Hacker News story with ID 12345678."

Looking up a user:

  • "Show me the Hacker News profile of pg."
  • "What is the account info for the user tptacek on Hacker News?"

Development

Dev Container

Open this repository in a Dev Container to get Python 3.12 and uv preinstalled.

The container runs this setup command after creation:

uv sync --extra dev

Tests can be run with:

uv run pytest

Local

uv sync --extra dev
uv run pytest

Metadata

Release files for hacker-news-mcp-py 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hacker-news-mcp-py 0.2.0
File Size Uploaded Provenance Actions
hacker_news_mcp_py-0.2.0.tar.gz 48.4 kB With provenance Details for hacker_news_mcp_py-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hacker-news-mcp-py 0.2.0
File Interpreter ABI Platform Actions
hacker_news_mcp_py-0.2.0-py3-none-any.whl Python 3 none any Details for hacker_news_mcp_py-0.2.0-py3-none-any.whl

Total release size: 57.4 kB

Release files / hacker_news_mcp_py-0.2.0.tar.gz

Download URL hacker_news_mcp_py-0.2.0.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8f5821c0121d50a0acd57c01b399a540ca2f4c256664ac7cc268d93cee10b78c
BLAKE2b-256 checksum
How to use checksums
65216ae8d4846f011c719dda579e31f3a4200b6a161c2685355d117b0e7c4ec1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release files / hacker_news_mcp_py-0.2.0-py3-none-any.whl

Download URL hacker_news_mcp_py-0.2.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e94485539c9f8e10fc14d11d74dd80fed748fc9b413d99c248f777d85edcbf64
BLAKE2b-256 checksum
How to use checksums
b9166c51d19079f0d17bb70497460c3651f92c78100d894d161cf0f85ea33351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Security for hacker-news-mcp-py 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hacker_news_mcp_py-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page