feat/batu-mcp
needs attentionviewing older commit0e187bd · incrementalPR #199reviewed 2026-07-10 04:39 UTC0H · 1M · 2L · 2I- 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
- 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+412−0packages/mcp-server/scripts/live-smoke.mjs+138−0packages/mcp-server/README.md+34−2.claude/skills/sync-mcp-tools/SKILL.md+83−0apps/platform/src+19−0
- Blast
- 8 files, +686/−2. Additive only. MCP server is private:true, not yet on npm.
Findings · 5
conventions2
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.
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
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.
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
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.