Skip to content

feat(mcp): catalog read tools - #7721

Open
andypalmi wants to merge 3 commits into
mainfrom
feat/mcp-tools-catalog-read
Open

feat(mcp): catalog read tools#7721
andypalmi wants to merge 3 commits into
mainfrom
feat/mcp-tools-catalog-read

Conversation

@andypalmi

@andypalmi andypalmi commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Read tools for the platform catalogs, added to forge/ee/lib/mcp/tools/platform.js. Adds get-by-id lookups (the list variants already exist) and the team-type catalog reads:

  • platform_get_template - GET /templates/:templateId
  • platform_get_blueprint - GET /flow-blueprints/:flowBlueprintId
  • platform_list_team_types - GET /team-types
  • platform_get_team_type - GET /team-types/:teamTypeId

No stack or instance-type get-by-id tools: the existing platform_list_hosted_instance_types already returns every project-type nested with its full stacks and a defaultStack, and accepts a projectType argument to narrow to one type. GET /project-types/:id and GET /stacks/:id use the same views.ProjectType.projectType and views.ProjectStack.stack views that tool already returns, so platform_get_hosted_instance_type, platform_get_stack, and a standalone platform_list_stacks would be redundant and are not added.

Team types are a global platform catalog with no team in the path, mirroring project-types, so they are filed with the platform catalog tools following the one-file-per-resource convention. All tools are readOnlyHint: true, destructiveHint: false.

Scopes allow-listed for user:expert-mcp in forge/routes/auth/permissions.js:

  • template:read
  • flow-blueprint:read
  • team-type:list
  • team-type:read

Closes #7679

Test plan

  • eslint on changed files passes
  • 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 76.38%. Comparing base (a8f760b) to head (00e42a2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7721      +/-   ##
==========================================
+ Coverage   76.17%   76.38%   +0.20%     
==========================================
  Files         440      440              
  Lines       23604    23618      +14     
  Branches     6285     6285              
==========================================
+ Hits        17981    18040      +59     
+ Misses       5623     5578      -45     
Flag Coverage Δ
backend 76.38% <100.00%> (+0.20%) ⬆️

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-catalog-read branch from 439e08b to 5d7e091 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-catalog-read branch from 5d7e091 to a46d91f Compare July 6, 2026 16:38
@andypalmi
andypalmi force-pushed the feat/mcp-tools-catalog-read branch from a46d91f to 138f496 Compare July 6, 2026 22:01
@andypalmi
andypalmi marked this pull request as draft July 30, 2026 08:20
@andypalmi
andypalmi force-pushed the feat/mcp-tools-shared-schemas branch from 103f9ae to 5773bdb Compare August 3, 2026 13:19
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
andypalmi force-pushed the feat/mcp-tools-shared-schemas branch from eae081f to e04360f Compare August 3, 2026 14:13
@andypalmi
andypalmi force-pushed the feat/mcp-tools-catalog-read branch from 0bc2dce to 62ad4f3 Compare August 3, 2026 15:32
@andypalmi
andypalmi requested a review from cstns August 3, 2026 15:47
@andypalmi
andypalmi marked this pull request as ready for review August 3, 2026 15:47
Add read-only MCP tools to list and get stacks, hosted instance types, templates, blueprints and team types by id, allow-listing their scopes for the expert-mcp platform token.
@andypalmi
andypalmi force-pushed the feat/mcp-tools-catalog-read branch from 62ad4f3 to d91efd2 Compare August 3, 2026 15:57
@andypalmi andypalmi self-assigned this Aug 4, 2026
Base automatically changed from feat/mcp-tools-shared-schemas to main August 5, 2026 08:48
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.10 Catalog completeness

2 participants