HN-MCP
Click on "Deploy 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., "@HN-MCP show me the top trending stories on Hacker News"
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.
HN-MCP
Hacker News Browser for Claude Desktop and AI Assistants
A Model Context Protocol (MCP) server that enables Claude Desktop and other AI assistants to browse Hacker News, search discussions, and analyze tech trends. Clean, fast, and actually works - no API keys required.
Table of Contents
Related MCP server: HackerNews MCP Server
What makes HN-MCP different?
π Zero setup - Works instantly! Unlike Reddit, Twitter, or other platforms, Hacker News API requires no authentication, no API keys, no registration. Just install and go.
β‘ Smart caching - 50MB LRU cache with adaptive TTLs delivers 50ms cached responses (vs 200-500ms uncached). Popular content stays cached longer automatically.
π― Clean data - Direct from HN's Firebase API and Algolia Search. No fake metrics, no made-up sentiment scores, no hallucinated data.
π§ LLM-optimized - Response formats designed specifically for AI assistants. Structured JSON that Claude can parse perfectly every time.
π¦ TypeScript - 100% TypeScript with strict typing. Zod schemas validate every input and output. Reliable and maintainable.
β Multi-channel distribution - Available via npm, Docker Hub, MCP Registry, and .mcpb extension. Choose your preferred installation method.
π³ Docker ready - Multi-platform images (amd64, arm64) with health checks and optimized builds. Deploy anywhere in seconds.
Quick Start (30 seconds)
For Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"hn": {
"command": "npx",
"args": ["hn-mcp"]
}
}
}That's it! HN-MCP is now available in Claude.
What can it do?
Ask your AI assistant to:
π "What's trending on Hacker News?" - Browse top stories
π "Search for discussions about AI" - Search across all content
π¬ "Get comments on story 12345678" - Fetch full discussion threads
π€ "Analyze user pg" - Get user karma, submissions, and activity
π "Explain HN karma" - Understand Hacker News terminology
Perfect for:
π Startup founders - Monitor YC companies, track competitor launches, discover market trends
πΌ Tech recruiters - Find talented developers, understand the tech community pulse
π Market researchers - Analyze tech sentiment, identify emerging technologies, track discussion trends
βοΈ Content creators - Find trending topics, research technical subjects, engage with developer community
π Developers - Stay updated on latest tools, frameworks, and best practices discussed by peers
π° Tech journalists - Source breaking stories, find expert opinions, track industry discussions
π Researchers - Analyze tech community behavior, study information diffusion, collect discussion data
Available Tools
browse_stories
Browse posts from Hacker News by category.
- Types: top, new, best, ask (Ask HN), show (Show HN), job
- Limit: 1-100 stories (default: 30)
- Returns: Title, score, author, comments, URLsearch_hn
Search across all Hacker News content.
- Query: Your search terms
- Filter by: Type, date range, author
- Sort by: relevance or date
- Uses: Algolia's HN Search APIget_story_details
Get a story with all its comments.
- Input: Story ID
- Returns: Full story + nested comment threads
- Options: Max comments, thread depthuser_analysis
Analyze a Hacker News user's profile.
- Username: Any HN user
- Returns: Karma, account age, recent submissions
- Insights: Activity patterns, top postshn_explain
Get explanations of HN terms.
- Terms: karma, flagged, dupe, Show HN, Ask HN, etc.
- Returns: Definition + contextInstallation Options
Claude Desktop Extension (.mcpb)
Easiest method - One-click install for Claude Desktop:
Download
hn-mcp.mcpbfrom latest releaseOpen Claude Desktop
Click on the extension file to install
Restart Claude Desktop
That's it! HN-MCP will be available immediately.
Quick Start with npx
# Claude Desktop - add to config (see Quick Start above)
npx hn-mcp
# HTTP mode for testing
HN_MCP_HTTP=true npx hn-mcpGlobal Install
npm install -g hn-mcp
hn-mcp # Run in stdio mode
HN_MCP_HTTP=true hn-mcp # Run in HTTP modeUsing Docker
# Quick start - HTTP mode for API access
docker run -e HN_MCP_HTTP=true -p 3000:3000 karanb192/hn-mcp:latest
# stdio mode for development
docker run -it karanb192/hn-mcp:latest
# With docker-compose
docker-compose upFrom Source
git clone https://github.com/karanb192/hn-mcp.git
cd hn-mcp
npm install
npm run build
npm linkRate Limits
API | Official Limit | Our Limit | Notes |
HN Firebase | None β | 300/min | Self-imposed for courtesy |
Algolia Search | None β | 300/min | Max 1000 results per query |
Why HN-MCP?
What others do wrong:
β Scoped npm names -
@someone/hn-somethingis hard to rememberβ Not published to npm - Manual installation only
β No caching - Slow repeated requests
β Poor documentation - Unclear how to use
What we do right:
β Clean package name - Just
hn-mcpβ Smart caching - 50MB LRU cache with adaptive TTLs
β Clear documentation - You're reading it
β TypeScript - Type-safe and maintainable
Examples
Your AI can now answer:
"What are the top posts about GPT-4 today?"
β search_hn with query="GPT-4", dateRange="last24h", sortBy="relevance""Show me what's trending on Hacker News"
β browse_stories with type="top", limit=10"What are people saying about this article?"
β search_hn with the article URL to find discussions"Analyze the user dang"
β user_analysis with username="dang""Get the comments from HN story 12345678"
β get_story_details with id="12345678"Troubleshooting
Common Issues
"Command not found" error
# Ensure npm is installed
node --version
npm --version
# Try with full npx path
$(npm bin -g)/hn-mcpConnection issues
Hacker News may be down (check https://status.ycombinator.com)
Firewall blocking requests
Try restarting the MCP server
Search returns max 1000 results
This is Algolia's hard limit
Use date filters to narrow results
Try more specific search queries
Environment Variables
Configure HN-MCP using environment variables. See .env.example for detailed documentation.
Variable | Description | Default |
| Run as HTTP server instead of stdio |
|
| HTTP server port |
|
| Disable caching for real-time data |
|
| Override rate limit (requests/minute) |
|
Quick setup:
# Copy example file
cp .env.example .env
# Edit with your preferences
nano .envDevelopment
# Install dependencies
npm install
# Run in development
npm run dev
# Build
npm run build
# Run tests
npm run typecheck
# Deploy locally
./deploy-server.sh # Port 3000
./deploy-server.sh -p 8080 # Custom port
# Docker build
docker build -t karanb192/hn-mcp .
docker run -e HN_MCP_HTTP=true -p 3000:3000 karanb192/hn-mcp
# Docker development with hot reload
docker-compose --profile dev upRequirements
Node.js >= 18.0.0
npm or yarn
TypeScript 5.5+
Contributing
PRs welcome! See CONTRIBUTING.md for guidelines.
We keep things simple:
Clean TypeScript code
Smart caching
Clear documentation
Fast responses
Support
π Report bugs
π‘ Request features
β Star on GitHub
License
MIT - Use it however you want!
Made with β€οΈ for the MCP community by the creator of reddit-mcp-buddy. No venture capital, no tracking, just a good MCP server.
Available Tools
5 toolsbrowse_storiesB
Browse Hacker News stories by type. Returns story list with scores, comments, and metadata.
Inputs: type, limit.
get_story_detailsB
Get a Hacker News story with its comments. Fetches full story content and comment threads.
Inputs: id (required), maxComments, commentDepth.
hn_explainB
Get explanations of Hacker News terms, culture, and conventions.
Inputs: term (required).
search_hnA
Search Hacker News stories and comments. Returns matching content with relevance scores.
Inputs: query (required), tags, dateRange, sortBy, +1 more.
user_analysisB
Analyze a Hacker News user's profile, karma, and recent submissions.
Inputs: username (required), submissionLimit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: browse_stories for listing stories, get_story_details for fetching story content and comments, hn_explain for term explanations, search_hn for searching content, and user_analysis for user profiles. There is no overlap in functionality, making tool selection unambiguous.
The naming follows a consistent verb_noun pattern with snake_case throughout, such as browse_stories and get_story_details. The only minor deviation is hn_explain, which uses a prefix 'hn_' instead of a verb, but it still fits the overall readable convention.
With 5 tools, the server is well-scoped for interacting with Hacker News. Each tool serves a specific, non-trivial function, such as browsing, fetching details, explaining terms, searching, and analyzing users, making the count appropriate and efficient.
The tool set covers core Hacker News interactions well, including story listing, detail retrieval, searching, and user analysis. A minor gap is the lack of tools for posting or interacting with content, but for a read-focused server, the coverage is comprehensive and allows agents to handle most common tasks.
Related MCP Connectors
Browse Hacker News feeds, threads, and user profiles with full-text search.
Hacker News stories, search and Who is Hiring jobs via the official API. Runs on Apify.
Browse Hacker News from chat: top stories, search, read comment threads, and post or upvote when yoβ¦
Queries live HackerNews discussions, front-page velocity, and developer sentiment on any framewor.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to search, retrieve, and interact with HackerNews content including stories, comments, polls, and user information. Provides comprehensive access to all HackerNews API endpoints with 15 specialized tools for content discovery and analysis.1560 npm5MIT
- AlicenseAqualityDmaintenanceProvides programmatic access to Hacker News content via the HN Algolia API. It enables AI assistants to search stories, retrieve comments, access user profiles, and explore the front page in real-time.960 npmMIT
- FlicenseAqualityDmaintenanceEnables AI assistants to read and search Hacker News for top stories, comments, user profiles, and job listings using the Firebase and Algolia APIs. It facilitates natural language research into community discussions and technological trends across the HN platform.8-
- AlicenseAqualityCmaintenanceProvides AI agents with access to Hacker News data including top stories, story details, comment threads, and full-text search for content research and trend monitoring.5MIT