Skip to content

feat(mcp): team read tools - #7722

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

feat(mcp): team read tools#7722
andypalmi wants to merge 3 commits into
feat/mcp-tools-shared-schemasfrom
feat/mcp-tools-teams-read

Conversation

@andypalmi

@andypalmi andypalmi commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 1 read-only MCP tools for the team resource, added to forge/ee/lib/mcp/tools/teams.js. This covers team lookups, membership, the team audit log, and team-scoped data and packages:

  • platform_get_team_by_slug - GET /teams/slug/:teamSlug
  • platform_get_team_instance_counts - GET /teams/:teamId/instance-counts
  • platform_check_team_slug_availability - POST /teams/check-slug
  • platform_get_team_membership - GET /teams/:teamId/user
  • platform_list_team_members - GET /teams/:teamId/members
  • platform_list_team_invitations - GET /teams/:teamId/invitations
  • platform_get_team_audit_log - GET /teams/:teamId/audit-log
  • platform_export_team_audit_log - GET /teams/:teamId/audit-log/export
  • platform_list_team_npm_packages - GET /teams/:teamId/npm/packages
  • platform_list_team_git_tokens - GET /teams/:teamId/git/tokens
  • platform_list_library_entries - GET /storage/library/:libraryId/*

Each tool describes the team resource, so the membership tools and the team-data tools all fold into teams.js, following the one-file-per-resource convention (rather than separate members.js/teamData.js files). All tools are annotated readOnlyHint: true, destructiveHint: false. platform_check_team_slug_availability uses POST but performs no mutation, so it is annotated read as well.

The team-data surfaces (npm, gitIntegration, shared-library) are plan-gated; the tools turn a feature-disabled 404 into a clear "feature not enabled" message.

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

  • team:user:list
  • team:user:invite
  • team:audit-log
  • team:packages:read
  • team:git:tokens:list
  • library:entry:list
  • team:create

(team:read was already present.)

Tools that describe a different resource are filed elsewhere: instance lists in instances.js, application statuses in applications.js, provisioning tokens in devices.js, and team types in platform.js. Their backing scopes move with them.

FlowFuse Tables tools (platform_list_team_databases, platform_get_team_database, platform_list_database_tables, platform_get_database_table, platform_query_database_table_data) are split out to #7990, tracked by #7989.

Write, destructive, and admin-only tools for this resource are out of scope for this PR.

Closes #7693

Test plan

  • eslint on changed files passes
  • Tool modules load and export the expected tool definitions (verified with a local require smoke check)
  • 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.73%. Comparing base (103f9ae) to head (b675d3f).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           feat/mcp-tools-shared-schemas    #7722      +/-   ##
=================================================================
+ Coverage                          75.41%   75.73%   +0.32%     
=================================================================
  Files                                426      426              
  Lines                              22551    22592      +41     
  Branches                            5949     5950       +1     
=================================================================
+ Hits                               17006    17110     +104     
+ Misses                              5545     5482      -63     
Flag Coverage Δ
backend 75.73% <100.00%> (+0.32%) ⬆️

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-teams-read branch from 8721ef6 to a6ff64d 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-teams-read branch from a6ff64d to 9f4845e Compare July 6, 2026 16:39
Add read-only MCP tools for team lookup, dashboards, audit log, members and invitations, with unit and equivalence tests. Query params are url-encoded via the shared appendQuery helper. Allow-list their scopes for the expert-mcp platform token.
@andypalmi
andypalmi force-pushed the feat/mcp-tools-teams-read branch from 9f4845e to aff2226 Compare July 6, 2026 22:01
@andypalmi andypalmi changed the title feat(mcp): teams and membership read tools feat(mcp): team read tools Jul 7, 2026
The 5 FlowFuse Tables tools (platform_list_team_databases,
platform_get_team_database, platform_list_database_tables,
platform_get_database_table, platform_query_database_table_data)
are being tracked and shipped in a separate PR instead. Remove them
and the redactDatabaseCredentials helper, their tests, and the
team:database:list scope that only backed these tools.
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.4-a Team read tools (phase 1)

1 participant