PH

pskill9/hn-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

40 stars 6 forks Качество 65 Тренд 0MIT

pskill9/hn-сервер - кандидат на сервер MCP, импортированный из https://github.com/pskill9/hn-server.

Обзор

pskill9/hn-сервер - кандидат на сервер MCP, импортированный из https://github.com/pskill9/hn-server.

Обзор (машинный перевод)

Сервер Model Context Protocol (MCP), который предоставляет инструменты для извлечения историй из Hacker News. Этот сервер анализирует HTML-контент с сайта news.ycombinator.com и предоставляет структурированные данные для различных типов историй (сверху, новые, спрашивать, показывать, задания).

Особенности

Привлекайте различные типы историй (сверху, новые, спрашивайте, показывайте, работайте) Получите структурированные данные, включая заголовки, URL-адреса, точки, авторов, временные метки и количество комментариев Конфигурируемый лимит на количество возвращенных историй

  • Чистая обработка ошибок и проверка

##Установка

  1. Клонировать хранилище:

  2. Установить зависимости:

3 Построить сервер:

4.Добавьте файл конфигурации настроек MCP (местоположение зависит от вашей системы):

Для расширения VSCode Claude:

Использование

Сервер предоставляет инструмент под названием get_stories, который можно использовать для извлечения историй из Hacker News.

###Инструмент: get stories

Параметры: [[Т1]] (струна): Тип историй, чтобы принести

  • Варианты: “верхний”, “новый”, “задать”, “показать”, “работа”
  • По умолчанию: “верх” [[Т2]] (число): Количество историй, которые нужно вернуть
  • Дальность: 1-30
  • Дефолт: 10

Пример использования:

Результат выборки:

Интеграция с Клодом

Чтобы использовать этот MCP-сервер с Claude, вам нужно:

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Hacker News MCP Server

A Model Context Protocol (MCP) server that provides tools for fetching stories from Hacker News. This server parses the HTML content from news.ycombinator.com and provides structured data for different types of stories (top, new, ask, show, jobs).

Features

  • Fetch different types of stories (top, new, ask, show, jobs)
  • Get structured data including titles, URLs, points, authors, timestamps, and comment counts
  • Configurable limit on number of stories returned
  • Clean error handling and validation

Installation

  1. Clone the repository:
git clone https://github.com/pskill9/hn-server
cd hn-server
  1. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Add to your MCP settings configuration file (location depends on your system):

For VSCode Claude extension:

{
  "mcpServers": {
    "hacker-news": {
      "command": "node",
      "args": ["/path/to/hn-server/build/index.js"]
    }
  }
}

Usage

The server provides a tool called get_stories that can be used to fetch stories from Hacker News.

Tool: get_stories

Parameters:

  • type (string): Type of stories to fetch
    • Options: ‘top’, ‘new’, ‘ask’, ‘show’, ‘jobs’
    • Default: ‘top’
  • limit (number): Number of stories to return
    • Range: 1-30
    • Default: 10

Example usage:

use_mcp_tool with:
server_name: "hacker-news"
tool_name: "get_stories"
arguments: {
  "type": "top",
  "limit": 5
}

Sample output:

[
  {
    "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
]

Integrating with Claude

To use this MCP server with Claude, you’ll need to:

  1. Have the Claude desktop app or VSCode Claude extension installed
  2. Configure the MCP server in your settings
  3. Use Claude’s natural language interface to interact with Hacker News

Configuration

For the Claude desktop app, add the server configuration to:

// ~/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"]
    }
  }
}

For the VSCode Claude extension, add to:

// VSCode Settings JSON
{
  "mcpServers": {
    "hacker-news": {
      "command": "node",
      "args": ["/path/to/hn-server/build/index.js"]
    }
  }
}

Example Interactions

Once configured, you can interact with Claude using natural language to fetch Hacker News stories. Examples:

  • “Show me the top 5 stories from Hacker News”
  • “What are the latest Ask HN posts?”
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "hacker-news": { "command": "node", "args": ["/path/to/hn-server/build/index.js"] } } }