Temporal MCP服务器

Temporal MCP服务器是一个用于管理Temporal工作流、命名空间、调度等功能的HTTP API接口,适用于Cursor、Claude Code等MCP兼容的IDE。

  • by alisaitteke
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 alisaitteke/temporal-mcp

使用说明

Temporal.io MCP服务器

MCP服务器 时间 HTTP API。直接从Cursor、Claude Code或任何兼容MCP的IDE管理工作流、命名空间、计划等。

免责声明: 这是一个独立的、社区构建的MCP服务器,不隶属于、不受认可或不受官方支持 Temporal Technologies,股份有限公司。

36工具 覆盖整个Temporal HTTP API表面。默认情况下,只有11个最基本的工具被公开,以保持LLM上下文的精简——请参阅 工具层级.

工具

簇

工具 它做什么
get_cluster_info 服务器版本、群集ID和启用的功能

命名空间

工具 它做什么
list_namespaces 列出群集中的所有命名空间
describe_namespace 配置、保留期、复制信息

工作流

工具 它做什么
count_workflows 统计与可见性查询匹配的执行次数
list_workflows 使用可见性查询语法列出或搜索执行
describe_workflow 状态、类型、任务队列、开始/关闭时间
start_workflow 启动新的工作流执行
signal_workflow 向正在运行的工作流发送信号
signal_with_start_workflow 在一个原子调用中启动+信号(或信号,如果已经运行)
query_workflow 通过已注册的查询处理程序查询工作流状态
cancel_workflow 请求优雅取消
terminate_workflow 立即强制终止(无清理)
pause_workflow 暂停执行(停止安排新任务)
unpause_workflow 恢复暂停的工作流
get_workflow_history 具有人类可读摘要的事件历史记录

日程表

工具 它做什么
list_schedules 列出命名空间中的所有计划
describe_schedule 规格、状态、最近的操作、下一次运行时间
create_schedule 创建基于cron或间隔的计划
delete_schedule 删除计划

活动

工具 它做什么
list_activities 列出活动执行情况(按工作流、类型、状态筛选)
describe_activity 状态、尝试计数、心跳、失败详细信息

批量操作

工具 它做什么
list_batch_operations 列出批量信号/取消/终止作业
describe_batch_operation 进度、状态、成功/失败计数
stop_batch_operation 停止正在运行的批处理作业

工人部署

工具 它做什么
list_worker_deployments 列出所有版本化的worker部署
describe_worker_deployment 当前/斜坡版本、版本历史

Nexus端点

工具 它做什么
list_nexus_endpoints 列出集群中的所有Nexus端点
get_nexus_endpoint 端点目标命名空间和任务队列
create_nexus_endpoint 注册新的Nexus端点
delete_nexus_endpoint 删除Nexus端点

工作流规则

工具 它做什么
list_workflow_rules 列出匹配工作流的自动操作规则
describe_workflow_rule 规则查询、操作和创建时间
create_workflow_rule 使用可见性查询创建TERMINATE或PAUSE规则
delete_workflow_rule 删除规则

任务队列和搜索属性

工具 它做什么
describe_task_queue 活动轮询器、任务ID块
list_search_attributes 自定义和系统搜索属性

需求

  • Node.js>=18
  • 正在运行的临时服务器(本地或远程)

添加到光标

打开或创建 .cursor/mcp.json 在项目根目录中(或 ~/.cursor/mcp.json 全球):

{
  "mcpServers": {
    "temporal": {
      "command": "npx",
      "args": ["-y", "@alisaitteke/temporal-mcp"],
      "env": {
        "TEMPORAL_ADDRESS": "http://localhost:8080",
        "TEMPORAL_NAMESPACE": "default",
        "TEMPORAL_TOOLS": "essential"
      }
    }
  }
}

重新启动游标。时间工具将出现在MCP工具列表中。

添加到克劳德桌面

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "temporal": {
      "command": "npx",
      "args": ["-y", "@alisaitteke/temporal-mcp"],
      "env": {
        "TEMPORAL_ADDRESS": "http://localhost:8080",
        "TEMPORAL_NAMESPACE": "default",
        "TEMPORAL_TOOLS": "essential"
      }
    }
  }
}

重新启动克劳德桌面。

添加到克劳德代码

claude mcp add temporal \
  --command "npx" \
  --args "-y,@alisaitteke/temporal-mcp" \
  --env "TEMPORAL_ADDRESS=http://localhost:8080" \
  --env "TEMPORAL_NAMESPACE=default" \
  --env "TEMPORAL_TOOLS=essential"

环境变量

变量 必填 默认 描述
TEMPORAL_ADDRESS 是 -- 临时服务器基本URL
TEMPORAL_NAMESPACE 没有 default 所有工具的默认命名空间
TEMPORAL_API_KEY 没有 -- 经过身份验证的群集的承载令牌
TEMPORAL_TOOLS 没有 essential 工具集: essential, standard,或 all

工具层级

TEMPORAL_TOOLS # 角色
essential 11 违约。 集群+命名空间+日常工作流运行/调试(列表、描述、启动、信号、查询、取消、终止、历史)。LLM的最小工具列表。
standard 23 必要的 加上计数、暂停/取消暂停、开始信号、计划、活动、任务队列描述和搜索属性。
all 36 标准 加上批处理操作、工作部署、Nexus端点和工作流规则。
设置 工具
essential 仅(11) get_cluster_info, list_namespaces, describe_namespace, list_workflows, describe_workflow, start_workflow, signal_workflow, query_workflow, cancel_workflow, terminate_workflow, get_workflow_history
还启用了 standard (+12,23共有必要) count_workflows, pause_workflow, unpause_workflow, signal_with_start_workflow, list_schedules, describe_schedule, create_schedule, delete_schedule, list_activities, describe_activity, describe_task_queue, list_search_attributes
还启用了 all (+13,36个符合标准) list_batch_operations, describe_batch_operation, stop_batch_operation, list_worker_deployments, describe_worker_deployment, list_nexus_endpoints, get_nexus_endpoint, create_nexus_endpoint, delete_nexus_endpoint, list_workflow_rules, describe_workflow_rule, create_workflow_rule, delete_workflow_rule

结构化输出

关键工具返回人类可读的文本摘要和机器可读的文本 structuredContent JSON对象。支持MCP结构化输出的客户端(例如Claude)可以使用结构化数据进行进一步处理,而无需解析文本。

具有结构化输出的工具: get_cluster_info, list_namespaces, list_workflows, describe_workflow, count_workflows, list_schedules, list_activities.

本地开发

git clone https://github.com/alisaitteke/temporal-mcp
cd temporal-mcp
npm install
npm run build

使用本地路径而不是npx:

{
  "mcpServers": {
    "temporal": {
      "command": "node",
      "args": ["/path/to/temporal-mcp/bin/temporal-mcp.js"],
      "env": {
        "TEMPORAL_ADDRESS": "http://localhost:8080"
      }
    }
  }
}

许可证

麻省理工学院

贡献者


Ali Sait Teke

Creator & Maintainer

感谢所有帮助改进这个项目的人!