vHAL MCP Server

by feevlic

Not rated
GitHub

About

Search Android Vehicle Hardware Abstraction Layer (vHAL) documentation and source code from a local repository clone.

Details

Author
feevlic
Categories
Developer Tools, Knowledge Base

Setup

Install vHAL MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/feevlic/vhal-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

MCP server for Android Vehicle Hardware Abstraction Layer (vHAL) documentation and source code analysis. This server provides intelligent tools for exploring vHAL properties, understanding their relationships, and implementing automotive climate control systems.

The vHAL MCP Server helps Android Automotive developers by providing:

- Property Analysis: Discover vHAL properties and their relationships
- Source Code Lookup: Find Android source code implementations
- Implementation Guidance: Get step-by-step implementation recommendations
- Documentation Summarization: Access curated vHAL documentation insights

https://github.com/user-attachments/assets/6fcdc5fb-6cbb-4c69-9528-fa3bdee4acb1

Example: Analyzing HVAC properties and implementation guidance using Claude Desktop with the vHAL MCP Server

- Summarizes vHAL implementation based on specific questions
- Analyzes Android automotive documentation
- Provides contextual answers for vHAL development

lookup_android_source_code(keyword, category)

- Searches Android source code for vHAL properties
- Returns property definitions with IDs and categories
- Provides direct links to source code locations

discover_related_properties(property_or_category)

- Analyzes property relationships and dependencies
- Suggests implementation order for complex features
- Groups properties by functional categories

analyze_vhal_implementation(property_name)

- Shows detailed source code analysis for specific properties
- Provides implementation examples and usage patterns
- Includes dependency analysis and best practices

- Generates complete VHAL property implementation code for AAOS
- Creates all necessary files, configurations, tests, and documentation
- Supports all VHAL data types, property groups, and access modes
- Includes HAL definitions, Java APIs, tests, and build configurations

- Generates comprehensive pull request messages for VHAL implementations
- Creates structured PR descriptions with technical details and testing requirements
- Includes professional titles, change summaries, and review checklists
- Ready-to-copy-paste format for GitHub/GitLab integration

validate_vhal_sources_and_enhance_summary(question, include_source_validation, max_sources_to_check)

- Enhanced vHAL summary with complete source transparency and validation
- Validates URL accessibility to detect broken or moved documentation links
- Provides confidence scoring based on source reliability and accessibility
- Shows clear citations with response times and last-modified dates
- Suggests alternative sources for failed URLs
- Distinguishes between cached vs. live data for transparency

validate_vhal_property_request(property_name, property_description, ...)

- Validates vHAL property requests following Android best practices
- Checks if property already exists in latest Android release (Android 16)
- Recommends using existing Android properties when available
- Generates VENDOR_ properties with proper naming convention when needed
- Provides comprehensive analysis with similarity scoring and recommendations
- Supports all VHAL data types, property groups, and configurations
- Integrates with existing code generation tools for complete implementation

- Python 3.12 or higher
- Internet connection for documentation scraping
- MCP-compatible client (Claude Desktop, Zed, or other MCP clients)

git clone https://github.com/feevlic/vhal-mcp-server.git
git clone git@github.com:feevlic/vhal-mcp-server.git

Locate your Claude Desktop configuration file

- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:%APPDATA%/Claude/claude_desktop_config.json

Edit the configuration file and add the following (replace the paths with your actual paths):

{ "mcpServers": { "vhal-mcp-server": { "command": "/Users/[]/.local/bin/uv", "args": ["run", "--directory", "/Users/[]/vhal-mcp-server", "python", "main.py"], "env": { "PYTHONPATH": "/Users/[]/vhal-mcp-server" } } } }

You can find an example in the config folder.

- Replace/path/to/your/uvwith the output from step 1 (e.g.,/Users/yourusername/.local/bin/uv)
- Replace/path/to/vhal-mcp-serverwith the actual path where you cloned the repository
- On macOS, GUI applications like Claude Desktop may not have access to your shell's PATH, so using full paths is required

After saving the configuration file, completely quit and restart Claude Desktop for the MCP server to be loaded.

When you first ask a question that requires the vHAL tools, Claude will prompt you to allow the MCP server to use its tools. Click "Allow" to enable the vHAL analysis capabilities.

The server exposes MCP tools that can be used through compatible clients. Each tool accepts specific parameters and returns structured information about vHAL properties and implementations.

