diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ec7fc9f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use a Node.js image as the base image +FROM node:20-alpine AS builder + +# Set the working directory +WORKDIR /app + +# Copy the package.json and package-lock.json files +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm install + +# Copy the entire source code into the image +COPY . . + +# Build the project +RUN npm run build + +# Use a smaller Node.js image for the runtime +FROM node:20-alpine AS runtime + +# Set the working directory +WORKDIR /app + +# Copy the built files from the builder stage +COPY --from=builder /app/build ./build + +# Copy the package.json and package-lock.json to ensure all dependencies are available +COPY package.json package-lock.json ./ + +# Re-install only production dependencies +RUN npm install --omit=dev + +# Define environment variables +ENV NODE_ENV=production + +# Define the entry point +CMD ["node", "build/index.js"] \ No newline at end of file diff --git a/README.md b/README.md index 352100e..779afd8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # WordPress MCP Server +[![smithery badge](https://smithery.ai/badge/@stefans71/wordpress)](https://smithery.ai/server/@stefans71/wordpress) A Model Context Protocol (MCP) server for WordPress integration, compatible with Windows, macOS, and Linux. @@ -8,6 +9,15 @@ This MCP server enables interaction with WordPress sites through the WordPress R ## Installation +### Installing via Smithery + +To install WordPress Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@stefans71/wordpress): + +```bash +npx -y @smithery/cli install @stefans71/wordpress --client claude +``` + +### Manual Installation 1. Clone the repository 2. Install dependencies: ```bash diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..f7323ba --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,25 @@ +# 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: + - wordpressSiteUrl + - wordpressUsername + - wordpressPassword + properties: + wordpressSiteUrl: + type: string + description: The URL of the WordPress site. + wordpressUsername: + type: string + description: The WordPress username for authentication. + wordpressPassword: + type: string + description: The WordPress application password. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + (config) => ({command: 'node', args: ['build/index.js'], env: {WORDPRESS_SITE_URL: config.wordpressSiteUrl, WORDPRESS_USERNAME: config.wordpressUsername, WORDPRESS_PASSWORD: config.wordpressPassword}}) \ No newline at end of file