MCP Claude Hacker News
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An integration that allows Claude Desktop to interact with Hacker News using the Model Context Protocol (MCP).
Features
- Browse latest stories from Hacker News
- View top and best-rated stories
- Search stories by keyword, by relevance or most recent (Algolia HN Search API)
- Get story details
- Read comments for stories, capped so a busy thread cannot flood the context
- Clean formatting of Hacker News content for better readability, including HTML entity decoding
Demo
Requirements
- Node.js 20 or higher
- Claude Desktop
- Internet connection to access Hacker News API
Installation
Installing via Smithery
Install the packaged bundle from the Smithery server page, or from the CLI:
Installing Manually
1. Clone or download this repository:
2. Install dependencies:
3. Build the project:
Running the MCP Server
There are two ways to run the MCP server:
Option 1: Running manually
1. Open a terminal or command prompt
2. Navigate to the project directory
3. Run the server directly:
Keep this terminal window open while using Claude Desktop. The server will run until you close the terminal.
Option 2: Auto-starting with Claude Desktop (recommended for regular use)
The Claude Desktop can automatically start the MCP server when needed. To set this up:
Configuration
The Claude Desktop configuration file is located at:
- **macOS**: ~/Library/Application Support/Claude/claude_desktop_config.json
- **Windows**: %APPDATA%\Claude\claude_desktop_config.json
- **Linux**: ~/.config/Claude/claude_desktop_config.json
Edit this file to add the Hacker News MCP configuration. If the file doesn't exist, create it:
**Important**: Replace ABSOLUTE_PATH_TO_DIRECTORY with the **complete absolute path** where you installed the MCP
- macOS/Linux example: /Users/username/mcp-claude-hackernews
- Windows example: C:\\Users\\username\\mcp-claude-hackernews
If you already have other MCPs configured, simply add the "hackerNews" section inside the "mcpServers" object. Here's an example of a configuration with multiple MCPs:
The MCP server will automatically start when Claude Desktop needs it, based on the configuration in your claude_desktop_config.json file.
Usage
1. Restart Claude Desktop after modifying the configuration
2. In Claude, use the Hacker News tools to interact with Hacker News
3. The MCP server runs as a child process managed by Claude Desktop
Available Tools
The Hacker News MCP provides **6 specialized tools** for different functions:
| Tool | Description | Parameters | Example Usage |
|------|-------------|------------|---------------|
| hn_latest | Get the most recent stories from Hacker News | limit: Optional number of stories (1-50, default: 10) | Get 20 latest stories |
| hn_top | Get the top-ranked stories from Hacker News | limit: Optional number of stories (1-50, default: 10) | Get 15 top stories |
| hn_best | Get the best stories from Hacker News | limit: Optional number of stories (1-50, default: 10) | Get 25 best stories |
| hn_search | Search stories by keyword | query: Required search terms; limit: 1-50 (default: 10); sort: relevance (default) or date | Search "rust async" sorted by date |
| hn_story | Get detailed information about a specific story | story_id: Required story ID (number) | Get story details by ID |
| hn_comments | Get top-level comments for a story | story_id: Story ID (number) OR story_index: Index from last list (1-based); limit: 1-50 (default: 20) | Get comments by story ID or index |
Tool Parameters Details
hn_latest, hn_top, hn_best