Skip to content

Deployment: Dockerfile and Smithery config #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Golang image to create a build environment
FROM golang:1.21-alpine AS builder

# Set the working directory inside the container
WORKDIR /app

# Copy the go module files and download dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the source code into the container
COPY . .

# Build the Go application
RUN go build -o mcp-difyworkflow-server

# Use a minimal image for the production environment
FROM alpine:3.18

# Set the working directory inside the container
WORKDIR /app

# Copy the compiled Go binary from the builder stage
COPY --from=builder /app/mcp-difyworkflow-server /usr/local/bin/mcp-difyworkflow-server

# Set environment variables for the server configuration
# Replace with actual values before running the container
ENV DIFY_WORKFLOW_NAME=workflow-translator,workflow-genImag
ENV DIFY_API_KEYS=appkey-xxxxxxxxxxxa,appkey-xxxxxxxxxxxb

# Expose any ports if necessary (if the server communicates over a network port)
# EXPOSE <port_number>

# Command to run the application
ENTRYPOINT ["mcp-difyworkflow-server", "-base-url", "http://localhost/v1"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
## mcp-difyworkflow-server
[![smithery badge](https://smithery.ai/badge/mcp-difyworkflow-server)](https://smithery.ai/server/mcp-difyworkflow-server)

mcp-difyworkflow-server is an mcp server Tools application that implements the query and invocation of Dify workflows, supporting the on-demand operation of multiple custom Dify workflows.

## INSTALL

### Installing via Smithery

To install Dify Workflow Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-difyworkflow-server):

```bash
npx -y @smithery/cli install mcp-difyworkflow-server --client claude
```

### Manual Installation
```shell
git clone https://github.com/gotoolkis/mcp-difyworkflow-server.git

Expand Down
25 changes: 25 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -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:
- difyWorkflowName
- difyApiKeys
properties:
difyWorkflowName:
type: string
description: Comma-separated list of workflow names.
difyApiKeys:
type: string
description: Comma-separated list of API keys corresponding to the workflow names.
baseUrl:
type: string
default: http://localhost/v1
description: The base URL of the Dify platform API server.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({command:'mcp-difyworkflow-server',args:['-base-url', config.baseUrl],env:{DIFY_WORKFLOW_NAME:config.difyWorkflowName,DIFY_API_KEYS:config.difyApiKeys}})