网易春风 · 心跳元力 MCP
Locally control a DokiDoki DK-META2 BLE device through MCP tools for vibration, linear extension, and rotation, with connection/status management and safety stops.
Scan and list nearby supported heartbeat-yuanli BLE devices (
list_devices).Connect by name or address and discover GATT capabilities (
connect_device).Read MCP-owned connection/profile/GATT status (
get_device_status).Set vibration intensity 0–100; non-zero requires
confirm=true(set_vibration).Set linear extension intensity 0–100; non-zero requires
confirm=true(set_linear).Set rotation intensity 0–100; non-zero requires
confirm=true(set_rotary).Zero all supported outputs; repeatable (
stop_device).Stop heartbeat, zero outputs, and disconnect the BLE connection (
disconnect_device).No arbitrary GATT characteristic/command/raw hex writes, no account/cloud control, and only DK-META2 is verified.
Enables local Bluetooth Low Energy (BLE) communication with DokiDoki DK-META2 devices, allowing control of vibration, linear extension, and rotation through GATT characteristic writes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@网易春风 · 心跳元力 MCP scan for my DK-META2, connect, and start vibration at 20"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
chunfeng-yuanli-ai-mcp — 心跳元力 DokiDoki DK-META2 本地 BLE MCP 控制
chunfeng-yuanli-ai-mcp 是一个本地 Bluetooth Low Energy(BLE)MCP 服务器,让 AI Agent 通过自然语言控制心跳元力 DokiDoki DK-META2 设备的震动、伸缩与旋转。
这是一个非官方、本地优先的 MCP 实现,主打隐私、低延迟和可控的设备操作。
本项目是非官方实现,不读取账号、不调用云端控制接口,也不包含官方客户端源码、安装包或设备固件。DokiDoki、心跳元力及相关名称归其各自权利人所有;本项目与设备厂商没有隶属或背书关系。
状态:实验性项目。协议和设备行为来自对客户端通信行为的观察,使用前请在场确认设备状态,并保留实体停止方式。
工作原理
MCP 只是 AI 客户端与本地工具之间的调用协议,真正的设备通信链路如下:
MCP 客户端
│ JSON-RPC / stdio
▼
heartbeat_yuanli_mcp.server
│ 工具参数校验与生命周期管理
▼
DokiDokiDeviceManager
│ Bleak
▼
Windows Bluetooth LE
│ GATT service/characteristic 写入
▼
DK-META2当前只实现 DK-META2 profile:
能力 | 命令码 |
震动 |
|
伸缩 |
|
旋转 |
|
Related MCP server: VectorClaw
要求
Python 3.11 或更高版本;
支持 BLE 的操作系统,Windows 是当前主要验证环境;
系统蓝牙已开启,设备没有被官方客户端或其他程序独占;
对应系统账户具有蓝牙扫描和连接权限。
安装
git clone https://github.com/vmayfuture/chunfeng-yuanli-ai-mcp.git
cd chunfeng-yuanli-ai-mcp
py -3.11 -m venv .venv
& .\.venv\Scripts\python.exe -m pip install -e .检查运行环境和附近支持的设备:
& .\.venv\Scripts\python.exe -m heartbeat_yuanli_mcp.server --doctor启动 MCP 服务
标准 MCP 客户端需要启动以下命令,并通过 stdio 与其通信:
python -m heartbeat_yuanli_mcp.server也可以使用安装后的入口命令:
heartbeat-yuanli-mcp配置示例见 mcp-config.example.json。如果需要固定设备,可以通过环境变量设置自己的设备名或蓝牙地址;公开仓库不会保存真实设备地址。
MCP 工具
工具 | 作用 |
| 扫描并列出支持的 BLE 设备,不发送动作 |
| 连接设备并发现 GATT 能力 |
| 查看 MCP 自己持有的连接状态 |
| 设置震动强度,范围 |
| 设置伸缩强度,范围 |
| 设置旋转强度,范围 |
| 将所有已支持输出归零 |
| 停止心跳、归零输出并断开连接 |
典型调用顺序:
list_devices
connect_device
set_vibration(level=20, confirm=true)
set_linear(level=20, confirm=true)
set_rotary(level=20, confirm=true)
stop_device
disconnect_device非零动作必须显式传入 confirm=true。确认参数只是本地安全门槛,不是设备的蓝牙认证机制。当前 MCP 不提供任意特征、任意命令码或原始十六进制写入工具。
BLE 协议概览
设备使用以下 GATT 能力:
Service: 0000ffac-0000-1000-8000-00805f9b34fb
Write with response: ffb5
Write without response: ffb7
Notify: ffb8一个普通控制帧为:
[message_id] [0x02] [0x00] [length] [command] [value] [checksum]例如震动强度 20:
01 02 00 03 08 14 E4其中 0x14 是十进制 20,校验和只覆盖 [command, value]:
checksum = (-(command + value)) & 0xFF完整说明见 docs/protocol.md。
安全与已知限制
连接成功后每两秒发送一次心跳;心跳或写入失败时会尝试停止输出并断开;
MCP 退出、显式断开和停止操作都会尝试把支持的输出归零;
官方心跳元力客户端和 MCP 不应同时持有同一个 GATT 连接。连接失败时先在官方客户端中断开设备;
当前只验证
DK-META2。虽然扫描器识别若干TF-、DK-、TRYFUN-前缀,但其他型号不会因为名称匹配就自动获得兼容性;BLE 连接本身依赖操作系统权限和设备固件行为,本项目不实现厂商账号认证、加密配对或云端授权;
协议层当前按单动作发送一帧,快速连续调用没有额外的 120ms 应用层节流。需要高频控制时请先在实际设备上验证稳定性。
请勿在无人看护、无法快速停止或不清楚设备当前状态时运行非零动作。
开发与测试
& .\.venv\Scripts\python.exe -m unittest discover -s tests -v协议构造函数是纯函数,可以在没有蓝牙设备的环境中测试。实机测试应从低强度开始,并先验证 stop_device。
许可证
本项目使用 MIT License,见 LICENSE。依赖包各自遵循其上游许可证。
贡献
提交问题或改动前请阅读 CONTRIBUTING.md。涉及安全、设备异常动作或潜在隐私泄露的问题,请优先阅读 SECURITY.md。
使用场景与常见问题
下面是调用示例,不是实机测试记录。先在设备旁检查连接与停止功能:
请使用 heartbeat-yuanli 扫描支持的设备,只报告列表,不发送动作。连接我明确选定的 DK-META2,查看连接状态,先验证 stop_device,再断开。支持其他型号吗? 当前只验证 DK-META2,前缀匹配不能证明兼容。
状态证明实际输出吗? 状态只表示 MCP 持有的连接,不能替代在场观察。
连接失败怎么办? 检查蓝牙权限、距离、电量,释放官方客户端连接,再运行
--doctor。
Available Tools
8 toolsconnect_deviceC
连接指定的心跳元力 BLE 设备并发现 GATT 能力。
Inputs: name, address. Returns: object
disconnect_deviceA
停止心跳并断开 MCP 持有的 BLE 连接。
Inputs: no named parameters. Returns: object
get_device_statusB
读取 MCP 自己持有的设备连接、profile 和 GATT 状态。
Inputs: no named parameters. Returns: object
list_devicesC
扫描并列出附近已知的心跳元力 BLE 设备。
Inputs: prefix, timeout. Returns: object
set_linearB
设置 DK-META2 伸缩强度;非零值必须 confirm=true。
Inputs: level (required), confirm. Returns: object
set_rotaryB
设置 DK-META2 旋转强度;非零值必须 confirm=true。
Inputs: level (required), confirm. Returns: object
set_vibrationC
设置 DK-META2 振动强度;非零值必须 confirm=true。
Inputs: level (required), confirm. Returns: object
stop_deviceA
将当前设备所有已支持输出归零;可重复调用。
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a distinct role across the BLE lifecycle: discovery, connection, status, modality-specific output control, stopping outputs, and disconnection. The three set_* tools are clearly separated by vibration, linear, and rotary outputs, while stop_device and disconnect_device are distinguishable by scope.
All tool names use consistent snake_case with verb_noun or verb_noun_noun structure. list_devices, connect_device, get_device_status, set_vibration, set_linear, set_rotary, stop_device, and disconnect_device follow the same predictable convention.
Eight tools are well-scoped for a BLE device control server. The set covers discovery, connection management, status inspection, three independent output modes, emergency stop, and disconnect without unnecessary bloat.
The surface covers the core device control lifecycle and operation modes well. Minor gaps remain around reading current output intensities or device telemetry such as battery/firmware, but agents can complete the main workflows.
Maintenance
Related MCP Connectors
Turns a phone into a camera+Bluetooth remote so AI assistants can see and control any PC.
Drive real Android & iOS devices and web browsers from natural language for mobile + web QA. 290+ tools across device control, app management, automation sessions, browser automation, and flow recording / replay. Bearer-auth — get a token at robotactions.com → Profile → API Tokens.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each device’s supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables communication with G1 Bluetooth devices using the Nordic UART protocol over BLE. Supports device discovery, connection management, and message exchange for G1 audio devices through natural language commands.52MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to control Anki Vector robots locally via natural language, providing tools for speech, motion, perception, and interaction without cloud dependency.2421MIT
- AlicenseAqualityFmaintenanceLets AI assistants control the physical Return to Dark Tower board game tower via Bluetooth, enabling connection, calibration, sound, lights, drum rotation, seal breaking, and game sequences through natural language.3435 npmMIT
- FlicenseNot gradedqualityDmaintenanceMCP server for controlling BLE-enabled adult toys from XHTKJ and 醉清风 mini-programs, enabling strength, mode, and custom waveform control via natural language.10-