Hacker News MCP
ハッカーニュースMCPサーバー
Hacker Newsから記事を取得するためのツールを提供するModel Context Protocol(MCP)サーバー。このサーバーはnews.ycombinator.comのHTMLコンテンツを解析し、様々なタイプの記事(トップ、新着、質問、ショー、求人)の構造化データを提供します。
特徴
さまざまな種類のストーリー(トップ、新着、質問、表示、求人)を取得します
タイトル、URL、ポイント、著者、タイムスタンプ、コメント数などの構造化データを取得します
返されるストーリーの数の設定可能な制限
クリーンなエラー処理と検証
Related MCP server: Hacker News MCP Server
インストール
リポジトリをクローンします。
git clone https://github.com/pskill9/hn-server
cd hn-server依存関係をインストールします:
npm installサーバーを構築します。
npm run buildMCP 設定構成ファイルに追加します (場所はシステムによって異なります)。
VSCode Claude 拡張機能の場合:
{
"mcpServers": {
"hacker-news": {
"command": "node",
"args": ["/path/to/hn-server/build/index.js"]
}
}
}使用法
サーバーは、Hacker News から記事を取得するために使用できるget_storiesと呼ばれるツールを提供します。
ツール: get_stories
パラメータ:
type(文字列): 取得するストーリーの種類オプション: 「トップ」、「新着」、「質問」、「表示」、「求人」
デフォルト: 'top'
limit(数値): 返されるストーリーの数範囲: 1~30
デフォルト: 10
使用例:
use_mcp_tool with:
server_name: "hacker-news"
tool_name: "get_stories"
arguments: {
"type": "top",
"limit": 5
}サンプル出力:
[
{
"title": "Example Story Title",
"url": "https://example.com/story",
"points": 100,
"author": "username",
"time": "2024-12-28T00:03:05",
"commentCount": 50,
"rank": 1
},
// ... more stories
]クロードとの統合
この MCP サーバーを Claude で使用するには、次のことが必要です。
ClaudeデスクトップアプリまたはVSCode Claude拡張機能がインストールされている
設定でMCPサーバーを構成する
Claudeの自然言語インターフェースを使用してHacker Newsと対話する
構成
Claude デスクトップ アプリの場合は、次のサーバー構成を追加します。
// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
// %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"hacker-news": {
"command": "node",
"args": ["/path/to/hn-server/build/index.js"]
}
}
}VSCode Claude 拡張機能の場合は、以下を追加します。
// VSCode Settings JSON
{
"mcpServers": {
"hacker-news": {
"command": "node",
"args": ["/path/to/hn-server/build/index.js"]
}
}
}やり取りの例
設定が完了すると、自然言語を使ってクロードと対話し、Hacker Newsの記事を取得できるようになります。例:
「Hacker Newsのトップ5のニュースを見せてください」
「最新の Ask HN 投稿は何ですか?」
「今日のショーHNのトップ投稿を取得してください」
Claude は適切なパラメータを自動的に使用して、必要なストーリーを取得します。

ストーリーオブジェクト構造
各ストーリー オブジェクトには次のものが含まれます。
title(文字列): ストーリーのタイトルurl(文字列、オプション): ストーリーのURL (テキスト投稿の場合は内部HN URL)points(数値):賛成票の数author(文字列): 投稿者のユーザー名time(文字列): ストーリーが投稿されたときのタイムスタンプcommentCount(数値): コメント数rank(数字):リスト内の位置
発達
サーバーは以下を使用して構築されます:
タイプスクリプト
モデルコンテキストプロトコルSDK
HTTPリクエスト用のAxios
HTML解析用のCheerio
サーバーを変更するには:
src/index.tsに変更を加える再構築:
npm run buildエラー処理
サーバーには、次の堅牢なエラー処理機能が含まれています。
無効なストーリータイプ
ネットワーク障害
HTML解析エラー
無効なパラメータ値
エラーは、適切なエラー コードと説明メッセージとともに返されます。
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
ライセンス
MIT ライセンス - ご自身のプロジェクトで自由にご利用ください。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Flicense-qualityDmaintenanceEnables access to Hacker News data including top stories, new stories, specific story details, and search functionality. Integrates with Poke to provide Hacker News content through natural language interactions.1
- Flicense-qualityDmaintenanceEnables AI assistants to access Hacker News content through 9 comprehensive tools for fetching stories, comments, user profiles, and job postings. Supports flexible output formats, pagination, and various story categories (top, new, best, Ask HN, Show HN).
- AlicenseAqualityDmaintenanceProvides programmatic access to Hacker News content via the HN Algolia API. It enables AI assistants to search stories, retrieve comments, access user profiles, and explore the front page in real-time.954MIT
- AlicenseAqualityAmaintenanceProvides AI agents with access to Hacker News data including top stories, story details, comment threads, and full-text search for content research and trend monitoring.5MIT
Related MCP Connectors
Browse Hacker News feeds, threads, and user profiles with full-text search.
Hacker News MCP — search and retrieve stories from Hacker News
HN front-page, Algolia full-text search, and Show HN launch tracker.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pskill9/hn-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server