From 81359b4512f1b75bfaacfc22fd68b4b0484ab9ff Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Thu, 30 Jan 2025 06:01:39 +0800 Subject: [PATCH 1/3] Add Dockerfile --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e36582 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use a Node.js image for building the application +FROM node:22.12-alpine AS builder + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm install + +# Copy the application code +COPY . . + +# Build the TypeScript code +RUN npm run build + +# Use a minimal Node.js image for running the application +FROM node:22-alpine AS release + +# Set the working directory +WORKDIR /app + +# Copy the build files and package.json to the runtime image +COPY --from=builder /app/build /app/build +COPY --from=builder /app/package.json /app/package.json +COPY --from=builder /app/package-lock.json /app/package-lock.json + +# Install only production dependencies +RUN npm ci --omit=dev + +# Set the command to run the application +ENTRYPOINT ["node", "build/index.js"] From aa45813d2fb1f2a88ff00b5996a7d02d04d2e9ed Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Thu, 30 Jan 2025 06:01:40 +0800 Subject: [PATCH 2/3] Add Smithery configuration --- smithery.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 smithery.yaml diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..f664573 --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,13 @@ +# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml + +startCommand: + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: [] + properties: {} + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + config => ({command: 'node', args: ['build/index.js'], env: {}}) From 78c33674fd555d5a3a10cd448f77397ff26c6d0e Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Thu, 30 Jan 2025 06:01:41 +0800 Subject: [PATCH 3/3] Update README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d9b426e..09dc125 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # Hacker News MCP Server +[![smithery badge](https://smithery.ai/badge/@pskill9/hn-server)](https://smithery.ai/server/@pskill9/hn-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). Hacker News MCP server + ## Features - Fetch different types of stories (top, new, ask, show, jobs) @@ -13,6 +15,14 @@ A Model Context Protocol (MCP) server that provides tools for fetching stories f ## Installation +### Installing via Smithery + +To install Hacker News for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@pskill9/hn-server): + +```bash +npx -y @smithery/cli install @pskill9/hn-server --client claude +``` + 1. Clone the repository: ```bash git clone https://github.com/pskill9/hn-server