Watsonx.ai Flows Engine with Model Context Protocol (MCP)

Prerequisites
  • Sign up for a free account on watsonx.ai.
  • Download & install Node.js CLI.
  • Authenticate your account.

Step-by-Step Setup

Step 1: Clone the Repository

git clone https://github.com/IBM/wxflows.git
 cd examples/mcp/javascript
 

Step 2: Set up wxflows

Navigate to the wxflows directory:

cd wxflows
 

Step 3: Deploy a Flows Engine Project

Deploy the tool configuration to a Flows Engine endpoint:

wxflows deploy
 

Step 4: Set Up Environment Variables

Copy the sample environment file and edit it:

cp .env.sample .env
 

Edit the .env file to add your credentials, such as API keys.

Step 5: Install Dependencies

Install the necessary dependencies:

npm i
 

Step 6: Build the MCP Server

Build the server:

npm run build
 

Step 7: Configure MCP Client

Add the server config for Claude Desktop:

  • On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
  "wxflows-server": {
  "command": "node",
  "args": ["/path/to/wxflows-server/build/index.js"],
  "env": {
  "WXFLOWS_APIKEY": "YOUR_WXFLOWS_APIKEY",
  "WXFLOWS_ENDPOINT": "YOUR_WXFLOWS_ENDPOINT"
  }
  }
  }
 }
 

Debugging

Use the MCP Inspector for debugging:

npm run inspector
 

The Inspector will provide a URL to access debugging tools in your browser.

Share this post: