@cyanheads/hn-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@cyanheads/hn-mcp-serverShow me the top 10 Hacker News stories"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://hn.caseyjhand.com/mcp
Tools
Four read-only tools for accessing Hacker News data:
Tool Name | Description |
| Fetch stories from an HN feed (top, new, best, ask, show, jobs) with pagination. |
| Get an item and its comment tree as a threaded discussion with depth/count controls. |
| Fetch a user profile with karma, about, and optionally their recent submissions. |
| Search stories and comments via Algolia with type, author, date, and score filters. |
hn_get_stories
Fetch stories from any HN feed with pagination support.
Six feed types:
top,new,best,ask,show,jobsConfigurable count (1–100, default 30) and offset for pagination
Returns enriched story objects with title, URL, score, author, comment count, and body text
hn_get_thread
Retrieve an item and its full comment tree via ranked breadth-first traversal.
Depth control (0–10, default 3) — depth 0 doubles as a single-item lookup
Comment limit (1–200, default 50) caps total comments across all levels
Breadth-first traversal preserves HN's ranking order
Flat comment list with
depth/parentIdfor tree reconstruction
hn_get_user
Fetch a user profile with optional recent submission resolution.
Profile includes karma, creation date, and about text (HTML stripped)
Optionally resolves up to 50 most recent submissions into full items
Submission resolution filters out dead/deleted items
hn_search_content
Full-text search via the Algolia HN Search API.
Filter by content type:
story,comment,ask_hn,show_hn,front_pageFilter by author, date range (ISO 8601), and minimum points
Sort by relevance or date
Pagination with page/count controls
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool definitions — single file per tool, framework handles registration and validation
Unified error handling across all tools
Structured logging with request correlation
Runs locally (stdio/HTTP) from the same codebase
HN-specific:
Server-level
instructionsorientation forwarded to LLM clients oninitialize— item types, ID reuse across tools, case-sensitive usernames, and field sparsity expectationsConcurrent batch fetching with configurable parallelism for item resolution
HTML entity decoding and tag stripping with code block and link preservation
No API keys required — HN APIs are public
Getting Started
Public Hosted Instance
A public instance is available at https://hn.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"hn": {
"type": "streamable-http",
"url": "https://hn.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
Add to your MCP client configuration file:
{
"mcpServers": {
"hn-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/hn-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"hn-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/hn-mcp-server"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"hn-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/hn-mcp-server:latest"
]
}
}
}Prerequisites
Bun v1.3.0 or higher (or Node.js >= 24)
Installation
git clone https://github.com/cyanheads/hn-mcp-server.git
cd hn-mcp-server
bun installConfiguration
All configuration is via environment variables. No API keys required — HN APIs are public.
Variable | Description | Default |
| Max concurrent HTTP requests for batch item fetches (1–50). |
|
| Transport: |
|
| HTTP server port. |
|
| HTTP server host. |
|
| Log level: |
|
| Directory for log files (Node.js only). |
|
Running the Server
Local Development
MCP_TRANSPORT_TYPE=stdio bun --watch src/index.ts # Dev mode (stdio, auto-reload)
MCP_TRANSPORT_TYPE=http bun --watch src/index.ts # Dev mode (HTTP, auto-reload)
bun run test # Run test suite
bun run devcheck # Lint + format + typecheck + auditProduction
bun run build
bun run start:stdio # or start:httpDocker
docker build -t hn-mcp-server .
docker run -p 3010:3010 hn-mcp-serverProject Structure
Directory | Purpose |
|
|
| Server-specific env var parsing with Zod. |
| HN Firebase + Algolia API client and domain types. |
| Tool definitions ( |
Development Guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped loggingAll tools are read-only — no auth scopes required
Contributing
Issues and pull requests are welcome. Run checks before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be installed
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/hn-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server