Skip to main content
Glama

Majster-AI — MCP 기반 자동차 UDS 진단 에이전트

Python Protocol AI MCP UI Safety License

Car_Diagnostic_AICDAMajster-AI로도 불리는 이 프로젝트는 대규모 언어 모델을 UDS/CAN을 통해 차량의 제어 모듈, 로컬 정비 매뉴얼 인덱스, 그리고 실시간 웹 검색에 연결하는 진단 에이전트입니다. 세 가지 기능은 각각 독립된 Model Context Protocol 서버로 노출되며, 차량에 쓰기 작업을 수행하는 모든 것에 대해 강제적인 인간 개입 게이트를 갖춘 LangGraph 에이전트가 조율합니다.

Land Rover Freelander 2 (2010, 2.2 TD4) 차량을 대상으로 개발 및 테스트되었습니다.

Cyber-HUD 웹 인터페이스가 포함되어 있습니다: 실제 차량 좌표에 모듈 핀이 배치된 인터랙티브 3D 섀시, 실시간 텔레메트리 게이지, 그리고 차량에 쓰는 모든 작업에 대한 드래그-투-승인 게이트를 제공합니다.

Majster-AI Cyber-HUD

⚠️ 기본값은 시뮬레이터이며 READ_ONLY입니다

새로 클론한 저장소는 실제 버스에서 전송할 수 없고 차량에 쓸 수 없습니다. 둘 다 의도적인 설정 변경이 필요합니다. 소중한 차량에 연결하기 전에 docs/SAFETY.md를 읽으십시오.


실제로 하는 일

you> The car goes into limp mode on the motorway. What's wrong with it?

  [agent.plan] Calling: read_dtc
  [car.read_dtc] Reading DTCs from ECM
  [agent.plan] Calling: read_live_data
  [agent.plan] Calling: search_manual

majster> Three codes stored in the ECM, and I think two of them are one fault:

  P0299 (confirmed) — turbocharger underboost
  P2015 (confirmed) — intake manifold runner position sensor
  P0401 (pending)   — EGR flow insufficient

  Live data backs up the underboost: manifold pressure reads 101 kPa at idle
  against 100 kPa barometric, so the turbo isn't building any boost at all.

  P0299 and P2015 together on a DW12 is a familiar pattern — both are air-path
  faults and the swirl-flap linkage sits right next to the actuator. The
  manual (fl2_engine.pdf, page 412) says actuator vacuum should reach 0.6 bar
  at idle; that's the measurement that would separate a seized actuator rod
  from a boost leak, and it's a five-minute check before anyone buys a turbo.

  The pending EGR code I'd leave alone for now — it hasn't confirmed, and a
  fouled EGR is a plausible consequence of running underboost rather than a
  separate fault.

하지 않는 일을 주목하세요: 추측하거나 코드를 지우겠다고 제안하지 않습니다.


Related MCP server: Codex MCP Server

아키텍처

        +--------------------------------------------------+
        |   Cyber-HUD  (React · Three.js · Framer Motion)   |
        +---------------------------+----------------------+
                                    | WS /ws/diagnostics
        +---------------------------+----------------------+
        |         FastAPI  (telemetry · agent · HITL)       |
        +---------------------------+----------------------+
                                    |
                     +--------------+------------+
                     |     LangGraph agent       |
                     |  Claude Opus 5 / Ollama   |
                     +-------------+-------------+
                                   |
                 +-----------------+-----------------+
                 |                 |                 |
       +---------v------+ +--------v-------+ +-------v--------+
       | Car_Interface  | | RAG_Workshop   | |  Web_Search    |
       |      MCP       | |      MCP       | |      MCP       |
       +---------+------+ +--------+-------+ +-------+--------+
                 |                 |                 |
        UDS over CAN       local manuals      Tavily / DuckDuckGo
  • Car_Interface_MCPpython-can + udsoncan. 모든 모듈에서 DTC, 라이브 데이터 및 원시 DID를 읽습니다. 승인 핸드셰이크를 통해서만 코드를 지웁니다. 다섯 가지 교체 가능한 백엔드와 내장 ECU 시뮬레이터를 제공합니다.

  • RAG_Workshop_MCP — 자체 정비 매뉴얼 PDF에 대한 ChromaDB. 전적으로 기기에서 실행되며 모든 답변에 파일 및 페이지 인용이 포함됩니다.

  • Web_Search_MCP — 키 없는 DuckDuckGo 폴백이 있는 Tavily, Land Rover 포럼에 가중치를 둡니다.

  • 오케스트레이터 — 기본적으로 READ_ONLY. 모든 쓰기는 그래프를 일시 중지하고 사람을 기다립니다.

