Temporal Workflows MCP server

Exposes Temporal workflows as tools for AI assistants, enabling organizations to leverage existing workflow infrastructure without custom integration code.
Back to servers
Setup instructions
Provider
Mocksi
Release date
Apr 24, 2025
Language
Go
Stats
20 stars

Temporal-MCP Server enables AI assistants like Claude to interact with Temporal workflows through natural language. It bridges the gap between conversational interfaces and complex backend orchestration, allowing you to trigger and monitor stateful processes without writing custom integration code.

Getting Started

Prerequisites

  • Go 1.21+
  • Temporal Server (running locally or remotely)

Installation

  1. Run your Temporal server and workers. This example uses the Temporal Money Transfer Demo.

  2. Build the server:

git clone https://github.com/Mocksi/temporal-mcp.git
cd temporal-mcp
make build
  1. Define your workflows in config.yml. The sample configuration works with the Temporal Money Transfer Demo:
workflows:
  AccountTransferWorkflow:
    purpose: "Transfers money between accounts with validation and notification. Handles the happy path scenario where everything works as expected."
    input:
      type: "TransferInput"
      fields:
        - from_account: "Source account ID"
        - to_account: "Destination account ID"
        - amount: "Amount to transfer"
    output:
      type: "TransferOutput"
      description: "Transfer confirmation with charge ID"
    taskQueue: "account-transfer-queue"

  AccountTransferWorkflowScenarios:
    purpose: "Extended account transfer workflow with various scenarios including human approval, recoverable failures, and advanced visibility features."
    input:
      type: "TransferInput"
      fields:
        - from_account: "Source account ID"
        - to_account: "Destination account ID"
        - amount: "Amount to transfer"
        - scenario_type: "Type of scenario to execute (human_approval, recoverable_failure, advanced_visibility)"
    output:
      type: "TransferOutput"
      description: "Transfer confirmation with charge ID"
    taskQueue: "account-transfer-queue"
  1. Generate Claude's configuration:
cd examples
./generate_claude_config.sh
  1. Install the configuration:
cp examples/claude_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Start Claude with this configuration

Using Temporal-MCP

After setup, you can interact with your workflows through natural language in Claude:

  • "Claude, can you transfer $100 from account ABC123 to account XYZ789?"
  • "What transfer scenarios are available to test?"
  • "Execute a transfer that requires human approval for $500 between accounts ABC123 and XYZ789"
  • "Has the transfer workflow completed yet?"
  • "Run a transfer scenario with recoverable failures to test error handling"

Behind the scenes, Temporal MCP translates these requests into properly formatted workflow executions.

Configuration

The configuration file connects your AI assistants to your workflow engine:

Example Configuration

# Temporal server connection details
temporal:
  hostPort: "localhost:7233"
  namespace: "default"
  environment: "local"
  defaultTaskQueue: "account-transfer-queue"

  # Fine-tune connection behavior
  timeout: "5s"
  retryOptions:
    initialInterval: "100ms"
    maximumInterval: "10s"
    maximumAttempts: 5
    backoffCoefficient: 2.0

# Define AI-discoverable workflows
workflows:
  AccountTransferWorkflow:
    purpose: "Transfers money between accounts with validation and notification. Handles the happy path scenario where everything works as expected."
    workflowIDRecipe: "transfer_{{.from_account}}_{{.to_account}}_{{.amount}}"
    input:
      type: "TransferInput"
      fields:
        - from_account: "Source account ID"
        - to_account: "Destination account ID"
        - amount: "Amount to transfer"
    output:
      type: "TransferOutput"
      description: "Transfer confirmation with charge ID"
    taskQueue: "account-transfer-queue"
    activities:
      - name: "validate"
        timeout: "5s"
      - name: "withdraw"
        timeout: "5s"
      - name: "deposit"
        timeout: "5s"
      - name: "sendNotification"
        timeout: "5s"
      - name: "undoWithdraw"
        timeout: "5s"

Troubleshooting

Common Issues

Connection Refused

  • Check if Temporal server is running
  • Verify hostPort is correct in config.yml

Workflow Not Found

  • Ensure workflow is registered in Temporal
  • Check namespace settings in config.yml

Claude Can't See Workflows

  • Verify claude_config.json is in the correct location
  • Restart Claude after configuration changes

Best Practices

Crafting Effective Purpose Fields

The purpose field helps AI assistants understand what each workflow does:

Good Example: "Retrieves detailed metadata about a file or directory including size, creation time, last modified time, permissions, and type. Performs access validation to ensure the requested file is within allowed directories. Returns formatted JSON with all attributes or an appropriate error message."

Poor Example: "Gets information about a file."

Security Guidelines

  • Keep credentials out of configuration files
  • Use environment variables for sensitive values
  • Consider access controls for workflows with sensitive data
  • Validate and sanitize all workflow inputs

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "temporal-mcp" '{"command":"temporal-mcp","args":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "temporal-mcp": {
            "command": "temporal-mcp",
            "args": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "temporal-mcp": {
            "command": "temporal-mcp",
            "args": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later