MCP server for searching Hacker News stories via Algolia
Project description
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_dateandend_dateacceptYYYY-MM-DDor ISO datetime strings.- Date-only
start_dateis interpreted as00:00:00Z. - Date-only
end_dateis interpreted as23:59:59Z. limitdefaults to 20 and is capped at 100.pageis 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hacker_news_mcp_py-0.2.0.tar.gz.
File metadata
- Download URL: hacker_news_mcp_py-0.2.0.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5821c0121d50a0acd57c01b399a540ca2f4c256664ac7cc268d93cee10b78c
|
|
| MD5 |
4ac7d5604e3bf90f9a7c7b1dbb49608f
|
|
| BLAKE2b-256 |
65216ae8d4846f011c719dda579e31f3a4200b6a161c2685355d117b0e7c4ec1
|
Provenance
The following attestation bundles were made for hacker_news_mcp_py-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on m-higuchi/hacker-news-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hacker_news_mcp_py-0.2.0.tar.gz -
Subject digest:
8f5821c0121d50a0acd57c01b399a540ca2f4c256664ac7cc268d93cee10b78c - Sigstore transparency entry: 1394825166
- Sigstore integration time:
-
Permalink:
m-higuchi/hacker-news-mcp@9670b7105d119db65b714edcd4392fda20425d55 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/m-higuchi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@9670b7105d119db65b714edcd4392fda20425d55 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hacker_news_mcp_py-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hacker_news_mcp_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e94485539c9f8e10fc14d11d74dd80fed748fc9b413d99c248f777d85edcbf64
|
|
| MD5 |
48cf29cf00c7ba3fd1798fa543cba45d
|
|
| BLAKE2b-256 |
b9166c51d19079f0d17bb70497460c3651f92c78100d894d161cf0f85ea33351
|
Provenance
The following attestation bundles were made for hacker_news_mcp_py-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on m-higuchi/hacker-news-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hacker_news_mcp_py-0.2.0-py3-none-any.whl -
Subject digest:
e94485539c9f8e10fc14d11d74dd80fed748fc9b413d99c248f777d85edcbf64 - Sigstore transparency entry: 1394825248
- Sigstore integration time:
-
Permalink:
m-higuchi/hacker-news-mcp@9670b7105d119db65b714edcd4392fda20425d55 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/m-higuchi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@9670b7105d119db65b714edcd4392fda20425d55 -
Trigger Event:
release
-
Statement type: