Repository navigation
feat(mcp): dynamic feature availability via menus and feature flags - #37964
Antonio-RiveroMartnez merged 9 commits into
Conversation
Code Review Agent Run #8dd73aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #37964 +/- ##
===========================================
+ Coverage 0 66.38% +66.38%
===========================================
Files 0 670 +670
Lines 0 51469 +51469
Branches 0 5810 +5810
===========================================
+ Hits 0 34169 +34169
- Misses 0 15905 +15905
- Partials 0 1395 +1395
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:
|
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #590807Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
The features in |
Code Review Agent Run #9642bbActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…c warnings When the MCP service can't answer a user's question via available tools, LLMs may suggest Superset UI features that don't exist in all deployments (e.g., Action Log, List Users in Preset). This adds a configurable list that gets injected into MCP instructions so LLMs know not to suggest them.
Add MCP_FEATURE_ACTION_LOG, MCP_FEATURE_LIST_USERS, MCP_FEATURE_LIST_ROLES constants and MCP_ALL_KNOWN_FEATURES convenience list so deployers can reference well-known features instead of guessing string values. Addresses review feedback requesting a standard way to discover available feature names for the config. Also fixes test docstring line-length violation (E501).
…tion Instead of maintaining a static list of MCP_FEATURE_* constants that operators must manually keep in sync, dynamically detect feature availability at request time by querying: - FAB security manager for accessible menus (user_view_menu_names) - Feature flag manager for enabled/disabled flags (get_feature_flags) - MCP_UNAVAILABLE_FEATURES as a minimal escape hatch for custom notes The get_instance_info tool now returns a feature_availability section with accessible_menus, enabled_feature_flags, and custom_unavailable_features, giving LLMs accurate per-user context without stale hardcoded lists.
8921e1e to
b0ed63c
Compare
Dynamic detection via menus and feature flags makes this config redundant. No reason to keep a static escape hatch when the same information is already available from existing systems.
Code Review Agent Run #b128d6Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Only expose accessible_menus — feature flags are internal implementation details that add noise and potential security surface area.
Code Review Agent Run #f1d8c0Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…pache#37964) (cherry picked from commit 1cd35bb)
SUMMARY
When the MCP service can't answer a user's question via available tools, LLMs fall back to suggesting UI features that may not exist in a given deployment. This misleads users.
This PR adds dynamic feature detection to
get_instance_infoso LLMs know what's actually available at request time:get_instance_infonow returns afeature_availabilitysection containingaccessible_menus— the menu items the current user can access (viasecurity_manager.user_view_menu_names("menu_access"))get_instance_infofor feature availability instead of assuming what existsWhy dynamic? Menus already track what's available per-user and per-deployment via FAB role permissions. Querying them at request time means feature availability stays in sync automatically — no manual configuration needed.
Example
get_instance_inforesponse (truncated){ "instance_summary": { "total_dashboards": 0, "total_charts": 0, "total_datasets": 15, ... }, "current_user": { "id": 1, "username": "admin", "first_name": "Admin I.", ... }, "feature_availability": { "accessible_menus": [ "Action Log", "Alerts & Report", "Annotation Layers", "CSS Templates", "Charts", "Dashboards", "Data", "Databases", "Datasets", "Extensions", "Home", "List Groups", "List Roles", "List Users", "Manage", "Plugins", "Query Search", "Row Level Security", "SQL Editor", "SQL Lab", "Saved Queries", "Security", "Tags", "Tasks", "Themes", "User Registrations" ] }, "timestamp": "2026-02-24T18:23:43.927486Z" }BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - backend change, no UI impact
TESTING INSTRUCTIONS
Automated Tests
QA Manual Testing Steps
Test 1: Feature availability in get_instance_info
get_instance_infofeature_availabilitywithaccessible_menuspopulated from the user's FAB permissionsTest 2: Per-user menu access
get_instance_infoaccessible_menusonly contains menus the user hasmenu_accesspermission for — admin-only menus should not appearTest 3: Instructions reference get_instance_info
get_instance_infofor accessible menusADDITIONAL INFORMATION