← all branches

feat/batu-mcp

needs attentionviewing older commit
0e187bd · incrementalPR #199reviewed 2026-07-10 04:39 UTC0H · 1M · 2L · 2I
The branch
Purpose
Add the official Batu MCP server — making Batu a one-line install in any MCP client (Claude Desktop, Cursor, Claude Code). Closes the gap between Batu's public API and agent-native access.
Goal
Ship @batu/mcp-server with 33 tools covering the full agent loop: bills, jobs, files, monitoring, webhooks, savings, energy summaries, and the full asset-management catalog.
Sub-goals
  • SG-1 (done): Core tools — bills, jobs, files, monitoring, webhooks
  • SG-2 (done): Energy/savings/identity tools
  • SG-3 (done): Asset-management read catalog (21 new tools this window)
  • SG-4 (done): batu_provision_assets — single batch API call
  • SG-5 (done): sync-mcp-tools skill + mcp-server.md rule
  • SG-6 (done): Live smoke test script
  • SG-7 (done): /developers MCP section + i18n
The changes (whole branch)
What
3 commits: sync-mcp-tools skill doc, live-smoke.mjs, 21 new asset-management tools in index.ts, README/docs updates, i18n keys for MCP section.
Why
Asset-management catalog lets agents understand an org's monitoring setup before configuring new devices. batu_provision_assets is the batch onboarding verb (single atomic API call).
Areas
packages/mcp-server/src/index.ts+4120packages/mcp-server/scripts/live-smoke.mjs+1380packages/mcp-server/README.md+342.claude/skills/sync-mcp-tools/SKILL.md+830apps/platform/src+190
Blast
8 files, +686/−2. Additive only. MCP server is private:true, not yet on npm.
private:true — not yet published to npm 33 tools registered (12 original + 21 new)
typecheck· CI not wired on self-hosted runner yettests· No automated test runcoderabbit· No .coderabbit.yaml

Findings · 5

conventions2

low

Missing .describe() on status/search in metric-streams and metric-sources

packages/mcp-server/src/index.ts

batu_list_metric_streams and batu_list_metric_sources have status/search params with no .describe(). Every other list tool annotates these. Add .describe() matching batu_list_assets wording.

low

amStatus missing 'decommissioned' — diverges silently from batu_list_sites

packages/mcp-server/src/index.ts

Shared amStatus = z.enum(['active','inactive']). batu_list_sites uses inline z.enum([...,'decommissioned']). If API accepts decommissioned for other resource types, those tools fail client-side.

tests2

medium

No param-wiring unit tests for 21 new tools

packages/mcp-server/src/__tests__/client.test.ts

21 new asset-management tools have no tests asserting HTTP method, path, or param names. The client.test.ts queue-and-assert pattern exists — extend it.

info

Smoke authFail guard: 404/400 pass as wire ok

packages/mcp-server/scripts/live-smoke.mjs:111

Guard matches 401|unauthorized|BATU_API_KEY only. A broken path returning 404/422 passes as 'curated error, wire ok'. Document this boundary.

improvement1

info

sync-mcp-tools skill run() description slightly circular

.claude/skills/sync-mcp-tools/SKILL.md:50

Clarify that the tool body should be run(() => client().request(...)) with no try/catch, since run already returns ToolResult.

History · 5 commits

  1. 59a73bdneeds attentionincremental1H · 6M · 5L2026-07-10 05:23
  2. 5ca7218needs attentionincremental2H · 5M · 5L2026-07-10 04:56
  3. 0e187bdneeds attentionincremental0H · 1M · 2L2026-07-10 04:39current
  4. 844f42fneeds attentionfull0H · 3M · 5L2026-07-09 20:13
  5. ee41aeaneeds attentionfull5H · 6M · 11L2026-07-09 19:12