mcp-server
v0.1.0Official Batu Energy MCP server — CFE bills, payment status, files, collection jobs, and monitoring for AI agents
Official Batu Energy MCP server. Gives AI agents (Claude, Cursor, any MCP client) direct access to Mexican power-sector data: CFE bills, payment status, bill files, collection jobs, and monitoring. Every tool maps to a documented route of the public Batu API v1 and acts with the permissions of the API key you configure. 1. Create an API key in the Batu dashboard (Credenciales → API). 2. Add the server to your MCP client config:
Summary extracted from the README.
@batuenergy/mcp-server
Official Batu Energy MCP server. Gives AI agents (Claude, Cursor, any MCP client) direct access to Mexican power-sector data: CFE bills, payment status, bill files, collection jobs, and monitoring.
Every tool maps to a documented route of the public Batu API v1 and acts with the permissions of the API key you configure.
Setup
- Create an API key in the Batu dashboard (Credenciales → API).
- Add the server to your MCP client config:
{
"mcpServers": {
"batu": {
"command": "npx",
"args": ["-y", "@batuenergy/mcp-server@0.1.0"],
"env": { "BATU_API_KEY": "bk_..." }
}
}
}
Claude Code: claude mcp add batu -e BATU_API_KEY=bk_... -- npx -y @batuenergy/mcp-server@0.1.0
Pin the version (@0.1.0 above) rather than floating latest, so a restart can't
silently pull a new (or compromised) publish.
Tools
| Tool | Wire | What it does |
|---|---|---|
batu_list_tax_rates |
GET /utility/tax-rates |
List tax regimes and the fraction each applies to a bill subtotal — iva at 0.16 and iva_frontera at 0.08 for the northern border zone. |
batu_list_utility_contracts |
GET /utility/contracts |
List the utility contracts bonded to the caller’s sites — the agreements Batu collects bills against, one per service point. |
batu_get_utility_contract |
GET /utility/contracts/{id} |
Retrieve one utility contract by id (uct_...), including version — the optimistic-locking token — and deleted_at, which is non-null on a soft-deleted contract. |
batu_list_bills |
GET /bills |
List CFE electricity bills accessible to the API key. |
batu_get_bill |
GET /bills/{id} |
Retrieve a single CFE bill by its id (bil_...), including full line-item concepts with a concept_meaning legend explaining each CFE charge. |
batu_get_payment_status |
GET /payment-status |
Latest payment status per RPU: one row per CFE service with payment_status (pending|paid|overdue|unknown), due_date, and period_end of the most recent bill. |
batu_list_files |
GET /files |
List bill files (PDF, XML/CFDI, images). |
batu_download_files_zip |
POST /files/zip |
Bundle every bill file matching the filter into one ZIP and return a presigned download URL (1-hour TTL). |
batu_collect_bills |
POST /jobs |
Queue a CFE bill-collection job for an RPU. |
batu_get_bill_aggregates |
GET /bills/aggregates |
Monthly spend and consumption totals across the bills an API key can see — one row per billing month with total_sum (MXN, string), kwh_sum and bill_count. |
batu_get_job |
GET /jobs/{id} |
Get the status of a job (job_...) — a bill collection, a payment check or a site metrics collection. |
batu_list_jobs |
GET /jobs |
List the jobs the org has queued, newest first — bill collections, payment checks and site metrics collections in one list. |
batu_get_job_stats |
GET /jobs/stats |
Counts of the org's jobs by status (queued, running, completed, partial_success, failed, cancelled) — one counter per status, so unfiltered they sum to the same corpus batu_list_bills' job list reports as total. |
batu_collect_bills_batch |
POST /jobs/batch |
Queue bill collection for many RPUs in ONE call (up to 500). |
batu_retry_job |
POST /jobs/{id}/retry |
Requeue a FAILED job for another attempt. |
batu_get_monitoring |
GET /monitoring |
Monitoring state per RPU: whether recurring bill collection (monitoring) and recurring payment checks (payment_monitoring) are active, plus collection health — last_collection {job_id, status, error_code} and latest_period_end. |
batu_stop_monitoring |
DELETE /monitoring/{rpu} |
Stop recurring monitoring for an RPU. |
batu_start_monitoring |
POST /monitoring/{rpu} |
Start recurring monitoring for an RPU Batu already holds a contract for. |
batu_check_payment_now |
POST /monitoring/{rpu}/payment-check |
Run one payment-status check for an RPU immediately instead of waiting for the next daily run. |
batu_whoami |
GET /health/me |
Identity probe for the current API key: returns the key id (apk_...) and the org id (org_...) it belongs to. |
batu_get_energy_summary |
GET /sites/{site_public_id}/energy-summary |
Aggregate energy metrics for a site over a time window: total consumption (kWh), peak demand (kW), rolling 15-min max demand, solar generation, expected_generation (the design simulation, when the site has one), benchmarks (the generation a linked PPA or installer warranty guarantees, when the site has one), plus a CFE TOU breakdown (base/intermedio/punta) for time-of-use tariffs. |
batu_get_monitoring_status |
GET /sites/{site_public_id}/monitoring-status |
Derived health verdict for a site's metering: overall status (active/warning/error/paused/inactive) plus the evidence — reasons (what degraded it) and provenance (per signal: collection, data_quality, freshness, payment, configuration — observed when, and whether stale). |
batu_list_monitoring_status |
GET /monitoring-status |
The SAME health verdict as batu_get_monitoring_status, for one page of the organization's live sites at once — the go-to read for "which of my sites are down?". |
batu_get_energy_summary_batch |
POST /sites/energy-summary/batch |
batu_get_energy_summary for MANY site/window pairs in ONE call — use this instead of looping the single read when comparing sites. |
batu_get_metrics_topology |
GET /metrics/graph/{view} |
The org's metering topology, three pivots: "sites" (sites → devices → metric streams), "site-metrics" (sites → metrics → sources, includes asset-less CSV/derivation sources), "integrations" (integrations → credential statuses → devices → site assignments). |
batu_get_asset_fleet |
GET /asset-fleet |
Fleet health overview: every asset with connection health (live/unstable/disconnected/never), last-seen provenance, data quality, measured variables, and site deployments. |
batu_get_asset_health |
GET /asset-fleet/{asset_public_id} |
Deep health detail for ONE asset: the fleet summary plus every metric it feeds (fed_metrics — stream, type, cadence, per-feed freshness/data-quality) and whether it carries a per-asset credential. |
batu_list_metric_coverages |
GET /metrics/coverages |
Ingestion coverage windows per metric source: [started_at, ended_at) spans of persisted data (ended_at null = still open) with point counts. |
batu_compute_bill |
POST /sites/{site_public_id}/computed-bills |
Compute a simulated CFE bill for a site as DATA — per-charge line items (concept, quantity, unit rate, amount), the consumption/demand quantities they price, and subtotal/tax/total (fixed-decimal strings, IVA included). |
batu_compute_bill_pdf |
POST /sites/{site_public_id}/bill-pdf |
Compute a simulated CFE bill for a site over a window (from the site's measured energy and published tariff rates), rendered as a PDF. |
batu_get_bill_pdf |
GET /sites/{site_public_id}/bill-pdf |
Fetch a fresh download link for an ALREADY-generated bill PDF (site + month) — no recompute; link expires in ~15 minutes. |
batu_collect_site_metrics |
POST /sites/{site_public_id}/collect |
Trigger a REAL device-data pull for every active source at a site (the metrics collect verb). |
batu_get_site_collections |
GET /sites/{site_public_id}/collections |
DEPRECATED — use batu_list_jobs (filter target_type "site", target_id the site id, type "metrics_collect") for the list, and batu_get_job for one run. |
batu_get_savings |
GET /sites/{site_public_id}/savings |
Deprecated — use batu_list_reports / batu_get_report (GET /v1/sites/{id}/reports). |
batu_get_savings_window |
GET /sites/{site_public_id}/savings-window |
Every persisted savings cycle for a site inside a window, on one track — per-cycle baseline/deductions/gross/net/percentage with the EXACT persisted cycle bounds, the energy-credit balance, and the bills the read considered. |
batu_generate_savings |
POST /sites/{site_public_id}/savings |
Deprecated — use batu_create_report (POST /v1/sites/{id}/reports). |
batu_create_report |
POST /sites/{site_public_id}/reports |
Compute and persist ONE report of a site for a window, and return it. |
batu_list_reports |
GET /sites/{site_public_id}/reports |
Every report of a site whose period overlaps a window — the NEWEST report per (kind, period), newest period first. |
batu_get_report |
GET /sites/{site_public_id}/reports/{report_id} |
One report by id (rpt_...) — any version, including one a newer computation of the same period has replaced in batu_list_reports. |
batu_list_report_schedules |
GET /sites/{site_public_id}/report-schedules |
The site’s live report schedules — one recurring report subscription per (kind, track): utility_bill schedules run per collected CFE bill (on_bill), calendar schedules run monthly on run_day. |
batu_create_report_schedule |
POST /sites/{site_public_id}/report-schedules |
Subscribe a site to a recurring report (kind + track + first_period; run_day 1–28 for calendar, absent for utility_bill). |
batu_update_report_schedule |
PATCH /sites/{site_public_id}/report-schedules/{report_schedule_id} |
Pause/resume (active), move run_day or change baseline_basis of a report schedule, with its current version from batu_list_report_schedules (409 when stale — re-list and retry). |
batu_list_savings_configs |
GET /sites/{site_public_id}/savings-configs |
Deprecated since release 1 — nothing to configure; use batu_create_report (POST /v1/sites/{id}/reports), which derives eligibility. |
batu_get_savings_config |
GET /sites/{site_public_id}/savings-configs/{savings_config_id} |
Deprecated since release 1 — nothing to configure; use batu_create_report (POST /v1/sites/{id}/reports), which derives eligibility. |
batu_create_savings_config |
POST /sites/{site_public_id}/savings-configs |
Deprecated since release 1 — nothing to configure; use batu_create_report (POST /v1/sites/{id}/reports), which derives eligibility. |
batu_list_sites |
GET /sites |
List sites (physical locations) in the org, with pagination. |
batu_get_site |
GET /sites/{id} |
Get one site by id (sit_...), including its full location sub-resource, metadata, version, customer_id, lifecycle_status and contract_count. |
batu_list_assets |
GET /metrics/assets |
List assets (physical devices — inverters, meters, batteries) in the org. |
batu_get_asset |
GET /metrics/assets/{id} |
Get one asset by id (ast_...). |
batu_list_metric_streams |
GET /metrics/streams |
List metric streams — the (site, metric-type) channels that hold time-series (e.g. a site's solar_generation stream). |
batu_get_metric_stream |
GET /metrics/streams/{id} |
Get one metric stream by id (mst_...). |
batu_get_stream_data |
GET /metrics/streams/{metric_stream_id}/data |
A metric stream's normalized time series over a UTC window — the raw data behind every energy read. |
batu_get_stream_availability |
GET /metrics/streams/{metric_stream_id}/availability |
Where a metric stream actually has data — coverage windows and gaps over a UTC window, derived live from the stored readings (outages inside a collected day show up). |
batu_get_source_data |
GET /metrics/sources/{metric_source_id}/data |
ONE metric source's time series — the diagnostic drill-down behind the blended stream read. |
batu_list_metric_sources |
GET /metrics/sources |
List metric sources — the per-integration feeds that populate a stream (a stream can have several redundant sources, priority-spliced). |
batu_get_metric_source |
GET /metrics/sources/{id} |
Get one metric source by id (msr_...). |
batu_list_integrations |
GET /metrics/integrations |
List available integrations (vendor connectors, e.g. Growatt) with their capability manifest. |
batu_get_integration |
GET /metrics/integrations/{id} |
Get one integration by id (int_...), including its capability manifest. |
batu_list_metric_types |
GET /metrics/types |
List metric types (the measurement vocabulary, e.g. solar_generation, consumption). |
batu_list_makes |
GET /metrics/makes |
List device makes (manufacturers, e.g. growatt, sma). |
batu_list_credentials |
GET /admin/credentials |
List vendor credentials configured for the org (secret values never returned). |
batu_explore_integration |
POST /metrics/integrations/{id}/explore |
Discover the devices reachable through an integration credential (does not persist anything). |
batu_provision_assets |
POST /sites/provision |
Batch-onboard sites + devices + metric streams in one call — the fastest path from "vendor credential" to "collecting data". |
batu_get_organization |
GET /admin/organization |
The organization this API key belongs to — its name, slug, logo_url and segment. |
batu_get_organization_settings |
GET /admin/organization/settings |
The organization’s reporting defaults and its site-lifecycle vocabulary. |
batu_list_members |
GET /admin/members |
The people in the organization — the roster you assign sites to. |
batu_get_member |
GET /admin/members/{member_id} |
One member by membership id (mem_...) — use when you have an id from a site-assignee list and want the person behind it. |
batu_list_site_assignees |
GET /sites/{site_public_id}/assignees |
Who is responsible for a site. |
batu_assign_site_member |
POST /sites/{site_public_id}/assignees |
Make a member responsible for a site. |
batu_unassign_site_member |
DELETE /sites/{site_public_id}/assignees/{member} |
Remove a member’s responsibility for a site. |
batu_link_site_contract |
PATCH /sites/{site_public_id}/contract |
Move a utility contract (an RPU) to a site. |
Account-administration writes and raw per-entity mutations are intentionally not
exposed as tools; sources are onboarded through batu_provision_assets.
Typical agent flows
- Onboard and analyze:
batu_collect_bills(rpu, monitor: true)→ pollbatu_get_job→batu_list_bills(rpu)→ analyze consumption/charges. - Payment watch:
batu_get_payment_status()→ flagoverduerows. - Document pull:
batu_download_files_zip(rpu, type: "pdf")→ single URL. - Hand a site over:
batu_list_members(search: "…")→ take themem_…id →batu_assign_site_member(site_public_id, member)→ confirm withbatu_list_site_assignees. Passing aprf_…profile id is rejected.
Environment
| Variable | Required | Default |
|---|---|---|
BATU_API_KEY |
yes | — |
BATU_API_URL |
no | https://app.batuenergy.com/api/v1 |
Auth note: the server exchanges your API key for a short-lived JWT and
refreshes it automatically; the key itself is only sent to /v1/auth/token.
Trust boundary —
BATU_API_URL. Your API key is POSTed to${BATU_API_URL}/auth/token. Only ever pointBATU_API_URLat a Batu-operated host (prodapp.batuenergy.com, or a staging URL you control). Setting it to an untrusted host would send your key there. Leave it unset to use prod.