feat(mcp): remote instance (device) read tools - #7726
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7726 +/- ##
=======================================
Coverage 75.94% 75.95%
=======================================
Files 445 445
Lines 23990 23994 +4
Branches 6404 6404
=======================================
+ Hits 18220 18224 +4
Misses 5770 5770
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9ccc25a to
6a6f4cb
Compare
8bfb22e to
9742987
Compare
6a6f4cb to
9d267f6
Compare
9d267f6 to
737394c
Compare
103f9ae to
5773bdb
Compare
Add forge/ee/lib/mcp/schemas.js, a shared module of composable zod fragments the platform read tools import instead of redefining entity-id and pagination/search/sort/audit-log query fields in each tool file. - entity-id params: teamId, applicationId, hostedInstanceId (UUID), remoteInstanceId, snapshotId - query fragments composed per route by spreading only the params the backing finder honors: cursorParam/limitParam (basePagination), pageParam, searchQuery, sortParams, auditLogFilters - appendQuery serialises a tool's supported params onto the request URL The module lives one level above tools/ so the tool loader does not register it as a tool module. Closes #7669
eae081f to
e04360f
Compare
4cc7f56 to
2e3e1d6
Compare
2e3e1d6 to
312b18b
Compare
…ata-read # Conflicts: # forge/routes/auth/permissions.js
…d tool The remote instance audit-log read, including its CSV export, is generalized as the shared platform_get_instance_audit_log tool that takes an instanceType argument, so the remote-only variant is removed here. This leaves platform_list_team_provisioning_tokens as the tool this change adds.
Restore devices_spec.js to its main baseline and add coverage only for the tool this change introduces.
Testing results of new/changed tools@cstns for visibility. This PR now adds a single tool,
Payloads below are redacted for ids, names and secrets; structural values (counts, statuses, error codes, and which fields are present) are verbatim. No credential secret is reproduced. platform_list_team_provisioning_tokensLists a team's device provisioning tokens. The summary view omits the token secret.
Findings
ConclusionThe single tool added in this PR verified against its description, including the secret-omission guarantee. No open defects. |
Summary
Phase 1 read-only MCP tool for the remote instance (device) resource, added to
forge/ee/lib/mcp/tools/devices.js:platform_list_team_provisioning_tokens-GET /teams/:teamId/devices/provisioning. Lists a team's device provisioning tokens. The summary view omits the token secret, so it is safe to expose read-only.The tool describes the device resource, so it is filed with the existing device tools, following the one-file-per-resource convention. It is annotated
readOnlyHint: true, destructiveHint: false.Consolidation notes
platform_get_instance_audit_log,platform_get_instance_history, andplatform_list_instance_http_tokenseach take aninstanceType: 'hosted' | 'remote'argument and live in the newforge/ee/lib/mcp/tools/shared-instances-devices.js, so they serve remote instances (devices) too and no remote-only variants are needed here.GET /devices/:id/audit-log/exportroute only produces CSV, which is not a useful shape for an automation tool; the sharedplatform_get_instance_audit_logreturns audit entries as JSON.Permissions
No permissions changes. #8185 removed the hardcoded
user:expert-mcpscope allow-list, so expert MCP tokens now inherit the user's permissions gated by team role and no allow-list entries are needed.Closes #7708
Test plan
eslintclean on the changed filesmochaunit tests