Hacker News Reader MCP Server
Fetches Hacker News discussion threads and linked article content in LLM-optimized markdown format, enabling natural language analysis of HN posts and their conversations.
README
Hacker News Reader MCP Server
A Model Context Protocol (MCP) server that fetches Hacker News discussions and article content. Optimized for LLM consumption with compact, token-efficient formatting.
Features
✅ Fetch complete Hacker News discussion threads
✅ Scrape linked article content in markdown format
✅ LLM-optimized output (compact nested replies)
✅ Accepts both HN URLs and item IDs
✅ Handles edge cases (text posts, Ask HN, deleted comments)
✅ Powered by Firecrawl for robust article extraction
Installation
Using uvx from GitHub (Recommended)
uvx --from git+https://github.com/Malayke/hackernews-mcp.git hackernews-mcp
Using uv pip
uv pip install git+https://github.com/Malayke/hackernews-mcp.git
Using pip
pip install git+https://github.com/Malayke/hackernews-mcp.git
Usage
As an MCP Server
Add to your MCP settings configuration (e.g., in Claude Desktop or other MCP clients):
{
"mcpServers": {
"hackernews-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/Malayke/hackernews-mcp.git",
"hackernews-mcp"
],
"env": {
"FIRECRAWL_API_KEY": "your_api_key_here"
}
}
}
}
Or if you've installed it with pip/uv pip:
{
"mcpServers": {
"hackernews-mcp": {
"command": "hackernews-mcp",
"env": {
"FIRECRAWL_API_KEY": "your_api_key_here"
}
}
}
}
Environment Variables
Required:
FIRECRAWL_API_KEY- Your Firecrawl API key
Create a .env file:
FIRECRAWL_API_KEY=your_api_key_here
Available Tools
get_hn_content
Fetches Hacker News comments and the linked article content.
Input:
hn_url: HN URL or item ID- Full URL:
https://news.ycombinator.com/item?id=46130187 - Just ID:
46130187
- Full URL:
Output: Combined markdown with:
- Article Content - Scraped article in markdown format
- HN Discussion - Formatted comment threads with metadata
Example:
{
"hn_url": "https://news.ycombinator.com/item?id=46130187"
}
Output Format
The tool returns LLM-optimized content:
# ARTICLE CONTENT
[Article markdown content here...]
---
# HACKER NEWS DISCUSSION
STORY: Article Title
URL: https://example.com/article
AUTHOR: username | POINTS: 123 | TIME: 2 hours ago
TOTAL_COMMENTS: 45
COMMENT #1
COMMENT [author @ time] ID: 123456
Comment text here...
REPLY [author2 @ time] ID: 123457
Reply text here...
REPLY [author3 @ time] ID: 123458
Nested reply text...
COMMENT #2
...
Development
Local Setup
# Clone the repository
git clone https://github.com/Malayke/hackernews-mcp.git
cd hackernews-mcp
# Install dependencies with uv
uv sync
# Set up environment
echo "FIRECRAWL_API_KEY=your_api_key_here" > .env
# Run the server
uv run server.py
Testing
# Test the MCP server
uv run python test_mcp_server.py
Using in Development Mode
For local development with live changes:
{
"mcpServers": {
"hackernews-mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/hackernews-mcp",
"python",
"server.py"
],
"env": {
"FIRECRAWL_API_KEY": "your_api_key_here"
}
}
}
}
Requirements
- Python 3.11+
- Firecrawl API key (for article scraping)
Dependencies
mcp- Model Context Protocol SDKrequests- HTTP requestsbeautifulsoup4- HTML parsingfirecrawl-py- Article content extractionpython-dotenv- Environment variable management
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Links
Support
For issues, questions, or contributions, please visit the GitHub repository.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.