Metadata-Version: 2.3
Name: mcp-hn-tddschn
Version: 2.0.1
Summary: MCP Server for Hacker News
Author-email: Ricky <ricky.ediga@gmail.com>, T <tddschn@users.noreply.github.com>
Requires-Python: >=3.12
Requires-Dist: curl-cffi>=0.14.0
Requires-Dist: mcp[cli]>=1.1.2
Description-Content-Type: text/markdown

# Hacker News MCP Server

Fork of https://github.com/erithwik/mcp-hn , 

Changes:
- uses https for everything  
- uses curl_cffi
- better coverage of https://hn.algolia.com/api API

---

A Model Context Protocol (MCP) server that provides tools for fetching information from Hacker News.

<a href="https://glama.ai/mcp/servers/e0rco8dfgt"><img width="380" height="200" src="https://glama.ai/mcp/servers/e0rco8dfgt/badge" alt="mcp-hn MCP server" /></a>

## Tools

- `get_stories` Fetching (top, new, ask_hn, show_hn) stories
- `get_story_info` Fetching comments associated with a story (`comment_depth`, `num_comments` supported)
- `search_stories` Searching for stories by query
- `search_hn` Generic HN search with tags, pagination, numeric filters, and Algolia parameters
- `search_comments` Search comments globally or within one story (`story_id`)
- `get_item` Fetch any HN item by id (story/comment/poll/job)
- `get_user_info` Fetching user info
- `get_user_activity` Search author activity across item types (`story`, `comment`, `poll`, `job`)

## Example Usage

Use prompts like the following:

```
User: Get the top stories of today
  Output: Uses `get_stories` tool and returns a story about AI
User: What does the details of the story today that talks about the future of AI
  Output: Uses `get_story_info` tool based on the results of the previous tool
User: What has the user `pg` been up to?
  Output: Uses `get_user_info` tool and returns a summary of the user's activity
User: What does hackernews say about careers in AI?
  Output: Uses `search_stories` tool and returns a summary of the comments
```

A more detailed example with the puppeteer MCP server:

```
User: What are the top stories of today?
  Output: Uses `get_stories` tool and returns a story about AI
User: Can you use the puppeteer tool to read the article about <AI> and also use the hackernews tool to view the comments and give me a summary of what the main comments are about the article?
  Output: Uses puppeteer tool to read the article about AI and then uses the `get_story_info` hn tool to get the comments and returns a summary of the comments
```

## Quickstart

### Installing via Smithery

To install Hacker News MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-hn):

```bash
npx -y @smithery/cli install mcp-hn-tddschn --client claude
```

### Claude Desktop:

Update the following:

On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`

On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

With the following for production:

```json
{
  "mcpServers": {
    "mcp-hn": {
      "command": "uvx",
      "args": ["mcp-hn-tddschn", "--max-response-words", "10000"]
    }
  }
}
```

## Response Trimming

Large tool outputs are trimmed to `10000` words by default to reduce context/token usage.

- CLI option: `--max-response-words <int>`
- `0` disables trimming

Example:

```bash
uvx mcp-hn-tddschn --max-response-words 4000
```
