How mahmutcanborann/mcp-ev-digital-twin-agent works
This repository is an EV digital-twin platform for battery health and range prediction, charging and driving analysis, fleet monitoring, maintenance recommendations, and conversational engineering reports. The principal flow is a driver or fleet user asking a question in the dashboard or an agent; the agent may discover/select MCP tools, invoke the MCP server, and return analysis or an LLM-generated explanation. The graph preserves the README’s major capabilities. Some dashboard and server source is excerpted, so uncertain internal wiring is omitted; roadmap items are not represented as implemented features.
Main entry points: battery_soh_server.py MCP Tool Server · ev_twin_report.py EV Twin Report · ev_agent.py EV Digital Twin Agent · app.py Streamlit Dashboard
Components 21
User Interfaces
- Streamlit Dashboard
dashboard/app.py
Agent Orchestration
- Discovery MCP Agent
agent/discovery_mcp_agent.py - MCP Tool Agent
agent/mcp_tool_agent.py - Tool-Calling Agent
agent/tool_calling_ev_agent.py - EV Digital Twin Agent
agent/ev_agent.py - LLM EV Agent
agent/llm_ev_agent.py - MCP Tool Server
mcp_servers/battery_soh_server.py
Vehicle Analytics
- Battery Digital Twin
src/battery_twin.py - Charging Analyzer
src/charging_analyzer.py - Driving Analyzer
src/driving_analyzer.py - SOH Model Files
models/battery_soh_rf_model.pkl - Charging Patterns
data/ev_charging_patterns.csv
Fleet and Reports
- EV Twin Report
src/ev_twin_report.py - Predictive Maintenance
src/predictive_maintenance.py - Monitoring Engine
src/monitoring_engine.py - Data Drift Detector
src/drift_detector.py - Fleet Anomaly Detector
src/fleet_anomaly_detector.py - Battery Knowledge Base
src/battery_knowledge_base.py - Fleet Status Data
models/fleet_latest_status.csv
External Services
- Ollama Gemma
Other components
- Driver or Fleet User
Connections 38
- Driver or Fleet User → Streamlit Dashboard: asks or views
- Driver or Fleet User → Discovery MCP Agent: asks
- Driver or Fleet User → MCP Tool Agent: asks
- Driver or Fleet User → Tool-Calling Agent: asks
- Streamlit Dashboard → Battery Digital Twin: requests twin results
- Streamlit Dashboard → Predictive Maintenance: requests actions
- Streamlit Dashboard → Fleet Anomaly Detector: requests anomalies
- Streamlit Dashboard → Monitoring Engine: requests health
- Discovery MCP Agent → MCP Tool Server: discovers and calls tools
- Discovery MCP Agent → Battery Knowledge Base: retrieves context
- Discovery MCP Agent → Fleet Status Data: reads fleet context
- Discovery MCP Agent → Ollama Gemma: selects tools and explains
- MCP Tool Agent → MCP Tool Server: routes tool calls
- Tool-Calling Agent → EV Digital Twin Agent: routes general questions
- Tool-Calling Agent → Ollama Gemma: requests explanations
- EV Digital Twin Agent → EV Twin Report: generates analyses
- EV Digital Twin Agent → Predictive Maintenance: gets actions
- EV Digital Twin Agent → Fleet Status Data: reads fleet rankings
- LLM EV Agent → EV Twin Report: generates analyses
- LLM EV Agent → Predictive Maintenance: gets actions
- LLM EV Agent → Monitoring Engine: checks system and fleet
- LLM EV Agent → Ollama Gemma: requests answer
- MCP Tool Server → Battery Digital Twin: dispatches twin tools
- MCP Tool Server → Charging Analyzer: dispatches charging tools
- MCP Tool Server → Driving Analyzer: dispatches driving tools
- MCP Tool Server → EV Digital Twin Agent: dispatches agent tools
- MCP Tool Server → LLM EV Agent: dispatches LLM tool
- MCP Tool Server → Monitoring Engine: dispatches health checks
- MCP Tool Server → Data Drift Detector: dispatches drift checks
- EV Twin Report → Battery Digital Twin: generates battery summary
- EV Twin Report → Charging Analyzer: gets charging analysis
- EV Twin Report → Driving Analyzer: gets driving analysis
- Predictive Maintenance → EV Twin Report: uses report
- Monitoring Engine → EV Twin Report: generates system report
- Monitoring Engine → Fleet Status Data: reads fleet status
- Battery Digital Twin → SOH Model Files: loads model
- Charging Analyzer → Charging Patterns: analyzes sessions
- EV Digital Twin Agent → Ollama Gemma: requests explanation