Start with these simple prompts to explore vHAL capabilities:

Show me all HVAC-related properties and their IDs
How do I control the fan speed in Android Automotive?
Find Android source code for seat heating properties
What properties do I need to set the cabin temperature?
Explain the HVAC_POWER_ON property and how to use it

Once familiar with basic concepts, try these comprehensive prompts:

I need to implement a climate control system. Can you: 1. Find all HVAC-related properties 2. Explain their relationships and dependencies 3. Show me the Android source code implementation 4. Provide a step-by-step implementation guide Please give me a complete analysis for building this system.
Analyze the implementation requirements for a dual-zone HVAC system. Include: - Property relationships between driver and passenger zones - Dependencies and implementation order - Source code examples from Android - Best practices for zone management
Design a comprehensive seat memory system that includes: - Position storage and recall (8-way adjustment) - Heating and cooling integration - Memory profile management - Safety considerations and dependencies Show me the vHAL properties needed and implementation approach.
I'm implementing defrost and safety features. Analyze: - Priority systems for defrost override - Integration with HVAC main system - Emergency defrost activation - Window clearing effectiveness Provide source code examples and safety considerations.
Optimize my HVAC implementation for energy efficiency: - Auto mode algorithms - Fan speed optimization - AC compressor management - Integration with vehicle power management Include Android source examples and power consumption strategies.
I want to add a new custom HVAC feature for air quality monitoring. Help me: - Understand the property definition process - Find similar existing properties for reference - Design the property specification - Plan the HAL implementation approach

Use thegenerate_vhal_implementation_codetool to create complete VHAL implementations:

Generate a complete VHAL implementation for a smart dashboard lighting system with the following specifications: - Property Name: DASHBOARD_SMART_LIGHTING_MODE - Property ID: 0x15400B01 - Type: INT32 (enumerated values) - Group: LIGHTS - Access: READ_WRITE - Change Mode: ON_CHANGE - Description: Smart dashboard lighting control with adaptive brightness and color temperature - Enum Values: OFF=0, AUTO=1, DAY=2, NIGHT=3, CUSTOM=4 - Dependencies: NIGHT_MODE, CABIN_LIGHTS_STATE Please use the generate_vhal_implementation_code tool.
I need to implement a comprehensive EV charging management system. Create a VHAL property with these requirements: - Property Name: EV_CHARGING_PORT_STATUS - Property ID: 0x15400C01 - Type: INT32 (enum) - Group: POWER - Access: READ (status monitoring only) - Change Mode: ON_CHANGE - Description: Electric vehicle charging port status and connection state - Enum Values: DISCONNECTED=0, CONNECTED=1, CHARGING=2, ERROR=3, COMPLETE=4, SCHEDULED=5 - Dependencies: EV_BATTERY_LEVEL, EV_CHARGING_RATE - Areas: GLOBAL Generate the complete implementation using generate_vhal_implementation_code.
Implement an advanced HVAC zone control system for precise temperature management: - Property Name: HVAC_ZONE_CLIMATE_PROFILE - Property ID: 0x15400D01 - Type: FLOAT - Group: HVAC - Access: READ_WRITE - Change Mode: CONTINUOUS - Description: Advanced HVAC zone climate profile with precise temperature control - Units: celsius - Min Value: 16.0 - Max Value: 32.0 - Areas: ["SEAT_ROW_1_LEFT", "SEAT_ROW_1_RIGHT", "SEAT_ROW_2_LEFT", "SEAT_ROW_2_RIGHT"] - Dependencies: HVAC_TEMPERATURE_SET, HVAC_FAN_SPEED - Sample Rate: 0.5 Hz (update every 2 seconds) Use generate_vhal_implementation_code to create the full implementation.
Create a biometric-based seat adjustment system: - Property Name: SEAT_BIOMETRIC_PROFILE - Property ID: 0x15400E01 - Type: STRING - Group: SEAT - Access: READ_WRITE - Change Mode: ON_CHANGE - Description: Biometric-based automatic seat adjustment with user recognition - Areas: ["SEAT_ROW_1_LEFT", "SEAT_ROW_1_RIGHT"] - Dependencies: SEAT_HEIGHT_POS, SEAT_FORE_AFT_POS, SEAT_RECLINE_ANGLE Generate the complete VHAL implementation.

Use thegenerate_vhal_pr_messagetool to create professional pull request messages:

