aiseg2-mcp
This server is a read-only MCP bridge to a Panasonic AiSEG2 home energy system, letting an MCP client (e.g. Claude) query live power flow, per-circuit usage, and long-term history/cost from the device.
get_power_flow: Current whole-home generation/consumption (kW), buy/sell state, battery status, generation sources, and top consuming circuits.get_circuit_breakdown: Instantaneous watt draw of every measured circuit, ranked highest first, with total draw.list_circuits: Authoritative list of registered circuit IDs and names.get_daily_totals: Today's cumulative generation, consumption, grid-buy, and grid-sell in kWh.get_history: Long-term energy history (Wh) from the AiSEG2's SD-card export, with granularity from 30-minute to yearly, filters, and pagination.get_cost_history: Long-term energy-cost history (JPY) from the SD-card export, with day/month/year granularity and pagination.All tools are read-only and safe; the server never changes device settings.
Provides read-only tools to retrieve live power flow, per-circuit consumption, circuit names, daily energy totals, and long-term energy/cost history from a Panasonic AiSEG2 home energy management (HEMS) controller's local web interface.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@aiseg2-mcp what's my current power flow and solar generation?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
aiseg2-mcp
日本語版は README.ja.md をご覧ください。
An unofficial, read-only Model Context Protocol server for the Panasonic AiSEG2 home energy management (HEMS) controller. It lets an MCP client (e.g. Claude) read your home's live power flow, per-circuit consumption, circuit names, and daily energy totals from the AiSEG2's local web interface.
This project is not affiliated with or endorsed by Panasonic. "AiSEG" is a Panasonic trademark.
Verified environment
Developed and tested against:
AiSEG2 model MKN713 series
Firmware Ver.2.97I-01
The AiSEG2 web interface is undocumented and changes between firmware revisions. On a different model or firmware the pages this server scrapes may differ and some tools may not work. If you hit a parse error, please open an issue with your model / firmware version.
Related MCP server: emoncms-mcp-server
Tools
All tools are read-only (annotated readOnlyHint, non-destructive, with a human-readable
title). The server only issues GETs and the display-only refresh POSTs the web UI itself uses; it
never touches settings or any /action/ endpoint.
Every result carries as_of (ISO 8601, UTC): when the server read the values from the AiSEG2, or
for the two history tools, when the SD-card export behind them was downloaded.
Tool | Title | Returns |
| Current power flow | Instantaneous generation/consumption (kW), buy/sell state, battery status, generation sources, top consuming circuits |
| Current power by circuit | Every measured circuit's instantaneous draw (W), ranked highest first, with the total |
| Registered circuits | Registered circuit ids and names (the authoritative naming source) |
| Today's energy totals | Today's cumulative generation / consumption / grid-buy / grid-sell (kWh) |
| Energy history | Long-term energy history from the SD-card export (Wh), long-form points. Args: |
| Energy cost history | Long-term energy-cost history from the SD-card export (JPY). Args: |
The two history tools require an SD card inserted in the AiSEG2 — they read the device's SD-card CSV export. The export is downloaded once and cached (see
AISEG_CACHE_DIR/AISEG_CACHE_TTL), so the first call is slow and later calls are fast.
Install & run
Three ways to run it, depending on your setup.
1. uvx (PyPI — once published)
The simplest option for a local (stdio) MCP client. Requires uv.
AISEG_URL=http://192.168.0.216 AISEG_PASSWORD=... uvx aiseg2-mcpAdd it to Claude Code:
claude mcp add aiseg2 \
--env AISEG_URL=http://192.168.0.216 \
--env AISEG_PASSWORD=your-digest-password \
-- uvx aiseg2-mcp2. docker run (GHCR)
The container defaults to the streamable-http transport (long-lived network service). Only expose
it behind an authenticating proxy — see Security.
docker run --rm -p 8000:8000 \
-e AISEG_URL=http://192.168.0.216 \
-e AISEG_PASSWORD=your-digest-password \
ghcr.io/chanyou0311/aiseg2-mcp:latest3. From source
Requires Python 3.12+ and uv.
uv sync
AISEG_URL=http://192.168.0.216 AISEG_PASSWORD=... uv run aiseg2-mcpRemote (authenticated claude.ai Custom Connector)
To reach the server from claude.ai while your AiSEG2 stays on your LAN, see
examples/remote/ — a Docker Compose stack (MCP + GitHub-OAuth proxy +
Cloudflare Tunnel).
Running the image
This repo's job ends at pushing the image to GHCR. Where and how it actually runs (Kubernetes manifests, etc.) is defined elsewhere — for the maintainer's own deployment, in fumo-infra. The table below is the contract another system builds against to run this image.
Image & tags |
|
Listens on |
|
Health checks | liveness: |
Required env |
|
Optional env (default) |
|
There is no deployment definition (Kubernetes manifests) in this repo.
Configuration (environment variables)
Variable | Required | Default | Description |
| yes | — | AiSEG2 base URL, e.g. |
| yes | — | HTTP Digest password for the AiSEG2 web UI |
| no |
| HTTP Digest user |
| no |
|
|
| no |
| Bind host (streamable-http only) |
| no |
| Bind port (streamable-http only) |
| no |
| Disable the Host allowlist (by default only |
| no |
| Where the SD-card history export is cached |
| no |
| Seconds to reuse a cached history export before re-downloading |
| no |
| Log level |
Security
LAN-only by design. The AiSEG2 speaks plain HTTP with Digest auth; keep it and this server on a trusted local network. The password is read from the environment and is never logged.
Read-only. There is no tool that changes a device setting. The tool surface is enforced by tests (registered-tool allowlist, tool-name guard, a source scan for
/action/, and read-only annotation checks).Do not expose the
streamable-httptransport to untrusted networks without authentication. This server carries no auth of its own; if you run it as a network service, put an authenticating reverse proxy in front of it.AISEG_DISABLE_DNS_REBINDING_PROTECTION=trueis only appropriate in that proxied setup.
Acknowledgements
The AiSEG2 web interface is undocumented; this project builds on the reverse-engineering knowledge shared by prior work:
shimosyan/aiseg2-influxdb-forwarder — the circuit-paging "repeat the last page" terminator and the electric-flow fields.
hiroaki0923/aiseg2-bridge — endpoint and page structure.
Bugfire/aiseg_download — Digest auth and data-endpoint conventions.
License
Available Tools
6 toolsget_circuit_breakdownARead-onlyIdempotent
Read-only. Get the instantaneous power draw of every measured circuit, ranked highest first.
Pages through the AiSEG2's circuit list and returns each circuit's rank, name and watts, plus
the total measured watts and how many device pages were read. Circuit names here are
display-derived (they may wrap); list_circuits() is the authoritative name source.
Inputs: no named parameters. Returns: Per-circuit instantaneous consumption, paged out of the AiSEG2 and stitched tog…
get_cost_historyARead-onlyIdempotent
Read-only. Query the AiSEG2's long-term energy-cost history from the SD-card export (JPY).
Requires an SD card inserted in the AiSEG2. Shares the same cached download as get_history.
Returns long-form cost points ({timestamp, metric, value}) with values in Japanese yen.
Args:
granularity: "day" takes start/end as YYYY-MM-DD; "month" as YYYY-MM; "year" as YYYY.
start: Range start (inclusive), formatted per the granularity.
end: Range end (inclusive), formatted per the granularity.
limit: Maximum number of series points to return (default 200).
offset: Number of points to skip (for pagination).
Inputs: end (required), start (required), granularity (required), limit, +1 more. Returns: A paginated slice of long-term series data. ``unit`` distinguishes energy (Wh)…
get_daily_totalsARead-onlyIdempotent
Read-only. Get today's cumulative energy totals (kWh) as of the AiSEG2's current day.
Returns generation, consumption, grid-buy and grid-sell totals for the day. Any meter the device reports as unavailable ("-") comes back as null.
Inputs: no named parameters. Returns: Today's cumulative energy totals in kWh (as of the AiSEG2's current day).
get_historyARead-onlyIdempotent
Read-only. Query the AiSEG2's long-term energy history from its SD-card export (values in Wh).
Requires an SD card inserted in the AiSEG2. The export is downloaded once and cached, so the
first call is slow and later calls are fast. Returns long-form points ({timestamp, metric,
value}); use limit/offset to page (limit caps the number of returned points).
Args:
granularity: Time resolution. "30min"/"hour"/"day" take start/end as YYYY-MM-DD; "month"
takes YYYY-MM; "year" takes YYYY.
start: Range start (inclusive), formatted per the granularity.
end: Range end (inclusive), formatted per the granularity.
metrics: Optional filter by standard series keys (e.g. "generation_pv1", "grid_buy",
"grid_sell", "battery_charge", "battery_discharge", "ev_charge") or their Japanese
header names. Omit for all series.
circuits: Optional filter by circuit name (see list_circuits). Omit for all circuits.
limit: Maximum number of series points to return (default 200).
offset: Number of points to skip (for pagination).
Inputs: end (required), start (required), granularity (required), limit, +3 more. Returns: A paginated slice of long-term series data. ``unit`` distinguishes energy (Wh)…
get_power_flowARead-onlyIdempotent
Read-only. Get the AiSEG2's instantaneous whole-home power flow right now.
Returns current generation and consumption (kW), whether the home is buying or selling grid power, storage-battery status if a battery is connected, the per-source generation breakdown, and the top consuming circuits at this moment.
Inputs: no named parameters. Returns: The instantaneous whole-home power flow (the AiSEG2 "electric flow" screen).
list_circuitsARead-onlyIdempotent
Read-only. List the registered measurement circuits with their stable ids and names.
This is the AUTHORITATIVE source of circuit naming (from the device's installation settings).
The names in get_circuit_breakdown() are display-derived and may differ (line wraps); prefer
these when you need a canonical circuit name.
Inputs: no named parameters. Returns: The registered circuit names — the authoritative source of circuit naming.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct aspect: instantaneous overview, per-circuit draw, canonical names, daily totals, historical energy, and historical cost. The only slight overlap is get_power_flow's top circuits vs get_circuit_breakdown, but descriptions clearly differentiate summary versus full detail.
All tools use snake_case verb_noun patterns: get_ for data retrieval and list_ for enumerating resources. The naming is consistent and predictable, following a clear convention.
6 tools is well-scoped for a read-only energy monitoring API. Each tool provides a distinct piece of data without being redundant or overwhelming.
The tool set covers current status, per-circuit breakdown, canonical circuit list, daily cumulative totals, long-term history, and cost history. For a monitoring-focused server, this is complete and leaves no obvious dead ends.
Maintenance
Related MCP Connectors
MCP server wrapping the Tesla Fleet API and TeslaMate API
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for the Octopus Energy Japan GraphQL API that allows users to retrieve electricity consumption, cost estimates, and contract details. It enables 30-minute interval usage analysis and postal code area searches while ensuring privacy by excluding personal address information.320 npm1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for EmonCMS energy monitoring API, enabling AI assistants to query energy feeds, inputs, and historical data.1MIT
- AlicenseAqualityBmaintenanceUnofficial MCP server for the messdienst24.de utility portal, providing tools to retrieve heating and hot-water consumption data, download PDF reports, and compare usage trends.3MIT
- AlicenseBqualityDmaintenanceRead-only MCP server integrating with the Victron VRM API to monitor solar systems, batteries, alarms, and more.4122 npm6MIT