From 651242812467af2d2eb298946f1596218b605655 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:02:30 +0800 Subject: [PATCH 1/5] 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..3b286ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use an official Node.js image as a base for the build stage +FROM node:16 AS builder + +# Set the working directory inside the container +WORKDIR /app + +# Copy package manager lock file and package.json files +COPY pnpm-lock.yaml package.json ./ + +# Install dependencies +RUN npm install -g pnpm && pnpm install + +# Copy the rest of the project files +COPY . . + +# Build the project +RUN pnpm build + +# Use a smaller Node.js image for the runtime environment +FROM node:16-slim + +# Set the working directory inside the container +WORKDIR /app + +# Copy built files and dependencies from the builder stage +COPY --from=builder /app ./ + +# Install only production dependencies +RUN pnpm install --prod + +# Set the command to run the server +ENTRYPOINT ["npx", "openapi-mcp-server"] + +# To run the server, you will need to provide the path to the OpenAPI JSON file as an argument From 18e9b8acdaf156a69dd1859fe907d20c7a82e016 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:02:30 +0800 Subject: [PATCH 2/5] Add Smithery configuration --- smithery.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 smithery.yaml diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..621530a --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,17 @@ +# 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: + - openApiJsonPath + properties: + openApiJsonPath: + type: string + description: The absolute path to the OpenAPI v3.1 JSON file. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + config => ({command: 'npx', args: ['openapi-mcp-server', config.openApiJsonPath]}) From b26563b73b8e69824d4d2c99886c39f6383ea5e8 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:02:31 +0800 Subject: [PATCH 3/5] Update README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 6dfd66a..eb20ef6 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,14 @@ You can say: 2. **Restart Claude Desktop** and start interacting with your API! +### Installing via Smithery + +To install OpenAPI MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/openapi-mcp-server): + +```bash +npx -y @smithery/cli install openapi-mcp-server --client claude +``` + ## Examples This repository includes a complete example of a Petstore API server that you can use to test the OpenAPI MCP Server. The example server implements a basic CRUD API for managing pets, making it perfect for learning how to use this tool. From 6e8e3ce4f192440d1dfc163894f0ffd7317a6363 Mon Sep 17 00:00:00 2001 From: Snaggle AI Date: Mon, 3 Feb 2025 13:23:11 +0100 Subject: [PATCH 4/5] Update smithery.yaml --- smithery.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smithery.yaml b/smithery.yaml index 621530a..ca0f5b6 100644 --- a/smithery.yaml +++ b/smithery.yaml @@ -10,7 +10,7 @@ startCommand: properties: openApiJsonPath: type: string - description: The absolute path to the OpenAPI v3.1 JSON file. + description: Path to the OpenAPI v3.1 specification in json or yaml. Either an absolute local path or a https url. commandFunction: # A function that produces the CLI command to start the MCP on stdio. |- From 72f918ac7751ad7f2bd82d6eef19da2ef4d1b2d6 Mon Sep 17 00:00:00 2001 From: Snaggle AI Date: Mon, 3 Feb 2025 13:24:43 +0100 Subject: [PATCH 5/5] Update Dockerfile to use node 23 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b286ad..075430f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile # Use an official Node.js image as a base for the build stage -FROM node:16 AS builder +FROM node:23 AS builder # Set the working directory inside the container WORKDIR /app @@ -18,7 +18,7 @@ COPY . . RUN pnpm build # Use a smaller Node.js image for the runtime environment -FROM node:16-slim +FROM node:23-slim # Set the working directory inside the container WORKDIR /app