iso26262-agent

iso26262-agent

AI-powered MCP server for automotive functional safety engineering. Enables generation of HARA, FMEA, safety requirements, and compliance checks grounded in ISO 26262 standards.

Category
Visit Server

README

iso26262-agent

AI-powered ISO 26262 Functional Safety Agent for Automotive

An MCP (Model Context Protocol) server that provides AI-assisted functional safety engineering tools for automotive ECU development. Generates HARA, FMEA, safety requirements, and compliance checks using RAG + LLM β€” grounded in ISO 26262 standards.

Built for engineers working on safety-critical systems: inverters, motor controllers, TCUs, ADAS, autonomous drive platforms, and battery management systems.


🎯 What It Does

Tool Input Output
HARA Generator System/function description Hazard events + ASIL classification (A/B/C/D)
FMEA Generator Component description Full FMEA table (Failure Mode, S, O, D, RPN, Actions)
Safety Requirements Function + ASIL level ISO 26262-compliant FSR/TSR/SWSR requirements
Compliance Checker Your existing requirements Gap analysis vs ISO 26262 with clause references

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              MCP Client (IDE/CLI)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ MCP Protocol
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           iso26262-agent (MCP Server)        β”‚
β”‚                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  HARA   β”‚ β”‚  FMEA   β”‚ β”‚ Requirements β”‚  β”‚
β”‚  β”‚Generatorβ”‚ β”‚Generatorβ”‚ β”‚  Generator   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚       β”‚            β”‚             β”‚           β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚         RAG Pipeline                    β”‚ β”‚
β”‚  β”‚  Query β†’ Embed β†’ Search β†’ Context      β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                   β”‚                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚         LLM (Gemini API)               β”‚ β”‚
β”‚  β”‚  Context + Prompt β†’ Structured Output  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Knowledge Base (194 chunks)         β”‚
β”‚                                              β”‚
β”‚  β€’ ISO 26262 Parts 1-12 concepts            β”‚
β”‚  β€’ ASIL determination tables (S/E/C β†’ ASIL) β”‚
β”‚  β€’ Automotive failure mode patterns          β”‚
β”‚  β€’ Safety requirement templates              β”‚
β”‚  β€’ HARA methodology & examples              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

  • Python 3.11+
  • MCP Protocol β€” Model Context Protocol server (standardized AI tool interface)
  • Gemini API β€” LLM for reasoning and generation
  • RAG Pipeline β€” Semantic embeddings + vector search (with TF-IDF fallback)
  • Pydantic β€” Structured data models and validation
  • Rich β€” Formatted CLI output

πŸš€ Quick Start

1. Clone & Install

git clone https://github.com/Abinash009/iso26262-agent.git
cd iso26262-agent
pip install -r requirements.txt

2. Set API Key

export GOOGLE_API_KEY=your_gemini_api_key_here

Or create a .env file:

GOOGLE_API_KEY=your_key_here

3. Run Demo

python3 demo.py

This runs all 3 tools with example automotive inputs and shows formatted output.

4. Run as MCP Server

python3 src/server.py

πŸ“‹ Usage Examples

HARA Generator

Input: "Torque control function in traction inverter for electric truck"

Output:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”
β”‚ Hazard                                                       β”‚ ASIL β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€
β”‚ Unintended forward over-torque while vehicle is stationary   β”‚ D    β”‚
β”‚ Unintended excessive negative torque (regen braking)         β”‚ C    β”‚
β”‚ Sudden total loss of drive torque during overtaking           β”‚ B    β”‚
β”‚ Unintended reverse torque while forward gear engaged         β”‚ D    β”‚
β”‚ Unintended forward motion when reverse gear engaged          β”‚ A    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”˜

FMEA Generator

Input: "DC-DC converter 800V to 12V for auxiliary systems"

Output:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Failure Mode                          β”‚ S β”‚ O β”‚ D β”‚ RPN β”‚ Recommended Action       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ HV to LV Isolation Breakdown          β”‚10 β”‚ 2 β”‚ 4 β”‚ 80  β”‚ Reinforced galvanic iso  β”‚
β”‚ Loss of Output (Zero Voltage)         β”‚ 9 β”‚ 4 β”‚ 3 β”‚ 108 β”‚ Dual 12V output paths    β”‚
β”‚ Uncontrolled Output Overvoltage       β”‚ 8 β”‚ 3 β”‚ 2 β”‚ 48  β”‚ Redundant OV protection  β”‚
β”‚ Shoot-Through (High/Low Side)         β”‚ 8 β”‚ 3 β”‚ 2 β”‚ 48  β”‚ HW-enforced dead-time    β”‚
β”‚ Excessive Junction Temperature        β”‚ 6 β”‚ 4 β”‚ 2 β”‚ 48  β”‚ Dual NTC sensors         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Safety Requirements Generator

Input: function="Emergency braking torque delivery", ASIL=D

Output:
[FSR-001] [FSR] The system shall prevent unintended emergency braking torque delivery
[FSR-002] [FSR] The system shall deliver requested torque within specified time
[FSR-003] [FSR] The system shall maintain symmetrical braking torque delivery
[TSR-001] [TSR] Dual-channel cross-validation of torque demand signals
[TSR-002] [TSR] Dual independent power supply for hydraulic actuation
[TSR-003] [TSR] Redundant pressure sensors for left/right monitoring

πŸ“ Project Structure

iso26262-agent/
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ demo.py                      # Quick demo script (run this!)
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ __init__.py              # Package initialization
β”‚   β”œβ”€β”€ server.py                # MCP protocol server + CLI
β”‚   β”œβ”€β”€ tools.py                 # 4 safety tools + SafetyAgent class
β”‚   β”œβ”€β”€ rag.py                   # RAG pipeline (embeddings + search)
β”‚   └── models.py                # Pydantic data models
β”œβ”€β”€ knowledge_base/
β”‚   β”œβ”€β”€ asil_determination.md    # ASIL classification tables
β”‚   β”œβ”€β”€ failure_modes_automotive.md  # ECU failure mode patterns
β”‚   β”œβ”€β”€ hara_methodology.md      # HARA process & examples
β”‚   β”œβ”€β”€ iso26262_overview.md     # ISO 26262 Parts 1-12 summary
β”‚   └── safety_requirements_patterns.md  # Requirement templates
β”œβ”€β”€ tests/
β”‚   └── test_tools.py            # Unit tests
└── docs/

πŸ”‘ Key Design Decisions

Decision Rationale
MCP Protocol Standardized AI tool interface β€” works with any MCP client
RAG over fine-tuning Updatable knowledge base, no retraining needed, source traceability
TF-IDF fallback Works without API key for demos and testing
Pydantic models Type-safe, validated, serializable structured output
Automotive-specific KB Not generic FMEA β€” tailored to ECU failure patterns
Separated concerns RAG, Tools, Models, Server β€” each independently testable

🎯 Supported Automotive Domains

  • Power Electronics β€” Inverters, DC-DC converters, motor controllers
  • Connectivity β€” TCU, V2X, telematics
  • ADAS / Autonomous Drive β€” Camera, radar, sensor fusion, path planning
  • Battery Management β€” BMS, cell balancing, thermal management
  • Braking / Steering β€” Brake-by-wire, EPS, stability control
  • Body Electronics β€” Lighting, door control, climate

⚠️ Disclaimer

This tool assists engineers in safety analysis β€” it does not replace human judgement for safety-critical decisions. All outputs should be reviewed by qualified functional safety engineers before use in production.


πŸ‘€ Author

Abinash Kumar β€” AI & Automotive Connectivity Engineer

Related Projects


πŸ“„ License

MIT License

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured