Software
Data source: Hacker News API
MCP Protocol
Endpoint
https://context.gnist.ai/mcp/hn/
claude_desktop_config.json
{
"mcpServers": {
"gnist-hn": {
"url": "https://context.gnist.ai/mcp/hn/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
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"}}}'
REST API
API Root
https://context.gnist.ai/rest/hn/
5 endpoints available:
GET /rest/hn/search_hn_discussionsGET /rest/hn/get_hn_trendingGET /rest/hn/get_hn_story_threadGET /rest/hn/get_hn_author_activityGET /rest/hn/report_feedback
Shell
curl "https://context.gnist.ai/rest/hn/search_hn_discussions?query=example" \ -H "Gnist-API-Key: YOUR_API_KEY"
Python
import httpx
resp = httpx.get(
"https://context.gnist.ai/rest/hn/search_hn_discussions",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
params={
"query": "example"
},
)
print(resp.json())
Command Line
Command
gc hn
CLI documentation will be available when the GnistAI SDK is published.
Install
pip install gnistai
Available Tools (5)
search_hn_discussionsFull-text search over Hacker News stories.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Search terms. |
date_from | any | optional | Filter results after this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC). |
date_to | any | optional | Filter results before this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC). |
min_points | integer | optional | Minimum points (upvotes) a story must have. Default 0 (no filter). (default: 0) |
max_results | integer | optional | Maximum stories to return (1–100, default 25). (default: 25) |
get_hn_trendingGet top Hacker News stories in a rolling time window, sorted by points.
| Parameter | Type | Required | Description |
|---|---|---|---|
hours_ago | integer | optional | How far back to look (1–168 hours, default 24). (default: 24) |
min_points | integer | optional | Minimum points threshold (default 10). (default: 10) |
max_results | integer | optional | Maximum stories to return (1–100, default 25). (default: 25) |
get_hn_story_threadFetch a Hacker News story with its top comments.
| Parameter | Type | Required | Description |
|---|---|---|---|
story_id | integer | required | The HN story ID (numeric, from the URL: news.ycombinator.com/item?id=<id>). |
max_comments | integer | optional | Maximum top-level comments to include (default 20). (default: 20) |
get_hn_author_activityGet recent submissions and comments by a Hacker News user.
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | required | HN username (case-sensitive). |
limit | integer | optional | Maximum stories and comments to return each (default 10). (default: 10) |
report_feedbackReport a bug, feature request, or general feedback for this data source.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |