Skip to content
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

Deployment: Dockerfile and Smithery config #22

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
37 changes: 37 additions & 0 deletions examples/mcp/javascript/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use an official Node.js image as a parent image
FROM node:16-alpine AS builder

# Set the working directory in the container
WORKDIR /app

# Copy the package.json and package-lock.json files to the working directory
COPY examples/mcp/javascript/package.json ./

# Install any needed packages specified in package.json
RUN npm install

# Copy the current directory contents into the container at /app
COPY examples/mcp/javascript/ ./

# Build the MCP server
RUN npm run build

# Use a smaller base image for the runtime environment
FROM node:16-alpine AS release

# Set the working directory in the container
WORKDIR /app

# Copy the build output from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./

# Install only production dependencies
RUN npm install --only=production

# Set environment variables for the MCP server
ENV NODE_ENV=production

# Run the MCP server
CMD ["node", "build/index.js"]
10 changes: 10 additions & 0 deletions examples/mcp/javascript/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Using watsonx.ai Flows Engine with Model Context Protocol (MCP)

[![smithery badge](https://smithery.ai/badge/@IBM/wxflows)](https://smithery.ai/server/@IBM/wxflows)

Here's a step-by-step tutorial for setting up and deploying a project with `wxflows`, including installing necessary tools, deploying the app, and running it locally.

This example consists of the following pieces:
Expand Down Expand Up @@ -112,6 +114,14 @@ Please [reach out to us on Discord](https://ibm.biz/wxflows-discord) if you have

## Installation

### Installing via Smithery

To install wxflows for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@IBM/wxflows):

```bash
npx -y @smithery/cli install @IBM/wxflows --client claude
```

To use with Claude Desktop, add the server config:

On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
Expand Down
23 changes: 23 additions & 0 deletions examples/mcp/javascript/smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml

build:
dockerBuildPath: examples/mcp/javascript
startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- wxflowsApiKey
- wxflowsEndpoint
properties:
wxflowsApiKey:
type: string
description: The API key for wxflows authentication.
wxflowsEndpoint:
type: string
description: The endpoint URL for the wxflows server.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({ command: 'node', args: ['build/index.js'], env: { WXFLOWS_APIKEY: config.wxflowsApiKey, WXFLOWS_ENDPOINT: config.wxflowsEndpoint } })