feat(mcp): hosted instance read tools - #7727
Open
andypalmi wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7727 +/- ##
==========================================
+ Coverage 76.17% 76.22% +0.05%
==========================================
Files 440 440
Lines 23604 23655 +51
Branches 6285 6293 +8
==========================================
+ Hits 17981 18032 +51
Misses 5623 5623
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:
|
andypalmi
force-pushed
the
feat/mcp-tools-instance-config-read
branch
from
July 4, 2026 13:33
04324b4 to
6af352f
Compare
andypalmi
force-pushed
the
feat/mcp-tools-shared-schemas
branch
from
July 6, 2026 13:13
8bfb22e to
9742987
Compare
andypalmi
force-pushed
the
feat/mcp-tools-instance-config-read
branch
from
July 6, 2026 16:38
6af352f to
fdafd47
Compare
andypalmi
force-pushed
the
feat/mcp-tools-instance-config-read
branch
from
July 6, 2026 22:01
fdafd47 to
df8ad04
Compare
andypalmi
marked this pull request as draft
July 30, 2026 08:22
andypalmi
force-pushed
the
feat/mcp-tools-shared-schemas
branch
from
August 3, 2026 13:19
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
andypalmi
force-pushed
the
feat/mcp-tools-shared-schemas
branch
from
August 3, 2026 14:13
eae081f to
e04360f
Compare
andypalmi
force-pushed
the
feat/mcp-tools-instance-config-read
branch
from
August 3, 2026 15:26
283ad01 to
4206424
Compare
andypalmi
marked this pull request as ready for review
August 4, 2026 10:33
andypalmi
force-pushed
the
feat/mcp-tools-instance-config-read
branch
from
August 4, 2026 10:55
4206424 to
526dcd3
Compare
andypalmi
force-pushed
the
feat/mcp-tools-instance-config-read
branch
from
August 4, 2026 11:04
526dcd3 to
da1f501
Compare
This was referenced Aug 4, 2026
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_config- one configuration reader taking asectionsarray (any subset ofha,protection,autoUpdateStack; defaults to all). Backed byGET /projects/:id/ha,GET /projects/:id/protectInstance, andGET /projects/:id/autoUpdateStack, returning each requested section independently.platform_get_instance_custom_hostname-GET /projects/:id/customHostname, with anincludeStatusboolean that additionally fetches the live verification status fromGET /projects/:id/customHostname/status.platform_list_instance_files-GET /projects/:id/files/_/:pathplatform_list_instance_http_tokens- takesinstanceType(hostedorremote); lists the HTTP bearer tokens for a hosted or remote instance.platform_get_hosted_instance_audit_log-GET /projects/:id/audit-log, with aformatargument:jsonreads entries directly,csvexports the CSV viaGET /projects/:id/audit-log/export.platform_get_instance_history- takesinstanceType(hostedorremote); returns the timeline for a hosted or remote instance.platform_get_hosted_instance_resources-GET /projects/:id/resourcesplatform_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_dashboard_instanceshangs off a team URL but lists 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 that section passes 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(hosted instance history)device:history(remote instance history, via the generalized history tool)(
project:readandteam:projects:listwere already present.)Write, delete and admin-only tools for this resource are out of scope for this PR.
Consolidation notes
platform_get_instance_ha,platform_get_instance_protection, andplatform_get_instance_auto_update_stackare merged intoplatform_get_instance_config, which takes asectionsarray (subset ofha/protection/autoUpdateStack, defaults to all) and returns each requested section independently.platform_get_instance_custom_hostnameandplatform_get_instance_custom_hostname_statusare merged intoplatform_get_instance_custom_hostname, with anincludeStatusboolean that also fetches the live verification status.platform_export_hosted_instance_audit_logis removed;platform_get_hosted_instance_audit_loggains aformatargument (jsonreads entries,csvuses the export route).platform_list_instance_http_tokensandplatform_get_instance_history(renamed fromplatform_get_hosted_instance_history) take aninstanceType(hostedorremote) and now also serve remote instances, replacing the remote-only variants dropped from feat(mcp): remote instance (device) read tools #7726.platform_list_team_projectsis dropped; its capability is folded intoplatform_list_hosted_instances, which gainedsort,dir, andorderByMostRecentFlowsfor the team-wide listing.platform_list_hosted_instancesreuses the shared fragments (teamId,applicationId,searchQuery,sortParams.dir) fromforge/ee/lib/mcp/schemas.jsinstead of re-declaring them inline; its bespokelimit(max 10) andsortenum stay inline.Closes #7705
Test plan
eslintclean on the changed filesmochaunit tests