hn-mcp-server — Claude Code MCP server: use and install
Connects an AI agent to Hacker News feeds, discussions, profiles, and full-text search. Useful when research needs posts and comments in context.
claude mcp add --transport http hn-mcp-server https://hn.caseyjhand.com/mcpWhat hn-mcp-server does
hn-mcp-server gives an MCP client access to Hacker News content. It can pull ranked feeds such as top, new, best, ask, show, and jobs; read a comment thread; inspect a user profile; and search stories, comments, polls, or jobs. Search can combine keywords with type, author, parent story, date, or minimum-score filters.
The package exposes four tools: hn_get_stories, hn_get_thread, hn_get_user, and hn_search_content. It can run over STDIO or Streamable HTTP, and Claude Code can connect to the hosted endpoint at https://hn.caseyjhand.com/mcp. A local setup uses npx; its environment settings include values such as HN_CONCURRENCY_LIMIT and MCP_HTTP_PORT.
What it helps with
- search Hacker News by keyword and filters
- pull stories from a selected feed
- read a complete discussion thread
- inspect a user profile and submissions
- compare posts by author, date, or score
Example prompts for the agent
- Search Hacker News for MCP stories in the requested date range and apply a minimum score filter.
- Open Hacker News item
<itemId>, show its comment tree, and continue from the next page. - Look up the Hacker News profile for
<username>and fetch recent submissions.
How to install hn-mcp-server
1Platform CLI: remote server
claude mcp add --transport http hn-mcp-server https://hn.caseyjhand.com/mcp2Platform CLI
claude mcp add --env HN_CONCURRENCY_LIMIT=<HN_CONCURRENCY_LIMIT> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> --transport stdio hn-mcp-server -- npx -y @cyanheads/hn-mcp-serverReplace <…> with your own values. 2 more environment variables are in the server README
1Platform CLI: remote server
codex mcp add hn-mcp-server --url https://hn.caseyjhand.com/mcp2Platform CLI
codex mcp add hn-mcp-server --env HN_CONCURRENCY_LIMIT=<HN_CONCURRENCY_LIMIT> --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> -- npx -y @cyanheads/hn-mcp-serverReplace <…> with your own values. 2 more environment variables are in the server README
Config file
{
"mcpServers": {
"hn-mcp-server": {
"url": "https://hn.caseyjhand.com/mcp"
}
}
}{
"mcpServers": {
"hn-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/hn-mcp-server"
],
"env": {
"HN_CONCURRENCY_LIMIT": "<HN_CONCURRENCY_LIMIT>",
"MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_HOST": "<MCP_HTTP_HOST>",
"MCP_HTTP_PORT": "<MCP_HTTP_PORT>"
}
}
}
}Replace <…> with your own values. 2 more environment variables are in the server README
Config file
{
"servers": {
"hn-mcp-server": {
"type": "http",
"url": "https://hn.caseyjhand.com/mcp"
}
}
}{
"servers": {
"hn-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@cyanheads/hn-mcp-server"
],
"env": {
"HN_CONCURRENCY_LIMIT": "<HN_CONCURRENCY_LIMIT>",
"MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_HOST": "<MCP_HTTP_HOST>",
"MCP_HTTP_PORT": "<MCP_HTTP_PORT>"
}
}
}
}Replace <…> with your own values. 2 more environment variables are in the server README
1Platform CLI: remote server
gemini mcp add -t http hn-mcp-server https://hn.caseyjhand.com/mcp2Platform CLI
gemini mcp add -e HN_CONCURRENCY_LIMIT=<HN_CONCURRENCY_LIMIT> -e MCP_LOG_LEVEL=<MCP_LOG_LEVEL> -e MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> -e MCP_HTTP_HOST=<MCP_HTTP_HOST> -e MCP_HTTP_PORT=<MCP_HTTP_PORT> hn-mcp-server npx -y @cyanheads/hn-mcp-serverReplace <…> with your own values. 2 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about hn-mcp-server
How do I install hn-mcp-server in Claude Code?
Run claude mcp add --transport http hn-mcp-server https://hn.caseyjhand.com/mcp.
What does hn-mcp-server do?
It exposes Hacker News feeds, threads, profiles, and content search to an MCP client. The search covers stories, comments, polls, and jobs.
Which connection methods does hn-mcp-server support?
The server supports STDIO and Streamable HTTP. Claude Code can use the hosted endpoint https://hn.caseyjhand.com/mcp, while a local setup runs through npx.