feat(mcp): hosted instance read tools#7727
Open
andypalmi wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/mcp-tools-shared-schemas #7727 +/- ##
=================================================================
+ Coverage 75.41% 75.77% +0.36%
=================================================================
Files 426 426
Lines 22551 22598 +47
Branches 5949 5949
=================================================================
+ Hits 17006 17124 +118
+ Misses 5545 5474 -71
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:
|
04324b4 to
6af352f
Compare
8bfb22e to
9742987
Compare
6af352f to
fdafd47
Compare
Add read-only MCP tools for HA, custom hostnames, protected instance, auto-update stacks, static files and HTTP security config, with unit and equivalence tests. Allow-list their scopes for the expert-mcp platform token.
fdafd47 to
df8ad04
Compare
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.
Summary
Phase 1 read-only MCP tools for the hosted instance resource, added to
forge/ee/lib/mcp/tools/instances.js. This covers per-instance configuration surfaces, instance observability, and the team-scoped instance lists:platform_get_instance_ha-GET /projects/:id/haplatform_get_instance_custom_hostname-GET /projects/:id/customHostnameplatform_get_instance_custom_hostname_status-GET /projects/:id/customHostname/statusplatform_get_instance_protection-GET /projects/:id/protectInstanceplatform_get_instance_auto_update_stack-GET /projects/:id/autoUpdateStackplatform_list_instance_files-GET /projects/:id/files/_/:pathplatform_list_instance_http_tokens-GET /projects/:id/httpTokensplatform_get_hosted_instance_audit_log-GET /projects/:id/audit-logplatform_export_hosted_instance_audit_log-GET /projects/:id/audit-log/exportplatform_get_hosted_instance_history-GET /projects/:id/historyplatform_get_hosted_instance_resources-GET /projects/:id/resourcesplatform_list_team_projects-GET /teams/:teamId/projectsplatform_list_team_dashboard_instances-GET /teams/:teamId/dashboard-instancesEach tool describes the hosted instance resource, so all are filed with the existing hosted instance tools, following the one-file-per-resource convention.
platform_list_team_projectsandplatform_list_team_dashboard_instanceshang off team URLs but list hosted instances.All tools are annotated
readOnlyHint: true, destructiveHint: false. Several backing routes are plan-gated per team (High Availability, custom hostnames, protected instance, static file storage, HTTP bearer tokens, instance history, instance resources); since a disabled feature and a genuine not-found both return a 404, the affected tools turn that 404 into a descriptive "feature not enabled for this team" message. The auto-update-stack route has no feature gate, so its tool passes the response through unchanged. The/resources/streamWebSocket route is intentionally not exposed; only the point-in-time/resourcessnapshot is implemented.Scopes allow-listed for
user:expert-mcpinforge/routes/auth/permissions.js:project:edit(custom-hostname and HTTP-token reads)project:files:list(instance file listing)project:audit-log(instance audit log)project:history(instance history)(
project:readandteam:projects:listwere already present.)Write, delete and admin-only tools for this resource are out of scope for this PR.
Closes #7705
Test plan
eslintclean on the changed files