자세한 내용은 docs/ARCHITECTURE.md에 있습니다.


설치

git clone https://github.com/Mati83mon/Car_Diagnostic_Ai.git
cd Car_Diagnostic_Ai

python3 -m venv .venv
source .venv/bin/activate           # Windows: .venv\Scripts\activate

pip install -e ".[all,dev]"         # or: pip install -r requirements.txt

cp .env.example .env                # then edit it

무거운 추가 기능이 빌드되지 않는 Termux 또는 다른 ARM 기기에서는 건너뛰세요 — 프로젝트는 없이도 작동하도록 설계되었습니다:

pip install -e ".[car,mcp,agent,web]"

작동 확인

majster-ai doctor

cdacar-diagnostic-ai로도 사용 가능하며, python main.py <command>도 됩니다.


구성

모든 것은 .env에 있습니다. 기본값은 안전하므로 빈 파일도 유효한 파일입니다. 가장 중요한 설정:

# --- safety -----------------------------------------------------------
MAJSTER_WRITE_ENABLED=false      # master switch. Leave false.
MAJSTER_REQUIRE_APPROVAL=true    # human-in-the-loop. Leave true.

# --- vehicle interface -------------------------------------------------
MAJSTER_CAN_BACKEND=virtual      # virtual|socketcan|slcan|serial|j2534|rfcomm
MAJSTER_CAN_CHANNEL=can0
MAJSTER_CAN_BITRATE=500000

# --- LLM ----------------------------------------------------------------
ANTHROPIC_API_KEY=sk-ant-...     # Claude Opus 5; falls back to Ollama if unset
MAJSTER_OLLAMA_MODEL=qwen2.5:7b-instruct

# --- web search ---------------------------------------------------------
TAVILY_API_KEY=tvly-...          # optional; DuckDuckGo is used without it

모든 옵션은 주석과 함께 .env.example을 참조하세요.


사용

대화형

majster-ai chat

일회성

majster-ai ask "why is the DPF light on?"

LLM 없는 직접 도구

majster-ai dtc --module ECM              # read fault codes
majster-ai dtc --all                     # scan every module
majster-ai live RPM COOLANT_TEMP MAF     # read live data
majster-ai scan                          # discover which ECUs answer
majster-ai clear --module ECM            # write: prompts for approval

정비 매뉴얼

cp ~/manuals/*.pdf data/manuals/
majster-ai ingest
majster-ai search "swirl flap removal procedure"

매뉴얼은 로컬에서 인덱싱되고 검색됩니다. 아무것도 업로드되지 않습니다.

웹 인터페이스

cd frontend && npm install && npm run build   # once
majster-ai web                                # http://127.0.0.1:8000

프론트엔드 개발을 위해 Vite 개발 서버를 함께 실행하세요:

majster-ai web            # terminal 1 — API on :8000
cd frontend && npm run dev  # terminal 2 — UI on :5173, proxying to :8000

UI는 실시간 텔레메트리를 스트리밍하고, 3D 섀시에 모듈 상태를 표시하며, 쓰기 전에 드래그-투-승인 제스처를 기다립니다. 고장 코드를 클릭하면 카메라가 해당 구성 요소로 날아갑니다 — C0034 같은 섀시 코드는 엔진 베이의 ABS 모듈이 아닌 전륜 우측 휠 센서로 이동합니다.

majster-ai web은 기본적으로 127.0.0.1에 바인딩됩니다. 포트에 도달할 수 있는 모든 것은 에이전트에게 쓰기 제안을 요청할 수 있습니다. 승인 게이트는 여전히 유지되지만, 프롬프트는 그 자리에 있는 사람이 응답하게 됩니다. --host 0.0.0.0은 통제하는 네트워크에서만 사용하세요.

다른 클라이언트용 MCP 서버로

majster-ai serve car_interface           # stdio transport

Claude Desktop 및 기타 클라이언트 구성은 docs/ARCHITECTURE.md에 있습니다.


안전 모델

모델과 차량 사이에는 네 개의 독립적인 계층이 있습니다. 쓰기는 모두 통과해야 합니다.

계층

보장

1. 마스터 스위치

MAJSTER_WRITE_ENABLED=false가 기본값입니다. 쓰기는 완전히 거부되며, 토큰이 발급되지 않고 프롬프트도 표시되지 않습니다. 에이전트는 이를 변경할 수 없습니다.

2. 토큰 핸드셰이크

첫 호출은 항상 실패하고 영향 요약과 단일 사용 토큰을 반환합니다. 토큰은 정확한 인수의 해시에 바인딩되며 5분 후 만료됩니다. ECM 승인으로 ABS 모듈을 지울 수 없습니다.

3. 인간 일시 중지

그래프는 interrupt()를 통해 일시 중지됩니다. 거부, 빈 응답, 닫힌 stdin, 충돌한 UI, 비대화형 세션 — 모두 아니요를 의미합니다.

4. 시스템 프롬프트

모델에게 다른 세 계층이 무엇을 할지 알려줍니다. 가장 약한 계층으로 취급됩니다. 실제로 그렇기 때문입니다.

브라우저는 단순히 또 다른 승인자입니다. 슬라이더는 하나의 부울 값을 보냅니다. 확인 토큰은 서버 프로세스 내부에서 생성되고 사용되며 어떤 WebSocket 프레임에도 나타나지 않습니다. 클라이언트는 서버가 선택한 질문에 답변할 수 있지만, 질문을 제기하거나 쓰기를 수행하는 자격 증명을 발급할 수는 없습니다.

Approval gate

계층 2는 MCP 서버 뒤의 서비스에 있으므로, 이 에이전트가 아닌 다른 것이 구동하더라도 차량을 보호합니다.

========================================================================
  WRITE OPERATION - HUMAN APPROVAL REQUIRED
========================================================================
  Operation : clear_dtc
  Module    : ECM (Engine Control Module - 2.2 TD4)
  Scope     : ALL stored DTCs in this module
  Risk      : MEDIUM        Reversible: NO
  Will erase 3 code(s):
      - P0299-00     Turbocharger/Supercharger A Underboost Condition
      - P2015-00     Intake Manifold Runner Position Sensor/Switch Circuit
      - P0401-00     Exhaust Gas Recirculation Flow Insufficient Detected

  Consequences:
      ! Freeze-frame data captured when the fault occurred will be lost.
      ! Readiness monitors reset; the vehicle may fail an emissions test.
      ! Clearing does not repair anything. If the fault is still present
        the code will return.
========================================================================

  Type 'yes' to authorise, anything else to decline:

자세한 내용은 docs/SAFETY.md에 있습니다.


하드웨어

백엔드

인터페이스

플랫폼

virtual

없음 — 내장 시뮬레이터

어디서나

j2534

Tactrix Openport 2.0

Linux, Windows

socketcan

USB2CAN, CANable, PiCAN

Linux

slcan

CANable/CANtact (slcan 펌웨어)

Linux, macOS, Windows

rfcomm

ELM327 / OBDLink over Bluetooth

Linux, Termux

Freelander 2는 OBD-II 핀 6(CAN-H) 및 14(CAN-L)에서 11비트 식별자로 500 kbit/s의 ISO 15765-4 CAN을 사용합니다.

각각의 설정, Termux, Raspberry Pi, 그리고 실제로 작동하는 ELM327 어댑터: docs/HARDWARE.md.


저장소의 데이터에 관하여

모든 차량에서 법적으로 규정되어 확실한 진단 주소는 두 개뿐입니다: 파워트레인 주소 0x7E0/0x7E80x7E1/0x7E9. 내장 모듈 맵의 다른 모든 것은 커뮤니티에서 파생된 것이며 verified: false로 표시되어 배포됩니다.

라이브 데이터 스케일링도 마찬가지입니다: SAE J1979 PID는 표준이며 검증된 것으로 표시됩니다. 제조사 DID는 독점적이며 전혀 포함되지 않습니다. 진단 도구에서 가장 나쁜 출력은 자신 있게 틀린 숫자이기 때문입니다.

여러분의 차량에 대해 무엇이 사실인지 알아내려면:

majster-ai scan

그런 다음 응답한 것을 data/modules.json에 기록하세요. docs/FREELANDER2.md를 참조하세요.


개발

make install-dev
make check                # black --check, flake8, pytest
make test-cov             # coverage report

전체 스위트는 프로세스 내 ECU 시뮬레이터에 대해 실행됩니다 — 하드웨어, API 키, 네트워크 없이:

736 passed, 1 skipped

시뮬레이터는 목(mock)이 아닌 실제 UDS 구현이므로, 재시도 로직, DTC 코덱, MCP 도구 및 HITL 게이트 모두 실제 버스에서 볼 수 있는 것과 동일한 바이트 스트림에 대해 실행됩니다. 오류 주입은 불안정한 버스 경로를 결정적으로 만듭니다:

ecm.inject_faults(drop_next=2)      # two silent timeouts, then fine
ecm.inject_faults(pending_next=3)   # three NRC 0x78, then the answer
ecm.inject_faults(busy_next=1)      # one NRC 0x21 busyRepeatRequest

CI는 린트, Python 3.10/3.11/3.12에서의 스위트, 자체 작업으로서의 안전 불변식, 그리고 MCP 서버를 실제 하위 프로세스로 생성하는 통합 작업을 실행합니다.


프로젝트 구조

majster_ai/
├── agent/              LangGraph orchestrator, HITL, LLM providers
├── mcp_servers/
│   ├── car_interface/  UDS/CAN — the safety gate lives in service.py
│   ├── rag_workshop/   local manual retrieval
│   └── web_search/     Tavily / DuckDuckGo
├── web/                FastAPI + /ws/diagnostics, WebSocketApprover
├── config.py           settings and the two safety gates
└── cli.py
frontend/               React + Three.js Cyber-HUD (see frontend/README.md)
tests/                  736 tests, all hardware-free
docs/                   ARCHITECTURE, SAFETY, HARDWARE, FREELANDER2

면책 조항

이 프로젝트는 교육 및 연구 목적입니다. 인증된 진단 도구가 아니며 제조사의 장비나 자격을 갖춘 기술자를 대체하지 않습니다.

저자는 이 소프트웨어 사용으로 인한 차량 손상, 제어 모듈 손상, 수리 실패, 보증 무효화 또는 부상에 대해 책임을 지지 않습니다. 명령이 차량 버스에 도달하기 전에 그 의미를 이해하는 것은 사용자의 책임입니다. 확실하지 않다면 보내지 마십시오.

Zrzeczenie się odpowiedzialności

Projekt służy wyłącznie do celów edukacyjnych i badawczych. Autor nie ponosi odpowiedzialności za jakiekolwiek uszkodzenia pojazdu, uszkodzenia sterowników (ECU) lub obrażenia ciała wynikające z użytkowania tego oprogramowania.

Zawsze upewnij się, że wiesz, jakie komendy — zwłaszcza polecenia ZAPISU — są wysyłane na magistralę CAN Twojego samochodu.


라이선스

MIT — LICENSE 참조.

정비 매뉴얼은 저작권이 있으며 이 프로젝트에 포함되지 않습니다. data/manuals/는 gitignore되어 있습니다. 합법적으로 직접 확보하세요.

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables LLMs to interact with vehicle CAN bus and OBD-II data through a simulated ECU environment. Provides tools for reading frames, decoding messages via DBC files, monitoring signals, and querying automotive diagnostics without requiring physical hardware.
    13
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    Connects AI assistants to a local Codex engine for performing deep, project-level code reviews and automated refactoring. It enables context-aware bug fixes and multi-file analysis through a standardized bridge between modern AI clients and local development environments.
    4
    2
  • F
    license
    A
    quality
    D
    maintenance
    Enables LLMs to automatically diagnose coding errors through codebase search, test execution, and live debugger integration (DAP/V8 CDP). Provides a secure, policy-gated environment for investigating failures while preventing destructive operations.
    9
  • F
    license
    A
    quality
    B
    maintenance
    An MCP server that exposes vehicle-diagnostic and CAN-bus domain logic as agent tools, with a LangGraph orchestration layer and a human-in-the-loop eval harness.
    4

View all related MCP servers

Related MCP Connectors

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.

  • Sovereign Agent OS — Persistent Memory, Governance & Compliance for AI Agents.

View all MCP Connectors

Latest Blog Posts

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/Mati83mon/Car_Diagnostic_Ai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server