From 954931b3adebbfefe99c33af4ad050eb08540e84 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:04:13 +0800 Subject: [PATCH 1/2] Add Dockerfile --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8e3eab9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +# Use an official Node.js image as a parent image +FROM node:18-alpine AS builder + +# Set the working directory in the container to /app +WORKDIR /app + +# Copy package.json and package-lock.json into the container at /app +COPY package.json package-lock.json ./ + +# Install project dependencies +RUN npm install + +# Copy the rest of the project's files into the container at /app +COPY . . + +# Build the TypeScript project +RUN npm run build + +# Production image +FROM node:18-alpine + +# Set the working directory to /app +WORKDIR /app + +# Copy the build output and node_modules from the builder stage to the production image +COPY --from=builder /app/build /app/build +COPY --from=builder /app/node_modules /app/node_modules + +# Set environment variables +ENV STABILITY_AI_API_KEY=your_api_key_here +ENV IMAGE_STORAGE_DIRECTORY=/tmp/stability-ai-images + +# Create the image storage directory +RUN mkdir -p /tmp/stability-ai-images + +# Expose port (if the application listens on a port) +# EXPOSE 3000 + +# Run the application +ENTRYPOINT ["node", "build/index.js"] \ No newline at end of file From 782493d221e72bea4e43c4729df14b9236c68266 Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:04:15 +0800 Subject: [PATCH 2/2] Add Smithery configuration --- smithery.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 smithery.yaml diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..7b08f5e --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,21 @@ +# Smithery configuration file: https://smithery.ai/docs/deployments + +startCommand: + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: + - stabilityAiApiKey + properties: + stabilityAiApiKey: + type: string + description: Your Stability AI API key. + imageStorageDirectory: + type: string + default: /tmp/stability-ai-images + description: Directory where generated images will be saved. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + config => ({ command: 'node', args: ['build/index.js'], env: { STABILITY_AI_API_KEY: config.stabilityAiApiKey, IMAGE_STORAGE_DIRECTORY: config.imageStorageDirectory || '/tmp/stability-ai-images' } }) \ No newline at end of file