painful-bug/Panasonic-MirAIe-MCP-Server
If you are the rightful owner of Panasonic-MirAIe-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server that enables control of Panasonic MirAIe air conditioning devices through conversational AI.
Panasonic MirAIe AC MCP Server
A Model Context Protocol (MCP) server that enables control of Panasonic MirAIe air conditioning devices through conversational AI. This server provides comprehensive AC control capabilities including temperature setting, mode changes, fan control, and device management.
Features
Device Control
- Power Management: Turn devices on/off individually or all at once
- Temperature Control: Set temperature (16-30°C) for specific devices or all devices
- Mode Control: Switch between operating modes (auto, cool, heat, dry, fan)
- Fan Control: Adjust fan speed (auto, low, medium, high)
- Preset Modes: Set energy-saving presets (none, eco, boost)
Advanced Controls
- Swing Control:
- Vertical swing modes (positions 0-5)
- Horizontal swing modes (positions 0-5)
- Device Management:
- List all connected devices
- Get detailed device information
- Individual device targeting by name
Supported Operations
get_device_status
- List all available AC devicesturn_on_device
- Power on specific device or all devicesturn_off_device
- Power off specific device or all devicesset_temperature
- Set temperature for specific device or all devicesset_fan_mode
- Control fan speed settingsset_mode
- Change AC operating modeset_preset_mode
- Apply energy presetsset_vertical_swing_mode
- Control vertical air directionset_horizontal_swing_mode
- Control horizontal air directionget_device_details
- Get comprehensive device information
Requirements
Python Dependencies
mcp>=0.1.0
python-dotenv
asyncio
fastapi (optional, for REST API)
Environment Setup
The server requires Panasonic MirAIe account credentials configured as environment variables:
MIRAIE_LOGIN_ID=your_phone_number_or_email
MIRAIE_PASSWORD=your_password
Installation & Setup
1. Clone and Install Dependencies
git clone https://github.com/painful-bug/Panasonic-MirAIe-MCP-Server.git
# OR
git clone https://github.com/Saboten758/Panasonic-MirAIe-MCP-Server.git
#THEN
cd miraie_mcp
pip install mcp python-dotenv
2. Configure Environment
Create a .env
file in the project root:
MIRAIE_LOGIN_ID=your_phone_number_or_email
MIRAIE_PASSWORD=your_password
A sample env is also provided as .env.sample
3. MCP Configuration
Add to your MCP client configuration (e.g., Claude Desktop config):
{
"mcpServers": {
"panasonic-miraie-ac": {
"command": "python",
"args": ["/path/to/miraie_mcp/miraie_mcp.py"],
"env": {
"MIRAIE_LOGIN_ID": "your_credentials",
"MIRAIE_PASSWORD": "your_password"
}
}
}
}
4. Run the Server
python miraie_mcp.py
Usage Examples
Basic Device Control
# Turn on all AC units
"Turn on all AC devices"
# Turn off a specific device
"Turn off the living room AC"
# Set temperature for all devices
"Set all ACs to 24 degrees"
# Set temperature for specific device
"Set the bedroom AC to 22 degrees"
Mode and Fan Control
# Change operating mode
"Set all ACs to cooling mode"
"Switch bedroom AC to auto mode"
# Adjust fan speed
"Set fan to high speed for all devices"
"Change living room AC fan to low"
# Apply presets
"Set all ACs to eco mode"
"Enable boost mode for bedroom AC"
Advanced Controls
# Control swing modes
"Set vertical swing to position 3 for all ACs"
"Change horizontal swing to auto for bedroom AC"
# Get device information
"Show me all available AC devices"
"Get details for the living room AC"
FastAPI Integration
The project includes an optional FastAPI server (fastapi_server.py
) for REST API access:
uvicorn fastapi_server:app --reload
API Endpoints
GET /devices
- Get all device statusPOST /devices/on
- Turn on all devicesPOST /devices/off
- Turn off all devicesPOST /devices/temperature
- Set temperature for all devicesPOST /device/control
- Control specific device
Architecture
Core Components
miraie_mcp.py
- Main MCP server implementationapi.py
- Panasonic MirAIe API clientdevice.py
- Device abstraction and control logicenums.py
- Enumeration definitions for modes and statesfastapi_server.py
- Optional REST API server
Authentication Types
Supports multiple authentication methods:
- Mobile phone number
- Email address
- Username
Device Management
- Automatic device discovery upon connection
- Context-managed device connections
- Error handling and device validation
- Support for multiple simultaneous devices
Troubleshooting
Common Issues
- Authentication Errors: Verify credentials in
.env
file - Device Not Found: Check device name spelling and availability
- Connection Issues: Ensure stable internet connection
- Permission Errors: Verify MirAIe account has device access
Debug Mode
Enable debug logging by setting stderr output in the terminal:
python miraie_mcp.py 2>debug.log
Security Notes
- Store credentials securely using environment variables
- Never commit credentials to version control
- Use secure network connections for device communication
- Regularly update authentication tokens
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly with actual devices
- Submit a pull request
License
[Add your license information here]
Support
For issues and support:
- Check the troubleshooting section
- Review device compatibility
- Open an issue with detailed error logs
- Include device model and network setup details