MCP硬件控制服务
Version: 1.0.0 (Beta) 对接硬件厂商: 秒控科技(www.wsdxyz.cn)
目的
通过标准化控制协议(MCP)实现对秒控科技硬件设备的远程操控,主要功能包括:
- 触摸屏可视化界面控制
- PLC开关控制器指令执行
- 设备操作数据追溯
支持范围
设备类型
| 设备类型 | 固件版本要求 | 协议支持 |
|---|---|---|
| 秒控触摸屏 | V2.3+ | MCP/WebSocket |
| 秒控PLC开关控制器 | V1.7+ | Modbus RTU |
功能矩阵
触摸屏操作
✅ 切换屏幕页面(通过ScreenID)
✅ 输入数值型控件数据(范围校验)
✅ 输入字符串型控件(长度≤128字符)
✅ 获取当前屏幕控件状态
⏳ 多语言切换(开发中)
PLC开关控制器操作
✅ 执行预设动作序列(需预编程)
✅ 实时读取端口状态(DI/DO)
✅ 获取设备动作日志(时间倒序)
✅ 发送Modbus指令(04/06功能码)
⏳ 自定义动作编排(开发中)
使用准备
1. 获取API密钥
# 从秒控科技获取认证密钥(必填项)
from mcp import MCPClient
client = MCPClient(
api_key="your_license_key", # 联系吴工 13961653399 申请
endpoint="https://api.wsdxyz.cn/v1"
)
2. 设备鉴权
# 自动绑定账号下所有设备(需有效API Key)
devices = client.get_devices()
print(f"已授权设备: {[d['sn'] for d in devices]}")
快速开始
触摸屏基础操作
# 切换到指定屏幕(ScreenID范围 1000-9999)
result = client.operate_device(
device_sn="TP-7XG-001",
command="screen.switch",
params={"screen_id": 1002}
)
# 向数值控件写入数据(控件ID需预配置)
client.operate_device(
device_sn="TP-7XG-001",
command="control.set_value",
params={
"control_id": "num_input_1",
"value": 37.5,
"data_type": "float"
}
)
PLC控制器操作
# 执行预设动作(动作ID由PLC编程定义)
client.operate_device(
device_sn="PLC-DC48-003",
command="action.start",
params={"action_id": "SEQ_POWER_ON"}
)
# 读取端口状态(port_range格式:0-15)
status = client.get_device_status(
device_sn="PLC-DC48-003",
data_type="io_status",
params={"port_range": "0-7"}
)
详细操作说明
设备数据获取
# 获取时间范围数据(ISO8601时间格式)
history = client.get_history_data(
device_sn="TP-7XG-001",
start_time="2024-03-01T08:00:00+08:00",
end_time="2024-03-01T18:00:00+08:00",
data_type="operation_log" # 支持:status_log/operation_log/error_log
)
用户会话管理
# 切换账号(需重新验证API Key)
client.switch_user(new_api_key="new_license_key") # ⚠️ 将清除当前设备缓存
附录
错误代码表
错误码 说明 处理建议
401 API Key无效 检查密钥或联系厂商更新
428 控件ID不存在 验证设备工程文件中的控件定义
503 设备离线 检查设备网络连接状态
409 动作序列冲突 停止当前动作后重试
技术支持
接口文档:https://api.wsdxyz.cn/docs
紧急联系:吴工 13961653399(微信同号)
问题反馈邮箱:support@wsdxyz.cn
版权声明
本系统接口规范归秒控科技所有,未经授权不得用于商业集成开发。
Metadata
Release files for mcp-miaokong-WSD 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_miaokong_wsd-0.1.0.tar.gz | 4.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_miaokong_wsd-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / mcp_miaokong_wsd-0.1.0.tar.gz
| Download URL | mcp_miaokong_wsd-0.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7406567dd888b098165b78ff68a73888459b147b4a06663b1b9b77ebc7f3446f
|
|
BLAKE2b-256 checksum How to use checksums |
93cf3dd94557cf5fd8a028b367936073177895dead10639e13752e76288a611b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / mcp_miaokong_wsd-0.1.0-py3-none-any.whl
| Download URL | mcp_miaokong_wsd-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6974f2f2a256e9e991fb13868933eb44b25a49e22d7005faceb3e9e62f3fb076
|
|
BLAKE2b-256 checksum How to use checksums |
99a1137b695b611d1a65b531c7d23aabb7c2c9738f827d5e586cd7c5a3edf5e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Security for mcp-miaokong-WSD 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.