efferent-ble-simulator
Efferent は、実際の無線(Linux BlueZ)上で Bluetooth Low Energy(BLE)ペリフェラルデバイスをシミュレートします:FTMS スマートトレーナー、サイクリングパワーメーター、スピード/ケイデンスセンサー、心拍数モニター。MCP サーバー(stdio または HTTP)を公開するため、AI エージェント — および同梱の Web ダッシュボード — が実際のトレーナーを操作するかのようにシミュレーションの開始、設定、監視ができます。
機能
4 種類のデバイスタイプを実際の BLE 無線で:FTMS スマートトレーナー(0x1826)、サイクリングパワー(0x1818)、スピード/ケイデンス(0x1816)、心拍数(0x180D)
完全な FTMS コントロールポイント対応:Request Control / Start / Stop / Reset / Set Target Power / Set Resistance / Set Indoor Bike Simulation Params
動的シミュレーション:人間らしいパワー/ケイデンスの変動 + 物理ベースの速度モデル(体重、勾配、Crr、CdA)、スクリプト化された ride_script を含む 5 つのライディングシナリオ
ホットパラメータ更新:実行中にパラメータを変更 — 接続中のスマートフォンはリンクを維持し、次の notify で新しい値を受け取ります(再ペアリング不要)
名前付き設定プリセット:最大 20 個の名前付き設定を保存 / 読み込み / リネーム / 削除。MCP とダッシュボードで共有
エージェント向け 17 の MCP ツール:制御、設定、設定プリセット、インタラクションルール、セッション、ログ、ライブデバイス状態、バージョン
Web ダッシュボード(React + shadcn/ui):ステータス、フォーム、ワンクリックライドテンプレート、インタラクションルール、セッション/設定管理、ライブログサイドパネル
Docker Compose ワンコマンドデプロイ(MCP + ダッシュボード + Skill ファイルを HTTP で配信)、ヘルスチェック付きの長時間実行
バージョン管理:MCP
serverInfo.version+ble_get_versionでエージェントがアップデートを検出可能
Related MCP server: pyBTMCP
実行環境
要件 | 詳細 |
OS | Linux のみ — シミュレーターはホストの BlueZ を D-Bus 経由で駆動します |
BlueZ | ≥ 5.87(5.86 にはアドバタイズ登録のバグがあります) |
ハードウェア | 実際にブロードキャストするには BLE 対応アダプター(内蔵または USB ドングル)が必要です |
D-Bus ポリシー |
|
Docker | mcp コンテナはホストの D-Bus ソケットをマウントします。BLE 無線は常にホスト側にあります |
非対応 | macOS / Windows はネイティブ非対応(別の BLE スタックが必要)。BLE アダプターがない場合、MCP サービスは動作しますが送信は行われません |
アーキテクチャ
┌──────────────┐ MCP protocol ┌───────────────────────────┐
│ AI Agent / │ ◄───────────────► │ MCP Server (HTTP :3300) │
│ MCP Client │ stdio / :3300 │ Web Dashboard (:3330) │
│ (Claude, │ └────────────┬──────────────┘
│ Codex, pi) │ │ BlueZ D-Bus (system bus)
└──────────────┘ ▼
┌───────────────────────────┐
│ Host Linux BlueZ │
│ bluetoothd + BLE adapter │
│ (D-Bus policy, ≥ 5.87) │
└────────────┬──────────────┘
│ HCI / radio
▼
┌───────────────────────────┐
│ BLE advertisement + GATT │
│ FTMS / Power / CSC / HR │
└────────────┬──────────────┘
│
┌────────────▼──────────────┐
│ Phone / Cycling App │
│ (Zwift, Garmin, Strava...)│
└───────────────────────────┘デバイスタイプ
タイプ | BLE サービス | 特性 |
FTMS スマートトレーナー | 0x1826 | FM Feature、Indoor Bike Data(notify)、Control Point(write/indicate)、Status、Resistance/Power 範囲 |
サイクリングパワー | 0x1818 | パワー/ケイデンス測定、ホイール & クランクデータ |
スピード/ケイデンス(CSC) | 0x1816 | ホイール & クランク回転カウンター |
心拍数 | 0x180D | HR 測定、ボディセンサー位置、バッテリー |
クイックスタート
前提条件
BlueZ ≥ 5.87(bluetoothd)と BLE 対応アダプターを備えた Linux
BlueZ 5.86 にはアドバタイズ登録のバグがあります。厳格な MGMT 検証を行うカーネルでは、すべての
RegisterAdvertisementが失敗します。先にアップグレードしてください:sudo pacman -S bluez && sudo systemctl restart bluetooth(Arch)/sudo apt install bluez(Debian)。Node.js ≥ 18
1. ネイティブインストール
npm install
npm run setup # sudo — installs D-Bus policy, enables bluetoothd, verifies GATT
npm run build
npm run start:http # HTTP mode on :3300 (or npm start for stdio)npm run setup は /etc/dbus-1/system.d/ble-simulator.conf を書き込みます — 非 root での GATT 登録に必須です(これがないとデバイスはアドバタイズしますが、接続できません)。
2. Docker Compose(サーバー推奨)
bash scripts/docker-up.sh # host prep (sudo, once) + build + startURL | 用途 |
| MCP エンドポイント |
| Web ダッシュボード |
| 操作スキル(エージェント用) |
| ダッシュボードヘルプページ |
コンパイル不要のビルド(better-sqlite3 プリビルドバイナリ)。制限付きネットワークではミラーを使用:
NPM_REGISTRY=https://registry.npmmirror.com \
BETTER_SQLITE3_BINARY_HOST_MIRROR=https://registry.npmmirror.com/-/binary/better-sqlite3 \
bash scripts/docker-up.sh管理:bash scripts/docker-up.sh status|logs|down
MCP ツール(17)
ツール | 用途 |
| シミュレーションの開始 / 停止 / 再起動 |
| コントローラー状態 + アクティブ設定 + ライブデバイス状態(フェーズ/パワー/ケイデンス/心拍数) |
| 設定の更新 — 同じデバイスタイプで実行中ならその場でホット更新 |
| 現在/最新の設定を JSON で取得(フォームのバックフィル用) |
| 現在のパラメータを名前付きプリセットとして保存(最大 20) |
| 保存済みプリセットの一覧 / 表示 |
| プリセットのリネーム / 削除 |
| カスタム BLE 書き込み応答ルール |
| セッション履歴 / 詳細 |
| 永続的な通信ログ(接続/書き込み/notify/エラー) |
| MCP + Skill のバージョン、変更履歴、Skill URL(アップデート検出用) |
例
{
"method": "tools/call",
"params": {
"name": "ble_start",
"arguments": {
"deviceType": "ftms",
"ftms": { "simulation": { "enabled": true, "scenario": { "type": "ride_script" } } }
}
}
}動的シミュレーション
FTMS / CyclingPower / CSC で simulation を有効化:
"simulation": {
"enabled": true,
"riderWeightKg": 75, "bikeWeightKg": 8, "crr": 0.004, "cdA": 0.35,
"fatigueFactor": 0.0005, "cadenceCoupling": "proportional", "microPauseProbability": 0.008,
"autoStart": true,
"scenario": { "type": "ride_script" }
}パラメータ | デフォルト | 説明 |
|
| マスタースイッチ |
| 75 / 8 | 速度物理(ライダー+バイク質量) |
| 0.004 / 0.35 | 転がり抵抗 / 空気抵抗面積 |
| 0 | 1 分あたりのパワー減衰(0 = なし) |
|
|
|
| 0.005 | ティックごとの惰性走行ポーズ |
|
| アプリが Start を送らなくても走行開始 |
|
| ライディングシナリオ(下記) |
シナリオ
steady— 自然な微小変動のみfreeride(デフォルト)— 基本パワーが 60〜180 秒ごとに ±20% 変動intervals— 高/低パワーの交互warmup_main_cooldown— ウォームアップ → メイン → クールダウンride_script— スクリプト化されたライド:一連のライディングアクション(start / cruise / climb / sprint / coast / stop)。各アクションに目標パワー、勾配、任意のケイデンスを指定。自動開始、repeat: trueでループ、stopでパワー/ケイデンス/速度をゼロに。phasesを省略すると組み込みのデフォルトスクリプトを使用。
ホット更新と安定シリアル
ホット更新:実行中に
ble_configure+ 同じデバイスタイプでパラメータをその場で適用 — 接続中のスマートフォンはリンクを維持し、次の notify で更新された値を受け取ります。デバイスタイプの変更は再起動が必要です(新しいシリアルにより再検出が強制されます)。安定シリアル:
SIM_SERIAL_STABLE=1で、同じタイプのセッション間でシリアルを安定させます(SIM001-FTMS)。これにより、スマートフォンは停止/開始後もデバイスを忘れることなく再接続できます。
環境変数
変数 | デフォルト | 説明 |
|
|
|
|
| HTTP リッスンアドレス |
|
| アドバタイズ名のプレフィックス |
| — | デバイス名のインスタンス ID モード |
| 未設定 |
|
|
| 公開 Skill URL( |
ソース構成
src/
├── index.ts # entry, lifecycle
├── mcp-server.ts # 17 MCP tool definitions & handlers
├── ble-controller.ts # BlueZ D-Bus lifecycle, advertisement, hot-update
├── database.ts # SQLite layer (sessions / saved_configs / logs)
├── config.ts # config merge & defaults
├── version.ts # version single-source
├── simulator.ts # HeartRate / Battery simulators
├── cycling-simulator.ts # power/cadence simulators + physics + ride_script engine
└── devices/ # heart-rate / cycling-power / csc / ftms GATT devicesBLE ペリフェラルアクセスはホストの BlueZ D-Bus 経由で実行されます(コンテナはホストの D-Bus ソケットをマウント)。設計記録は docs/design/*.md を参照してください。
ライセンス
MIT © BLE Simulator Contributors
This server cannot be installed
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
- AlicenseNot gradedqualityCmaintenanceBluetooth Low Energy (BLE) MCP server that allows AI agents to scan, connect to and communicated with BLE devices, as well as simulate BLE perhipherals.15BSD 2-Clause "Simplified"
- FlicenseNot gradedqualityNot gradedmaintenanceA BLE fitness device simulator that enables AI agents to control simulated heart rate monitors, treadmills, and cycling trainers via the Model Context Protocol. It integrates ESP32 firmware, an MQTT broker, and a FastAPI backend for comprehensive device management and real-time interaction.
- AlicenseAqualityCmaintenanceA stateful Bluetooth Low Energy (BLE) MCP server that enables AI agents to scan, connect, read/write characteristics, and subscribe to notifications on BLE devices.3517MIT
- FlicenseNot gradedqualityBmaintenanceExposes Garmin Connect data and workout management to AI agents, supporting tools, resources, and prompts for health data, workout creation, and coaching workflows.1
Related MCP Connectors
Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
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/dncore/efferent-ble-simulator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server