Hacker News Reader MCP Server

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.

Category
访问服务器

README

Hacker News Reader MCP Server

Python 3.11+ License: MIT

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:

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

Output: Combined markdown with:

  1. Article Content - Scraped article in markdown format
  2. 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 SDK
  • requests - HTTP requests
  • beautifulsoup4 - HTML parsing
  • firecrawl-py - Article content extraction
  • python-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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选