digital-twin-mcp
digital-twin-mcp
把数字孪生场景中的设备数据能力打包成 MCP 工具——任何 MCP 客户端(WorkBuddy、Claude Desktop、Cursor 等)都能直接查询设备状态、读取实时指标、拉取时序数据、检查告警。
数字管道的建筑师 · 第二块积木:设备监控管道 第一块积木:https://github.com/xici001/workflow-templates(AI 自动化工作流模板)
它能做什么
工具 | 说明 |
| 列出场景内所有设备(类型 / 位置) |
| 读取设备实时指标(模拟 PLC 轮询) |
| 读取某指标最近时序数据(供趋势图 / 3D 可视化) |
| 写入设备参数(模拟 PLC 写值 / 故障注入测试) |
| 阈值告警检查(warning / critical 分级) |
资源 | 说明 |
| 设备台账:元数据 + 指标量程与告警阈值 |
| 3D 场景布局:设备世界坐标(Three.js / Unity 直接叠加) |
提示词 | 说明 |
| 生成指定设备的健康报告 |
Related MCP server: MCP PLC Core
架构
MCP 客户端(WorkBuddy / Claude Desktop / ...)
│ stdio 或 streamable-http
┌───────▼───────────────┐
│ server.py (FastMCP) │ ← 工具 / 资源 / 提示词定义
└───────┬───────────────┘
│
┌───────▼───────────────┐
│ alerts.py │ 告警规则引擎(阈值分级)
│ device_registry.py │ 设备台账 + 指标配置 + 3D 坐标
│ simulator.py │ PLC 数据驱动(BasePLCDriver 接口)
└───────────────────────┘v0 数据源为模拟 PLC 驱动(固定随机种子、可复现;注塑机温度故意贴近阈值上漂,方便演示告警升级)。
接真实设备时继承
BasePLCDriver实现read_metrics/write_value(OPC-UA / Modbus / 网关 API 皆可),Server 层零改动。
快速开始
pip install -e .
# 方式一:stdio 传输(MCP 客户端默认)
python -m digital_twin_mcp.server
# 方式二:streamable-http 传输
python -m digital_twin_mcp.server --transport streamable-http端到端测试(启动 server 子进程并通过 stdio 协议调用):
python examples/client_test.py接入 WorkBuddy
把 examples/workbuddy_mcp.json 的内容合并到 C:\Users\33033\.workbuddy\mcp.json 的 mcpServers 中,然后在连接器管理页右上角的自定义连接器入口对 digital-twin-mcp 点击「信任」启用。
与 workflow-templates 的关系
同一个"数字管道"品牌下的两块积木:
workflow-templates:把脑力劳动(财报分析等)打包成工作流digital-twin-mcp:把设备数据能力(数字孪生 / PLC)打包成 MCP 工具
两者未来可组合:工作流模板的「设备健康报告」等模板,可直接调用本 MCP 的工具获取真实数据。
路线图
v0.1:模拟 PLC + 5 个工具 + 2 个资源 + 1 个提示词(当前)
v0.2:OPC-UA 真实接入、时序数据落库(SQLite/InfluxDB)、WebSocket 推送
v0.3:3D 场景联动(场景布局资源对接 Three.js 渲染)、多工厂实例
许可
MIT License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for PTC ThingWorx, the IIoT platform, providing 8 tools for AI agents to read live state and trigger actions across the industrial asset graph with env-gated safety for writes and invocations.8MIT
- FlicenseBqualityBmaintenanceUniversal MCP server for industrial PLC communication, enabling AI agents to read sensors, alarms, status, setpoints, and write setpoints via adapters for Modbus, S7, or custom PLCs.6
- AlicenseBqualityAmaintenanceExposes a deterministic IoT edge runtime — Modbus/CAN/J1939 acquisition, local rules, alarms, and history — to AI assistants as typed, governed MCP tools. Reads are safe by default; device control stays deny-by-default, explicitly confirmed, and audited.233Apache 2.0
- AlicenseAqualityBmaintenanceExposes live industrial IoT telemetry to any MCP client, streaming simulated sensor data from a fleet of machines and detecting anomalies, with the ability to inject faults on demand.4MIT
Related MCP Connectors
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Operator-as-agent MCP hub. 6 tools. First $5 free, then $0.001/call.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xici001/digital-twin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server