Skip to content

feat(mcp): remote instance (device) read tools#7726

Open
andypalmi wants to merge 3 commits into
feat/mcp-tools-shared-schemasfrom
feat/mcp-tools-team-data-read
Open

feat(mcp): remote instance (device) read tools#7726
andypalmi wants to merge 3 commits into
feat/mcp-tools-shared-schemasfrom
feat/mcp-tools-team-data-read

Conversation

@andypalmi

@andypalmi andypalmi commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 1 read-only MCP tools for the remote instance (device) resource, added to forge/ee/lib/mcp/tools/devices.js:

  • platform_get_remote_instance_audit_log - GET /devices/:deviceId/audit-log
  • platform_export_remote_instance_audit_log - GET /devices/:deviceId/audit-log/export
  • platform_get_remote_instance_history - GET /devices/:deviceId/history
  • platform_list_remote_instance_http_tokens - GET /devices/:deviceId/httpTokens
  • platform_list_team_provisioning_tokens - GET /teams/:teamId/devices/provisioning

Each tool describes the device resource, so all are filed with the existing device tools, following the one-file-per-resource convention. All tools are annotated readOnlyHint: true, destructiveHint: false.

Device history is plan-gated on feature key projectHistory (defaults to enabled); when disabled the route returns a 404 regardless of the caller's permissions, so the tool surfaces a clear "feature not enabled for this team" message instead of a bare not-found. platform_list_team_provisioning_tokens returns the summary view, which omits the token secret.

Scopes allow-listed in IMPLICIT_TOKEN_SCOPES['user:expert-mcp'] (forge/routes/auth/permissions.js):

  • device:audit-log
  • project:history
  • team:device:provisioning-token:list

(device:edit was already present from the shipped device tools.)

Write, delete, and credential-issuing endpoints for this resource are out of scope for this PR.

Closes #7708

Test plan

  • eslint on changed files passes with no errors
  • CI

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.54%. Comparing base (103f9ae) to head (4cc7f56).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           feat/mcp-tools-shared-schemas    #7726      +/-   ##
=================================================================
+ Coverage                          75.41%   75.54%   +0.12%     
=================================================================
  Files                                426      426              
  Lines                              22551    22572      +21     
  Branches                            5949     5949              
=================================================================
+ Hits                               17006    17051      +45     
+ Misses                              5545     5521      -24     
Flag Coverage Δ
backend 75.54% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andypalmi andypalmi force-pushed the feat/mcp-tools-team-data-read branch from 9ccc25a to 6a6f4cb Compare July 4, 2026 13:33
@andypalmi andypalmi linked an issue Jul 6, 2026 that may be closed by this pull request
@andypalmi andypalmi force-pushed the feat/mcp-tools-shared-schemas branch from 8bfb22e to 9742987 Compare July 6, 2026 13:13
@andypalmi andypalmi force-pushed the feat/mcp-tools-team-data-read branch from 6a6f4cb to 9d267f6 Compare July 6, 2026 16:39
Add read-only MCP tools for team databases and tables, npm packages, git tokens and shared library entries, with unit and equivalence tests. Also let the shared library route accept the expert-mcp platform token. Allow-list their scopes for the expert-mcp platform token.
@andypalmi andypalmi force-pushed the feat/mcp-tools-team-data-read branch from 9d267f6 to 737394c Compare July 6, 2026 22:01
@andypalmi andypalmi changed the title feat(mcp): team data and package read tools feat(mcp): remote instance (device) read tools Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5.12-a Remote instance (device) read tools (phase 1)

1 participant