GnistAI GnistAI
Log in

Hacker News

Hacker News stories, comments, and discussions from the tech community.

Overview   |   MCP   |   REST API   |   OpenAPI   |   CLI   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 5 tools tools 5 5 type: api wrapper type type api wrapper api wrapper lifecycle: maintained lifecycle lifecycle maintained maintained Software

Data source: Hacker News API

MCP Endpoint (Streamable HTTP) https://context.gnist.ai/mcp/hn/
Authentication

All requests require a Gnist-API-Key header (or api_key query parameter).

Free tier: 100 calls/day. Get your API key.

Tools (5)

search_hn_discussions

Full-text search over Hacker News stories.

Searches the complete HN archive via the Algolia search index. Results are sorted by relevance.

Args:
query: Search terms.
date_from: Filter results after this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC).
date_to: Filter results before this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC).
min_points: Minimum points (upvotes) a story must have. Default 0 (no filter).
max_results: Maximum stories to return (1–100, default 25).

Returns:
Dictionary with 'count' and 'stories' list. Each story has title, url, author,
points, num_comments, created_at, and hn_url.

ParameterTypeRequiredDescription
querystringrequiredSearch terms.
date_fromanyoptionalFilter results after this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC).
date_toanyoptionalFilter results before this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC).
min_pointsintegeroptionalMinimum points (upvotes) a story must have. Default 0 (no filter). (default: 0)
max_resultsintegeroptionalMaximum stories to return (1–100, default 25). (default: 25)
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "search_hn_discussions",
    "arguments": {
      "query": "example"
    }
  }
}
get_hn_story_thread

Fetch a Hacker News story with its top comments.

Args:
story_id: The HN story ID (numeric, from the URL: news.ycombinator.com/item?id=<id>).
max_comments: Maximum top-level comments to include (default 20).

Returns:
Story metadata plus a list of top comments sorted by score, each
with text, author, points, and nested replies.

ParameterTypeRequiredDescription
story_idintegerrequiredThe HN story ID (numeric, from the URL: news.ycombinator.com/item?id=<id>).
max_commentsintegeroptionalMaximum top-level comments to include (default 20). (default: 20)
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_hn_story_thread",
    "arguments": {
      "story_id": 1
    }
  }
}
get_hn_author_activity

Get recent submissions and comments by a Hacker News user.

Args:
username: HN username (case-sensitive).
limit: Maximum stories and comments to return each (default 10).

Returns:
User profile (username, karma, created_at) with lists of recent
stories and comments.

ParameterTypeRequiredDescription
usernamestringrequiredHN username (case-sensitive).
limitintegeroptionalMaximum stories and comments to return each (default 10). (default: 10)
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_hn_author_activity",
    "arguments": {
      "username": "example"
    }
  }
}
report_feedback

Report a bug, feature request, or general feedback for this data source.

Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.

Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "report_feedback",
    "arguments": {
      "feedback": "example"
    }
  }
}

Quick Start

Shell
curl -X POST "https://context.gnist.ai/mcp/hn/" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_hn_discussions", "arguments": {"query": "example"}}}'
Python
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/hn/",
    headers={"Gnist-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json={
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "search_hn_discussions",
    "arguments": {
      "query": "example"
    }
  }
},
)
print(resp.json())

Related Toolkits (Software)

Resources