rei-lads-mcp
rei-lads-mcp
⚠️ v0.1.0-preview — 早期フィードバック向けリリース。本番利用は想定していません。 API は v1.0.0 より前では安定していません。破壊的変更は 0.x のどのバージョンでも発生する可能性があります。 0.1.x 系では、X.509 証明書認証はサポートされていません (ユーザー名/パスワードのみ)。Phase 5 の項目については ROADMAP.md を参照してください。
この MCP サーバーは、OPC UA LADS(Laboratory Agnostic Device Standard)の機器を LLM エージェントに公開します。2 つの Rei ネイティブな規律が組み込まれています:
承認ゲート付き実行 — 状態を変更するすべてのツールは、操作名をサーバーが宣言した enum(LADS ステートマシンのメソッド、プログラムテンプレート)に対して検証します。任意の文字列は、ネットワーク呼び出しが行われる前に、MCP 境界で拒否されます。
証跡付き来歴 — 状態を変更するすべての呼び出しは、SHA-256 レコード(イニシエータ、ノード、操作、パラメータ、サンプル、タイムスタンプ)を生成し、ローカルの追記専用 JSONL に永続化します。プレフィックスで取得可能です。
LADS リファレンス実装である opcua-lads をモデルとし、Rei / D-FUMT の承認ゲート + witnessed by 設計に基づいています。
インストール
Python 3.12+ が必要です。
python -m venv .venv
./.venv/bin/pip install -r requirements.txt # Linux/macOS
./.venv/Scripts/pip install -r requirements.txt # WindowsRelated MCP server: opcua-mcp
クイックスタート
LADS リファレンスサーバー(たとえば opcua-lads/lads-server-collection の lads-viscometer)を起動し、次を実行します:
python server.pyこれで stdio MCP サーバーが起動します。任意の MCP クライアントをこのサーバーに接続できます。
プログラムによる健全性チェック(MCP クライアント不要):
python test_tools_list.py # 15 tools registered, schemas generated
python test_live_phase4.py # end-to-end against a running LADS server on
# opc.tcp://localhost:4840ツール(15)
接続
lads_connect(alias, server_url, user?, password?, wait_timeout_s?, cert_path?, key_path?)lads_register_alias(alias, server_url, description?, user?, password?)lads_list_aliases()lads_connect_by_alias(alias, wait_timeout_s?)
ディスカバリ(読み取り専用)
lads_list_devices(alias)lads_get_functional_units(alias, device_index)lads_get_sensor_value(alias, device_index, unit_index, function_index)lads_get_state(alias, device_index, unit_index)lads_get_state_machine_methods(alias, device_index, unit_index)lads_list_program_templates(alias, device_index, unit_index)lads_list_results(alias, device_index, unit_index)
状態変更(証跡レコードを生成)
lads_call_state_machine_method(alias, device_index, unit_index, method_name)— サーバーが宣言したインベントリに対して method_name を検証しますlads_start_program(alias, device_index, unit_index, template_name, properties?, samples?, supervisory_job_id?, supervisory_task_id?)— ProgramManager のテンプレートに対して template_name を検証します
証跡の取得
lads_list_witness_recent(limit?)lads_show_witness(sha256_prefix)— 最小 4 文字
承認ゲートのデモ
lads_call_state_machine_method(alias, 0, 0, "Start")
# -> {invocation: "queued (async)", witness_hash: "..."}
lads_call_state_machine_method(alias, 0, 0, "ArbitraryExec")
# -> {error: "method 'ArbitraryExec' not declared by this state machine",
# valid_methods: ["Start", "StartProgram", "Stop"]}拒否は MCP ツール境界で発生します。LADS サーバーが宣言していない操作名に対しては、OPC UA 呼び出しは一切発行されません。lads_start_program(template_name=...) も同じパターンです。
証跡付き来歴
状態を変更するすべてのツール呼び出しは、次のようなレコードを生成します:
{
"initiator": "mcp-caller",
"node_alias": "viscometer",
"server_url": "opc.tcp://localhost:4840",
"device_browse_name": "myViscometer",
"unit_browse_name": "ViscometerUnit",
"operation": "StartProgram",
"template_name": "Analytical Method A (30rpm)",
"params": {"Speed": "30", "Duration": "60"},
"sample_context": [{"ContainerId": "vial-01", "SampleId": "sample-a",
"Position": "A1", "CustomData": "phase4-test"}],
"timestamp_utc": "2026-08-26T00:23:54.333266+00:00",
"phase": "accepted",
"sha256_hex": "174b5e1498a5d0cca55ce9291adf95f612161ed590b839258e700e994cba25ae"
}~/.rei-lads/witness/YYYY-MM.jsonl に永続化されます(環境変数 REI_LADS_WITNESS_DIR で上書き可能)。SHA-256 プレフィックスで、lads_*_witness_* の 2 つのツールから取得できます。
関連プロジェクト
opcua-lads/lads-server-collection— LADS リファレンス OPC UA サーバー(Viscometer / pH-Meter / Balance / Freezer / FT-NIR)opcua-lads/lads-client-py— このブリッジがラップする Python クライアントTECTOS-JP/lab-visa-mcp— PyVISA 制御の機器向けの姉妹 MCPfc0web/rei-lang— このブリッジがその規律を実装する Rei 言語プロジェクトRei-Certified program(ドラフト)— このブリッジが G1 パイロットの候補となるコンプライアンス面
プレビュー状況
Phase 1-4 のスパイク完了 — 15 ツール、実稼働中の LADS 粘度計シミュレータに対して L2 と L3 の両方がグリーン
コードに反映済みの Phase 4 修正: インポート時のバナー出力の抑制、
Connection.initializedのポーリング、QualifiedNameのアンラップPhase 5 は未実装 — ROADMAP.md を参照
API の安定性: v1.0.0 までは保証されません — 0.x では破壊的変更を想定してください
完全なスパイク履歴は、記録として SPIKE-HISTORY.md に保存されています。
ライセンス
MIT — LICENSE を参照してください。LADS エコシステムの慣例です。
コントリビューション
CONTRIBUTING.md を参照してください。Rei プロジェクトの CLA が確定次第、外部コントリビューターには署名済み CLA が必要になります。
This server cannot be deployed
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Runtime permission, approval, and audit layer for AI agent tool execution.
Context and control for any AI. Agent identity, scoped access, and proof across tools.
Supervised API-write gateway for AI agents with policy, human approval and execution receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects AI agents to OPC UA-enabled industrial systems for real-time monitoring and control of operational data. It enables users to read, write, and browse industrial device nodes through natural language interactions.MIT
- AlicenseNot gradedqualityBmaintenanceEnables LLMs to read, write, browse, search, and subscribe to live data on OPC-UA industrial automation servers, with caching, discovery index, and support for stdio or HTTP transports.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, browse, read, search, and safely write OPC UA industrial device data within controlled edge networks, with guarded two-phase writes and evidence-based root-cause diagnostics.1Apache 2.0
- AlicenseAqualityBmaintenanceEnables LLM agents to safely inspect, plan, preview, and execute motions on ROS 2 manipulators, with server-enforced safety envelopes covering joint limits, workspace constraints, force/torque thresholds, rate limits, e-stop, human approval, and audit logging.2297 PyPIApache 2.0