EG4 MCP Server
MCP server for EG4 solar inverters, enabling real-time monitoring, performance analysis, battery health, alerts, maintenance insights, and historical data via natural language.
README
EG4 MCP Server
An MCP (Model Context Protocol) Server for the EG4 Solar Inverter Monitoring API, providing comprehensive solar system monitoring and analysis capabilities.
Features
- 🔌 Real-time monitoring - Current production, consumption, and system status
- 📊 Performance analysis - Efficiency metrics and grid independence calculations
- 🔋 Battery health monitoring - SOH, SOC, and cycle count tracking
- ⚠️ Smart alerts - Proactive issue detection and notifications
- 🛠️ Maintenance insights - Automated recommendations and scheduling
- 📈 Historical data - Energy production and consumption trends
- 🏥 System health scoring - Component-level health assessment
Installation
Quick start (dev mode)
# 1. create & activate venv
cd eg4_mcp_server
python -m venv .venv
.venv\Scripts\activate # PowerShell: .venv\Scripts\Activate.ps1
# 2. install requirements
pip install -r requirements.txt
# 3. run the server
python server.py
### Prerequisites
- Python 3.10 or higher
- EG4 inverter with online monitoring account
- Access to EG4 monitoring portal credentials
### Install from PyPI
```bash
pip install eg4-mcp-server
Install from Source
- Clone the repository:
git clone https://github.com/yourusername/eg4-mcp-server.git
cd eg4-mcp-server
- Install dependencies:
pip install -e .
Configuration
- Copy the environment template:
cp .env.example .env
- Edit
.envwith your EG4 credentials:
EG4_USERNAME=your_eg4_username
EG4_PASSWORD=your_eg4_password
EG4_BASE_URL=https://monitor.eg4electronics.com
EG4_DISABLE_VERIFY_SSL=0
Usage
Running the MCP Server
Start the server directly:
python server.py
Or use the MCP CLI:
mcp run server.py
Available Tools
| Tool | Description |
|---|---|
Fetch_Configuration |
Get complete system configuration and status |
Get_System_Details |
Detailed system information and inverter specs |
Get_Current_Production |
Real-time production and consumption data |
Get_Performance_Analysis |
Performance metrics and efficiency analysis |
Get_Historical_Data |
Historical energy data and trends |
Get_System_Alerts |
System health alerts and warnings |
Get_System_Health |
Comprehensive health scoring |
Get_Maintenance_Insights |
Maintenance recommendations and scheduling |
Example Usage with Claude
-
Check current system status:
What's my solar system producing right now? -
Get performance analysis:
How is my solar system performing this week? -
Check for alerts:
Are there any issues with my solar system? -
Get maintenance recommendations:
What maintenance does my solar system need?
Integration with AI Assistants
This MCP server is designed to work with AI assistants that support the Model Context Protocol, such as:
- Claude Desktop - Add to your MCP configuration
- Other MCP-compatible clients
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"eg4": {
"command": "python",
"args": ["-m", "eg4_mcp_server"],
"env": {
"EG4_USERNAME": "your_username",
"EG4_PASSWORD": "your_password"
}
}
}
}
API Reference
Tool Parameters
Most tools accept optional parameters:
system_id(int, optional): Specific system ID (defaults to first system)days_back(int): Number of days for historical data (default varies by tool)threshold_percent(float): Performance threshold for maintenance insights
Response Format
All tools return JSON responses with:
timestamp: ISO format timestampdata: Tool-specific data structureerror: Error message if applicable
Example response:
{
"timestamp": "2025-06-24T10:30:00",
"system_status": "Normal",
"current_production": {
"solar_power": "2.5 kW",
"battery_discharge": "0.0 W",
"home_consumption": "1.8 kW"
}
}
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
- Fork the repository
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate - Install development dependencies:
pip install -e ".[dev]" - Make your changes and run tests:
pytest
Troubleshooting
Common Issues
-
Authentication Failed
- Verify your EG4 credentials in
.env - Check if your account has API access
- Verify your EG4 credentials in
-
SSL Certificate Errors
- Set
EG4_DISABLE_VERIFY_SSL=1in your.envfile - This disables SSL verification (use with caution)
- Set
-
No Inverters Found
- Ensure your account has associated inverters
- Check if inverters are online in the EG4 portal
-
Connection Timeouts
- Check your internet connection
- Verify the
EG4_BASE_URLis correct
Debug Mode
Enable verbose logging by setting the environment variable:
export EG4_DEBUG=1
python server.py
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the eg4_inverter_api library
- Powered by the Model Context Protocol
- Special thanks to the EG4 community for reverse-engineering efforts
Changelog
See CHANGELOG.md for version history and changes.
Support
- 📖 Documentation: Check this README and inline tool documentation
- 🐛 Bug Reports: Open an issue
- 💡 Feature Requests: Open an issue
- 💬 Discussions: GitHub Discussions
Note: This project is not officially affiliated with EG4 Electronics. It's a community-driven project for interfacing with EG4 monitoring systems.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。