Generate a comprehensive pull request message for my smart dashboard lighting implementation: - Property Name: DASHBOARD_SMART_LIGHTING_MODE - Property ID: 0x15400B01 - Type: INT32 - Group: LIGHTS - Access: READ_WRITE - Change Mode: ON_CHANGE - Description: Smart dashboard lighting control with adaptive brightness and color temperature - Enum Values: {"OFF": 0, "AUTO": 1, "DAY": 2, "NIGHT": 3, "CUSTOM": 4} - Dependencies: ["NIGHT_MODE", "CABIN_LIGHTS_STATE"] - JIRA Ticket: AUTO-1234 - Reviewer Suggestions: ["Verify power consumption impact", "Test night mode transitions"] Please use the generate_vhal_pr_message tool.
Create a pull request message for my electric vehicle charging management system: - Property Name: EV_CHARGING_PORT_STATUS - Property ID: 0x15400C01 - Type: INT32 - Group: POWER - Access: READ - Change Mode: ON_CHANGE - Description: Electric vehicle charging port status and connection state - Enum Values: {"DISCONNECTED": 0, "CONNECTED": 1, "CHARGING": 2, "ERROR": 3, "COMPLETE": 4, "SCHEDULED": 5} - Dependencies: ["EV_BATTERY_LEVEL", "EV_CHARGING_RATE"] - Areas: ["GLOBAL"] - Breaking Change: false Generate the complete PR message.
Generate a pull request message for my advanced HVAC zone control implementation: - Property Name: HVAC_ZONE_CLIMATE_PROFILE - Property ID: 0x15400D01 - Type: FLOAT - Group: HVAC - Access: READ_WRITE - Change Mode: CONTINUOUS - Description: Advanced HVAC zone climate profile with precise temperature control - Units: celsius - Min Value: 16.0 - Max Value: 32.0 - Areas: ["SEAT_ROW_1_LEFT", "SEAT_ROW_1_RIGHT", "SEAT_ROW_2_LEFT", "SEAT_ROW_2_RIGHT"] - Dependencies: ["HVAC_TEMPERATURE_SET", "HVAC_FAN_SPEED"] - Sample Rate: 0.5 - Breaking Change: false - JIRA Ticket: HVAC-567 - Reviewer Suggestions: ["Review energy efficiency impact", "Validate zone isolation"] Create a professional PR message with all technical details and checklists.

Use thevalidate_vhal_property_requesttool to follow Android best practices and validate property requests:

I want to implement a seat heating control feature. Can you validate if I should use an existing Android property or create a new VENDOR_ property? - Property Name: SEAT_HEATING_CONTROL - Description: Control seat heating levels for driver and passenger seats - Property Type: INT32 - Min Value: 0 - Max Value: 5 - Areas: ["SEAT_ROW_1_LEFT", "SEAT_ROW_1_RIGHT"] Please use the validate_vhal_property_request tool.
Validate this climate control property request: - Property Name: CLIMATE_AUTO_MODE - Description: Enable automatic climate control mode - Property Type: BOOLEAN - Group: HVAC - Access: READ_WRITE - Change Mode: ON_CHANGE Use validate_vhal_property_request to check if this exists in Android 16.
I need to implement a custom vehicle feature. Please validate: - Property Name: VEHICLE_AMBIENT_SOUND_CONTROL - Description: Control ambient sound system for enhanced driving experience - Property Type: INT32 - Group: VENDOR - Access: READ_WRITE - Change Mode: ON_CHANGE - Enum Values: {"OFF": 0, "NATURE": 1, "CITY": 2, "HIGHWAY": 3, "CUSTOM": 4} - Dependencies: ["AUDIO_VOLUME", "CABIN_LIGHTS_STATE"] Please use validate_vhal_property_request to determine if I should create a VENDOR_ property.
Validate this advanced property request with full specifications: - Property Name: BIOMETRIC_DRIVER_RECOGNITION - Description: Biometric driver recognition system for personalized vehicle settings - Property Type: STRING - Group: VENDOR - Access: READ_WRITE - Change Mode: ON_CHANGE - Units: none - Areas: ["GLOBAL"] - Dependencies: ["SEAT_MEMORY_SELECT", "MIRROR_Y_POS", "HVAC_TEMPERATURE_SET"] - Sample Rate: 0.1 Hz Use validate_vhal_property_request to check Android 16 compatibility and get implementation guidance.
I'm implementing a tire pressure monitoring system. Please validate: - Property Name: TIRE_PRESSURE_MONITORING_DETAILED - Description: Detailed tire pressure monitoring with per-tire data and alerts - Property Type: FLOAT_VEC - Group: POWER - Access: READ - Change Mode: CONTINUOUS - Units: psi - Min Value: 0.0 - Max Value: 100.0 - Areas: ["WHEEL_LEFT_FRONT", "WHEEL_RIGHT_FRONT", "WHEEL_LEFT_REAR", "WHEEL_RIGHT_REAR"] - Sample Rate: 1.0 Hz Use validate_vhal_property_request to determine if Android 16 has equivalent functionality.

