Skip to content

feat(mcp): snapshot read tools#7720

Open
andypalmi wants to merge 1 commit into
feat/mcp-tools-shared-schemasfrom
feat/mcp-tools-snapshots-read
Open

feat(mcp): snapshot read tools#7720
andypalmi wants to merge 1 commit into
feat/mcp-tools-shared-schemasfrom
feat/mcp-tools-snapshots-read

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Summary

Adds the phase 1 read-only snapshot tools to forge/ee/lib/mcp/tools/snapshots.js:

  • platform_get_hosted_instance_snapshotGET /api/v1/projects/:instanceId/snapshots/:snapshotId
  • platform_get_remote_instance_snapshotGET /api/v1/devices/:deviceId/snapshots/:snapshotId
  • platform_get_snapshotGET /api/v1/snapshots/:id
  • platform_get_snapshot_fullGET /api/v1/snapshots/:id/full
  • platform_list_instance_target_devicesGET /api/v1/projects/:instanceId/devices
  • platform_get_instance_device_settingsGET /api/v1/projects/:instanceId/devices/settings

All tools are annotated readOnlyHint: true, destructiveHint: false.

Allow-lists the backing scopes for the user:expert-mcp token type in forge/routes/auth/permissions.js:
project:snapshot:read, device:snapshot:read, snapshot:meta, snapshot:full.

Base is feat/mcp-tools-shared-schemas since this depends on the shared pagination schema fragments; it will retarget to main once that PR merges.

Closes #7687

Test plan

  • eslint on changed files (also ran via pre-commit hook)
  • Manually loaded forge/ee/lib/mcp/tools/snapshots.js to confirm all tool definitions export correctly

@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 (09497ea).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           feat/mcp-tools-shared-schemas    #7720      +/-   ##
=================================================================
+ Coverage                          75.41%   75.54%   +0.13%     
=================================================================
  Files                                426      426              
  Lines                              22551    22557       +6     
  Branches                            5949     5943       -6     
=================================================================
+ Hits                               17006    17041      +35     
+ Misses                              5545     5516      -29     
Flag Coverage Δ
backend 75.54% <100.00%> (+0.13%) ⬆️

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-snapshots-read branch from 5fa6a86 to 84edc1f 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-snapshots-read branch from 84edc1f to 64a8111 Compare July 6, 2026 16:39
Add read-only MCP tools to get hosted and remote instance snapshots and the instance snapshot/device target, with unit and equivalence tests. Entity ids use the shared schema fragments. Allow-list their scopes for the expert-mcp platform token.
@andypalmi andypalmi force-pushed the feat/mcp-tools-snapshots-read branch from 64a8111 to 09497ea Compare July 6, 2026 22:01
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.2-a Read tools (phase 1)

1 participant