Skip to content

feat(mcp): broker read tools#7723

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

feat(mcp): broker read tools#7723
andypalmi wants to merge 1 commit into
feat/mcp-tools-shared-schemasfrom
feat/mcp-tools-broker-read

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Summary

Adds read-only MCP tools for the team broker (built-in MQTT broker) and 3rd-party broker surface in forge/ee/lib/mcp/tools/broker.js:

  • platform_list_broker_clients - GET /api/v1/teams/:teamId/broker/clients
  • platform_get_broker_client - GET /api/v1/teams/:teamId/broker/client/:username
  • platform_list_brokers - GET /api/v1/teams/:teamId/brokers
  • platform_get_broker - GET /api/v1/teams/:teamId/brokers/:brokerId
  • platform_list_broker_topics - GET /api/v1/teams/:teamId/brokers/:brokerId/topics
  • platform_get_broker_schema - GET /api/v1/teams/:teamId/broker/:brokerId/schema

All six tools carry readOnlyHint: true / destructiveHint: false and none of them return raw broker credentials.

Allow-lists the backing scopes in IMPLICIT_TOKEN_SCOPES['user:expert-mcp'] (forge/routes/auth/permissions.js):

  • broker:clients:list
  • broker:credentials:list
  • broker:topics:list

This scope is under special review (credential-sensitive category), so only these read tools are proposed here. The credential-issuing endpoints (broker client create/link, client password update, 3rd-party broker registration, raw credential fetch) and the non-credential write/delete surface (topic CRUD, lifecycle, delete client) are intentionally out of scope for this PR.

Closes #7711

Test plan

  • eslint clean on forge/ee/lib/mcp/tools/broker.js and forge/routes/auth/permissions.js
  • Endpoint URLs verified against the route definitions in forge/ee/routes/teamBroker/index.js, forge/ee/routes/teamBroker/3rdPartyBroker.js, and forge/ee/routes/teamBroker/schema.js

@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.61%. Comparing base (103f9ae) to head (cb1cf5c).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           feat/mcp-tools-shared-schemas    #7723      +/-   ##
=================================================================
+ Coverage                          75.41%   75.61%   +0.20%     
=================================================================
  Files                                426      427       +1     
  Lines                              22551    22574      +23     
  Branches                            5949     5949              
=================================================================
+ Hits                               17006    17069      +63     
+ Misses                              5545     5505      -40     
Flag Coverage Δ
backend 75.61% <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-broker-read branch from de587bd to c72a379 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-broker-read branch from c72a379 to 4b1fa96 Compare July 6, 2026 16:38
Add read-only MCP tools for MQTT broker clients, brokers, topics and schema, with unit and equivalence tests. Allow-list their scopes for the expert-mcp platform token.
@andypalmi andypalmi force-pushed the feat/mcp-tools-broker-read branch from 4b1fa96 to cb1cf5c 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.13-a Read tools (phase 1)

1 participant