-
Notifications
You must be signed in to change notification settings - Fork 82
Filter MCP features based on granular RBACs #6494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6494 +/- ##
=======================================
Coverage 76.42% 76.43%
=======================================
Files 396 397 +1
Lines 19890 19987 +97
Branches 4771 4808 +37
=======================================
+ Hits 15201 15277 +76
- Misses 4689 4710 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Costin Serban <[email protected]>
|
Merged main to see if unrelated (flaky?) e2e test passes... |
Description
Introduce RBAC for Expert Insights MCP features, to ensure that users only see and interact with MCP server features they have permission to access based on the granular RBACS
The most important changes are:
RBAC and Permission System Enhancements:
expert:insights:mcp:allow,expert:insights:mcp:tool:destructive) to thePermissionsobject inforge/lib/permissions.jsfilterAccessibleMCPServerFeaturesfunction in new fileforge/services/expert.js. This is called once in the MCP listing endpoint (for displaying to users) and every time the user chats (to ensure validity before posting to the BE service.Backend API Changes (Expert API):
/expertroutes inforge/routes/api/expert.jsto:Model and Data Structure Updates:
ProjectandDevicemodels inforge/ee/db/models/MCPRegistration.jsto include thestateto preven requesting MCP features from an instance that isnt supposed to be running (avoid timeouts)applicationfield to the MCP server item schema to improve association between instances and their applicationsFrontend tweaks:
frontend/src/components/expert/components/CapabilitiesSelector.vueto hide sections in the tooltip (e.g. if there are no tools, dont show the tools header and empty section!)Test Updates:
test/unit/forge/routes/api/expert_spec.jsto include thestateandApplicationIdfields in test data, aligning tests with the new RBAC and filtering logicExpert API->service enabled->MCP features Endpoint->✔ should only get permitted mcp features when granular RBACs is enabledRelated Issue(s)
closes #6491
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionChangelog for MCP annotations and RBACs website#4381
Labels
area:migrationlabel