Expert Prompt: Complete VHAL System Development

This expert-level prompt demonstrates using all 6 MCP tools in a comprehensive workflow for developing a complete automotive system:

I'm developing a next-generation intelligent climate control system for luxury electric vehicles. This system needs to integrate multiple subsystems and provide personalized comfort experiences. Please help me design and implement this system using a comprehensive analysis approach: Phase 1: Discovery & Research (Tools 1-2) First, help me understand the complete landscape: 1. explain the overall VHAL climate control architecture, focusing on: - Multi-zone HVAC systems - Integration with seat heating/cooling - Energy efficiency considerations for EVs - Safety and emergency override systems 2. find all climate-related properties, including: - HVAC properties (search: "HVAC") - Seat thermal properties (search: "SEAT") - Power management properties (search: "POWER") - Any auxiliary heating properties (search: "HEAT") Phase 2: System Analysis & Dependencies (Tool 3) 3. analyze the complete ecosystem for: - "HVAC_TEMPERATURE_SET" - understand temperature control relationships - "SEAT_HEAT" - analyze seat thermal dependencies - "HVAC_POWER_ON" - understand system power relationships - "HVAC_FAN_SPEED" - analyze airflow control dependencies Phase 3: Implementation Deep-Dive (Tool 4) 4. get detailed source code analysis for: - "HVAC_TEMPERATURE_SET" - see how Android implements temperature control - "HVAC_AUTO_ON" - understand automatic mode implementation - "SEAT_HEAT_LEFT" - analyze seat heating implementation patterns - "HVAC_AC_ON" - understand AC compressor control Phase 5: Property Validation (Tool 5) 5. Before implementing, validate the property request: - Property Name: CLIMATE_INTELLIGENT_PROFILE - Description: Intelligent climate control with predictive comfort algorithms, energy optimization, and personalized user profiles - Property Type: INT32 - Group: HVAC - Access: READ_WRITE - Change Mode: ON_CHANGE - Enum Values: {"PROFILE_ECO": 0, "PROFILE_COMFORT": 1, "PROFILE_SPORT": 2, "PROFILE_CUSTOM": 3, "PROFILE_SLEEP": 4, "PROFILE_DEFROST_PRIORITY": 5} - Dependencies: ["HVAC_TEMPERATURE_SET", "HVAC_FAN_SPEED", "SEAT_HEAT_LEFT", "SEAT_HEAT_RIGHT", "HVAC_AC_ON", "EV_BATTERY_LEVEL"] - Areas: ["GLOBAL", "SEAT_ROW_1_LEFT", "SEAT_ROW_1_RIGHT"] Use validate_vhal_property_request to determine if this should be a VENDOR_ property or if Android 16 has equivalent functionality. Phase 6: Custom Implementation (Tool 6) 6. Based on the validation results, create the property implementation: - Property Name: CLIMATE_INTELLIGENT_PROFILE - Property ID: 0x15400F01 - Type: INT32 (enumerated values) - Group: HVAC - Access: READ_WRITE - Change Mode: ON_CHANGE - Description: Intelligent climate control with predictive comfort algorithms, energy optimization, and personalized user profiles - Enum Values: PROFILE_ECO=0, PROFILE_COMFORT=1, PROFILE_SPORT=2, PROFILE_CUSTOM=3, PROFILE_SLEEP=4, PROFILE_DEFROST_PRIORITY=5 - Dependencies: HVAC_TEMPERATURE_SET, HVAC_FAN_SPEED, SEAT_HEAT_LEFT, SEAT_HEAT_RIGHT, HVAC_AC_ON, EV_BATTERY_LEVEL - Units: none - Areas: ["GLOBAL", "SEAT_ROW_1_LEFT", "SEAT_ROW_1_RIGHT"] 7. Please also add a pull request message i can add to the Pull request once i implemented it. Expected Deliverables: After running this comprehensive analysis, I expect to receive: 1. Complete System Understanding - architectural overview and best practices 2. Property Inventory - all relevant properties with IDs and locations 3. Dependency Maps - implementation order and relationships 4. Implementation Patterns - real Android source code examples 5. Property Validation - Android best practices validation and recommendations 6. Production-Ready Code - complete implementation files 7. Pull Request Text - Copy and Paste Pull request text This comprehensive approach will give me everything needed to implement a production-quality intelligent climate control system.

