Battery Health MCP
by Ahmad-1276
README.md
# Battery Health MCP
Monitor battery charge, power source, health, and charging behavior.



## Tools
| Tool | Description |
| --- | --- |
| `get_battery_status` | Charge percentage, plugged state, and estimated time left |
| `get_battery_health` | Design capacity, current capacity, health percentage, and cycle count |
| `get_power_source` | Whether the machine is running on AC or battery |
| `get_power_profile` | Active power/performance profile or CPU governor |
| `get_battery_summary` | Combined battery, health, source, and profile report |
## Requirements
- Python 3.10+
- `pip install -e .`
## Install
```bash
git clone https://github.com/Ahmad-1276/battery-health-mcp.git
cd battery-health-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
```
## Run
```bash
battery-health-mcp
# or
python -m battery_health_mcp.server
```
The server speaks the MCP stdio protocol and waits for a client.
## Connect an MCP client
Add this to your client's MCP config (Claude Desktop, Cursor, VS Code, etc.):
```json
{
"mcpServers": {
"battery-health": {
"command": "/absolute/path/to/.venv/bin/battery-health-mcp",
"args": []
}
}
}
```
Use the absolute path to the executable inside your virtual environment. On Windows the path is `.venv\Scripts\battery-health-mcp.exe`.
## Example prompts
- How much battery is left?
- Is the laptop plugged in?
- What is the battery health and cycle count?
- Which power profile is active?
## Notes
Desktops and servers return `available: false`. Detailed health data is read from Linux sysfs or macOS `system_profiler`; Windows may only expose charge state.
## Development
```bash
pip install -e ".[dev]"
pytest -q
```
## License
MIT — see [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues