Aiseg2 Mcp

io.github.chanyou0311由 GitHub 账号 chanyou0311 发布v0.1.0更新于 Oct 24, 2026

Unofficial read-only MCP server for the Panasonic AiSEG2 HEMS controller.

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

非官方只读 MCP 服务器,让助手读取 Panasonic AiSEG2 家庭能源管理控制器的实时电力流向、分回路用电与能源历史。

可以做什么
  • 读取实时电力流向:瞬时发电与用电、买电/卖电状态、电池状态及耗电最高的回路
  • 查看回路:按用电量从高到低排列的各回路瞬时功率,以及已登记回路的编号与名称
  • 读取当日能源汇总:累计发电、用电、购电与售电
  • 查询长期能源历史:支持 30 分钟至年度的粒度,可按指标与回路筛选并分页
  • 查询费用历史:按日、月或年查看以日元计的长期能源费用历史
适用场景
适合让助手回答家中光伏、电池及各回路用电情况的问题,或回顾局域网内 AiSEG2 的历史用电与费用趋势。
运行要求
以 stdio 方式在本机运行,通常通过 PyPI 的 uvx(需安装 uv)或从源码运行(需 Python 3.12 以上),也提供容器镜像。需要 AISEG_URL(AiSEG2 基础地址,仅支持 http)与 AISEG_PASSWORD(HTTP Digest 密码),AISEG_USER 默认为 aiseg。两个历史工具需要 AiSEG2 中插入 SD 卡,并在本地缓存导出文件。
安装前请注意
AISEG_PASSWORD 为机密,且会通过明文 HTTP 发送给设备,请将两者都限制在可信局域网内。服务器自身不带认证;若以 streamable-http 网络服务方式运行,应前置带认证的反向代理,并避免关闭 DNS 重绑定保护。该项目为非官方,未在其他型号或固件上验证,可能出现解析失败。工具为只读,不会修改设备设置。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Aiseg2 Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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.

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.

ToolTitleReturns
get_power_flowCurrent power flowInstantaneous generation/consumption (kW), buy/sell state, battery status, generation sources, top consuming circuits
get_circuit_breakdownCurrent power by circuitEvery measured circuit's instantaneous draw (W), ranked highest first, with the total
list_circuitsRegistered circuitsRegistered circuit ids and names (the authoritative naming source)
get_daily_totalsToday's energy totalsToday's cumulative generation / consumption / grid-buy / grid-sell (kWh)
get_historyEnergy historyLong-term energy history from the SD-card export (Wh), long-form points. Args: granularity (30min/hour/day/month/year), start/end (per granularity: YYYY-MM-DD, YYYY-MM, or YYYY), optional metrics/circuits filters, limit/offset paging
get_cost_historyEnergy cost historyLong-term energy-cost history from the SD-card export (JPY). Args: granularity (day/month/year), start/end, limit/offset

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.

bash
AISEG_URL=http://192.168.0.216 AISEG_PASSWORD=... uvx aiseg2-mcp

Add it to Claude Code:

bash
claude mcp add aiseg2 \  --env AISEG_URL=http://192.168.0.216 \  --env AISEG_PASSWORD=your-digest-password \  -- uvx aiseg2-mcp

2. docker run (GHCR)

The container defaults to the streamable-http transport (long-lived network service). Only expose it behind an authenticating proxy — see Security.

bash
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:latest

3. From source

Requires Python 3.12+ and uv.

bash
uv syncAISEG_URL=http://192.168.0.216 AISEG_PASSWORD=... uv run aiseg2-mcp

Remote (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 & tagsghcr.io/chanyou0311/aiseg2-mcp:sha-<7hex> on every push to main (created timestamp = the source commit's time, not the build time); a vX.Y.Z release tag additionally publishes X.Y.Z, X.Y, and latest
Listens on8000/tcp — streamable-http MCP endpoint at /mcp
Health checksliveness: GET /health; readiness: TCP connect on port 8000
Required envAISEG_URL, AISEG_PASSWORD (secret)
Optional env (default)AISEG_USER (aiseg), AISEG_TRANSPORT (streamable-http — set as an image-level ENV; the package's own default, e.g. when run via uvx, is stdio), AISEG_HOST (0.0.0.0), AISEG_PORT (8000), AISEG_DISABLE_DNS_REBINDING_PROTECTION (false), AISEG_CACHE_DIR (<tempdir>/aiseg2-mcp-cache), AISEG_CACHE_TTL (3600), LOG_LEVEL (info) — see Configuration below for details

There is no deployment definition (Kubernetes manifests) in this repo.

Configuration (environment variables)

VariableRequiredDefaultDescription
AISEG_URLyes—AiSEG2 base URL, e.g. http://192.168.0.216 (http only)
AISEG_PASSWORDyes—HTTP Digest password for the AiSEG2 web UI
AISEG_USERnoaisegHTTP Digest user
AISEG_TRANSPORTnostdiostdio or streamable-http
AISEG_HOSTno0.0.0.0Bind host (streamable-http only)
AISEG_PORTno8000Bind port (streamable-http only)
AISEG_DISABLE_DNS_REBINDING_PROTECTIONnofalseDisable the Host allowlist (by default only localhost / 127.0.0.1 / [::1] Host headers are accepted) — only behind a trusted auth proxy
AISEG_CACHE_DIRno<tempdir>/aiseg2-mcp-cacheWhere the SD-card history export is cached
AISEG_CACHE_TTLno3600Seconds to reuse a cached history export before re-downloading
LOG_LEVELnoinfoLog 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-http transport 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=true is 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:

License

MIT

来源:README.md,提交 9b34317

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分