Thegenerate_vhal_implementation_codetool creates complete, production-ready VHAL implementations:

For each VHAL property, the generator creates:

- types.hal- Property definition and enums
- DefaultConfig.h- Property configuration
- EmulatedVehicleHal.cpp- Implementation logic
- VehicleProperty.aidl- AIDL interface

- VehiclePropertyIds.java- Java constants
- CarPropertyManager.java- API methods
- Configuration JSON files

- VehicleHalTest.cpp- C++ unit tests
- VehiclePropertyTest.java- Java integration tests

- SEPolicy rules
- Build configurations
- Documentation

- name: Property name (e.g., "HVAC_STEERING_WHEEL_HEAT")
- property_id: Unique property ID (hex format, e.g., "0x15400A03")
- property_type: Data type (BOOLEAN, INT32, INT64, FLOAT, STRING, BYTES, *_VEC, MIXED)
- group: Property group (HVAC, SEAT, LIGHTS, POWER, CLIMATE, etc.)
- access: Access mode (READ, WRITE, READ_WRITE)
- change_mode: Change mode (STATIC, ON_CHANGE, CONTINUOUS)
- description: Property description for documentation

- units: Units (e.g., "celsius", "rpm")
- min_value: Minimum value for numeric types
- max_value: Maximum value for numeric types
- areas: List of vehicle areas/zones
- enum_values: Dict of enum names and values for INT32 enum properties
- dependencies: List of dependent property names
- sample_rate_hz: Sample rate for continuous properties

- BOOLEAN: True/false values
- INT32: 32-bit integers
- INT64: 64-bit integers
- FLOAT: Floating point numbers
- STRING: Text values
- BYTES: Binary data

- INT32_VEC: Arrays of integers
- FLOAT_VEC: Arrays of floats
- STRING_VEC: Arrays of strings
- BYTES_VEC: Arrays of binary data

- BODY: Body control systems
- CABIN: Interior cabin controls
- CLIMATE: Climate control systems
- DISPLAY: Display and infotainment
- ENGINE: Engine management
- HVAC: Heating, ventilation, air conditioning
- INFO: Vehicle information
- INSTRUMENT_CLUSTER: Dashboard instruments
- LIGHTS: Lighting systems
- MIRROR: Mirror controls
- POWER: Power management
- SEAT: Seat controls
- VEHICLE_MAP_SERVICE: Navigation services
- WINDOW: Window controls
- VENDOR: Vendor-specific properties

When you use the code generator, it produces:
- Complete Summary- Property configuration and overview
- Generated Files- All 10+ necessary implementation files with syntax highlighting
- Implementation Guide- Step-by-step integration instructions
- Usage Examples- Sample code for using the property
- Build Commands- AAOS build and test commands

Implement comprehensive HVAC systems with proper property relationships:

- Temperature Control: Multi-zone heating and cooling
- Fan Management: Speed and direction control with feedback
- Air Conditioning: AC compressor and recirculation control
- Auxiliary Heating: Seat warmers, steering wheel, and mirror heating
- Safety Features: Defrost and defogging capabilities

- Memory Systems: Position storage and recall
- Comfort Features: Heating, cooling, and massage functions
- Movement Control: Multi-axis positioning and adjustment
- Safety Integration: Occupancy detection and airbag coordination

- Dependency Mapping: Identify property relationships
- Implementation Planning: Get step-by-step development guidance
- Source Code Analysis: Access real Android implementations
- Best Practices: Learn from existing property patterns

To use with MCP-compatible clients, configure the server endpoint and ensure proper tool registration. The server automatically discovers and exposes all available vHAL analysis tools.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.