hacker-news-mcp-server

CobaltBlue3699/hacker-news-mcp-server

3.1

If you are the rightful owner of hacker-news-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This project aims to develop a server that adheres to the Model Context Protocol (MCP), serving as an intermediary layer for large language models (LLM) to access real-time information from Hacker News securely and efficiently.

Hacker News MCP Server

摘要

本專案旨在開發一個遵循模型上下文協定(Model Context Protocol, MCP)的伺服器。此伺服器將作為一個中介層,讓大型語言模型(LLM)能夠安全、快速地存取 Hacker News 的即時資訊,從而提供更具時效性與價值的回覆。

主要功能

  • 獲取熱門新聞 (Top Stories)
  • 獲取最新新聞 (New Stories)
  • 獲取精選新聞 (Best Stories)
  • 獲取特定新聞的內文與留言 (Story content and comments)

使用 Gemini 測試 MCP Server

專案提供了 PowerShell 與 Shell 腳本,方便啟動 MCP Server 並透過 Gemini 測試工具自動呼叫已提供的工具產生報告。

PowerShell (Windows)

.\scripts\run-with-gemini.ps1

Shell (Linux / macOS)

./scripts/run-with-gemini.sh

以上指令會:

  • 啟動 npm start 執行 MCP Server
  • 呼叫 Gemini CLI 並連線到剛啟動的 MCP Server
  • 使用 MCP Server 提供的工具自動產生每日 Hacker News 報告

技術選型

  • 框架: NestJS
  • 語言: TypeScript

安裝

# 安裝專案依賴
$ npm install

執行應用程式

# 開發模式 (監看檔案變化)
$ npm run start:dev

# 監看模式
$ npm run start

# 生產模式
$ npm run start:prod

測試

# 單元測試
$ npm run test

# 測試覆蓋率
$ npm run test:cov

# e2e 測試
$ npm run test:e2e

授權

本專案採用 授權。