Skip to main content
Glama
rei-lads-mcp

rei-lads-mcp

by fc0web

rei-lads-mcp

⚠️ v0.1.0-preview — 초기 피드백 릴리스. 프로덕션용이 아님. API는 v1.0.0 이전에는 안정적이지 않습니다. 0.x 버전에서는 호환되지 않는 변경이 있을 수 있습니다. X.509 인증서 인증은 0.1.x 라인에서 지원되지 않습니다 (사용자 이름/비밀번호만). Phase 5 항목은 ROADMAP.md를 참조하세요.

OPC UA LADS (Laboratory Agnostic Device Standard) 기기를 LLM 에이전트에 노출하는 MCP 서버로, 두 가지 Rei 고유 규율이 내장되어 있습니다:

  1. 승인 게이트 실행 — 모든 상태 변경 도구는 서버가 선언한 열거형(LADS 상태 머신 메서드, 프로그램 템플릿)에 대해 작업 이름을 검증합니다. 임의의 문자열은 네트워크 호출이 발생하기 전에 MCP 경계에서 거부됩니다.

  2. 입증된 출처 — 모든 상태 변경 호출은 SHA-256 레코드(개시자, 노드, 작업, 매개변수, 샘플, 타임스탬프)를 생성하며, 이는 로컬 추가 전용 JSONL에 저장되고 접두사로 검색할 수 있습니다.

LADS 참조 구현(opcua-lads)을 모델로 하고, Rei / D-FUMT 승인 게이트 + witnessed by 설계에 기반합니다.

Install

Python 3.12+ 필요.

python -m venv .venv
./.venv/bin/pip install -r requirements.txt   # Linux/macOS
./.venv/Scripts/pip install -r requirements.txt   # Windows

Related MCP server: opcua-mcp

Quick start

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로 재정의 가능). 두 lads_*_witness_* 도구를 통해 SHA-256 접두사로 검색할 수 있습니다.

관련 작업

미리보기 상태

  • Phase 1-4 스파이크 완료 — 15개 도구, L2 및 L3 모두 실제 LADS 점도계 시뮬레이션에서 통과

  • 이미 코드에 반영된 Phase 4 수정 사항: import 시 배너 음소거, Connection.initialized 폴링, QualifiedName 언랩

  • Phase 5는 아직 구현되지 않음 — ROADMAP.md 참조

  • API 안정성: v1.0.0 이전에는 없음 — 0.x에서 호환되지 않는 변경 예상

전체 스파이크 기록은 SPIKE-HISTORY.md에 보존되어 있습니다.

라이선스

MIT — LICENSE 참조. LADS 생태계 관례.

기여

CONTRIBUTING.md 참조. 외부 기여자는 Rei 프로젝트 CLA가 확정되면 서명된 CLA가 필요합니다.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Connects 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
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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.
    5
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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.
    1
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    Enables 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.
    22
    97 PyPI
    Apache 2.0