fix: use live activity-log and per-device alert endpoints - #43
Merged
Conversation
Two report endpoints hardcoded paths that 404 against the live Datto
BCDR API:
- ActivityResource hit /report/v2/activity-log; the real endpoint has no
/v2/ segment. Now calls /report/activity-log.
- AlertsResource hit /report/v2/alert, a portal-wide endpoint that does
not exist (both /report/v2/alert and /report/alert 404). Datto only
exposes alerts per device at /bcdr/device/{serialNumber}/alert.
Replaced the portal-wide list() with listByDevice()/listAllByDevice()
and reworked listAll() to fan out across every device, stamping each
alert with its source serialNumber.
The MSW mocks were mocking the buggy paths, so no test caught this;
handlers now target the real endpoints.
Refs wyre-technology/datto-bcdr-mcp#54, wyre-technology/datto-bcdr-mcp#55
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 15, 2026
## [2.0.2](v2.0.1...v2.0.2) (2026-07-15) ### Bug Fixes * use live activity-log and per-device alert endpoints ([#43](#43)) ([1d4c25a](1d4c25a)), closes [wyre-technology/datto-bcdr-mcp#54](wyre-technology/datto-bcdr-mcp#54) [wyre-technology/datto-bcdr-mcp#55](wyre-technology/datto-bcdr-mcp#55)
|
🎉 This PR is included in version 2.0.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two hardcoded report endpoints that 404 against the live Datto BCDR API. Root-caused from bug reports datto-bcdr-mcp#54 and datto-bcdr-mcp#55.
#54 — Activity log (path typo)
ActivityResourcecalled/report/v2/activity-log. The live endpoint has no/v2/segment:/report/activity-log. Confirmed by the reporter via direct portal curl (404 vs 200). One-line path fix inlist()andlistAll().#55 — Alerts (no portal-wide endpoint)
AlertsResourcecalled/report/v2/alert, a portal-wide endpoint that does not exist — both/report/v2/alertand/report/alert404. Datto only exposes alerts per device:GET /bcdr/device/{serialNumber}/alert.Restructured to match the per-device idiom already used by
AssetsResource:listByDevice(serialNumber, params)— one device, single pagelistAllByDevice(serialNumber, params)— one device, async iterablelistAll(params)— fans out over every device and yields each device's alerts, stamping each with its sourceserialNumberso the flattened stream stays attributableThe old portal-wide
list()is removed (it never worked — always 404).listAll()keeps the same call signature, so thedatto-bcdr-mcpconsumer (client.alerts.listAll()) works unchanged and now returns real data.Why no test caught this
The MSW mocks were mocking the buggy paths (
/report/v2/alert,/report/v2/activity-log), so the suite validated the bug. Handlers now target the real endpoints; added coverage for per-device alerts, the fleet-wide fan-out (incl. serialNumber stamping and empty-device handling), and the non-v2 activity path.Verification
npm test— 33 passed (6 files)npm run typecheck— cleannpm run lint— cleannpm run build— successVersioning
Classified
fix:→ patch release (2.0.2), which stays insidedatto-bcdr-mcp's^2.0.1range, so the MCP picks it up automatically on its next install.