
本仓库的目的是展示利用时间构建“人机环圈”的MCP服务器持久工具是多么容易
概览
- Python3+ - uv (curl -LsSf https://astral.sh/uv/install.sh | sh) - Temporal Local setup Guide - 桌面版 Claude 与其手动启动服务器和工作器,不如用 boot-demo.sh helper 脚本在 tmux 会话中启动它们: - 如果成功,你会在“搜索与工具”下看到invoice_processor 使用你的MCP客户端(例如Claude Desktop)调用触发器、批准、拒绝和状态工具。触发工具现在返回启动工作流的workflow_id和run_id。将这些值传递给批准、拒绝和状态工具。样本发票的样本//状态处于样本//invoice_acme.json。检查时序网 http://localhost:8233. 随时终止并重启工作者以观察确定性重放。 Claude + MCP 可以向流程流程发送输入和更新,比如审批,甚至可以执行多种操作的组合——所有这些都是代理方式,如果你要求它,可以用人工类比解释发生了什么: 1.
概述(AI 翻译)
视频:
先修条件:
- Python3+
uv(卷曲 -LsSf https://astral.sh/uv/install.sh | sh)- 时间局部设置指南
- 桌面版 Claude
1.克隆与安装
2.本地发射时间
3.启动工蜂
快速演示启动
你不用手动启动服务器和工作器,而是用
tmux 会话使用 boot-demo.sh 辅助脚本:
Claude 桌面指令(十四行诗)
1.请按照上面的步骤1-3操作
2.编辑你的Claude配置(Claude >设置>开发者>编辑配置)
3.编辑配置后重启Claude桌面版
- 如果成功,你会在“搜索与工具”中看到
invoice_processor
4.要开始处理模拟发票,请执行:
使用你的MCP客户端(例如Claude Desktop)调用trigger、approve,
reject和status工具。trigger工具现在返回了两个
workflow_id 和 run_id 的启动工作流。将这些值传递给
approve、reject和status工具。样本发票存放于
samples/invoice_acme.json。检查时间网于http://localhost:8233。
随时杀死并重启工作者以观察确定性重放。
5.选举结果
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Invoice Demo with Temporal + MCP
Video:
Prerequisites:
- Python3+
uv(curl -LsSf https://astral.sh/uv/install.sh | sh)- Temporal Local Setup Guide
- Claude for Desktop
1. Clone & install
git clone https://github.com/your-org/temporal-mcp-invoice-demo.git
cd temporal-mcp-invoice-demo
uv venv
source .venv/bin/activate
uv pip install temporalio fastmcp
2. Launch Temporal locally
temporal server start-dev
3. Start the worker
python worker.py [--fail-validate] [--fail-payment]
Quick demo boot
Instead of starting the server and worker manually you can launch them in a
tmux session using the boot-demo.sh helper script:
./boot-demo.sh
Claude for Desktop Instructions (Sonnet 4)
1. Follow steps 1-3 above
2. Edit your Claude Config (Claude > Settings > Developer > Edit Config)
{
"mcpServers": {
"invoice_processor": {
"command": "/Path/To/Your/Install/Of/uv",
"args": [
"--directory",
"/Path/To/temporal-invoice-mcp",
"run",
"server.py"
]
}
}
}
3. Restart Claude for Desktop after editing your config
- If successful you’ll see
invoice_processorunder ‘Search & Tools’
4. To kick off processing the mock invoice, run:
trigger
Use your MCP client (e.g., Claude Desktop) to call the trigger, approve,
reject, and status tools. The trigger tool now returns both the
workflow_id and run_id of the started workflow. Pass these values to the
approve, reject, and status tools. The sample invoice lives at
samples/invoice_acme.json. Inspect Temporal Web at http://localhost:8233.
Kill and restart the worker at any time to observe deterministic replay.
5. Results
Claude submits the invoice workflow:
It can get status:
Claude + MCP can send inputs and updates to the process workflow such as approvals, or even do a combination of actions - all agentically, explaining in human analogies what’s going on if you ask it to:
What’s Cool About This:
- Agents and applications connected by MCP can provide a powerful way for humans to interact with processes and applications
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"invoice_processor": {
"command": "/Path/To/Your/Install/Of/uv",
"args": [
"--directory",
"/Path/To/temporal-invoice-mcp",
"run",
"server.py"
]
}
}
}