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.
Run your Temporal server and workers. This example uses the Temporal Money Transfer Demo.
Build the server:
git clone https://github.com/Mocksi/temporal-mcp.git
cd temporal-mcp
make build
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"
cd examples
./generate_claude_config.sh
cp examples/claude_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
After setup, you can interact with your workflows through natural language in Claude:
Behind the scenes, Temporal MCP translates these requests into properly formatted workflow executions.
The configuration file connects your AI assistants to your workflow engine:
# 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"
Connection Refused
Workflow Not Found
Claude Can't See Workflows
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."
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.
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.
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": []
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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