aminghadersohi commented on code in PR #37964:
URL: https://github.com/apache/superset/pull/37964#discussion_r2848362660
##########
superset/mcp_service/mcp_config.py:
##########
@@ -75,6 +75,38 @@
"config": None, # No additional config
}
+# ---------------------------------------------------------------------------
+# Known Superset UI features that may not exist in all deployments.
+# Use these constants when configuring MCP_UNAVAILABLE_FEATURES to ensure
+# consistent naming across deployments. Custom strings are also accepted.
+# ---------------------------------------------------------------------------
+MCP_FEATURE_ACTION_LOG = "Action Log (Settings > Security > Action Log)"
+MCP_FEATURE_LIST_USERS = "List Users page (Settings > List Users)"
+MCP_FEATURE_LIST_ROLES = "List Roles page (Settings > List Roles)"
+
+# Convenience list of all known Superset-only features for reference.
Review Comment:
Good call — the naming was confusing. I've removed the static
`MCP_FEATURE_*` constants entirely. The MCP service now dynamically detects
what's available via the security manager and feature flags instead of
maintaining a separate list with ambiguous naming.
##########
superset/mcp_service/mcp_config.py:
##########
@@ -75,6 +75,38 @@
"config": None, # No additional config
}
+# ---------------------------------------------------------------------------
+# Known Superset UI features that may not exist in all deployments.
+# Use these constants when configuring MCP_UNAVAILABLE_FEATURES to ensure
+# consistent naming across deployments. Custom strings are also accepted.
+# ---------------------------------------------------------------------------
+MCP_FEATURE_ACTION_LOG = "Action Log (Settings > Security > Action Log)"
+MCP_FEATURE_LIST_USERS = "List Users page (Settings > List Users)"
+MCP_FEATURE_LIST_ROLES = "List Roles page (Settings > List Roles)"
+
+# Convenience list of all known Superset-only features for reference.
+MCP_ALL_KNOWN_FEATURES: list[str] = [
+ MCP_FEATURE_ACTION_LOG,
+ MCP_FEATURE_LIST_USERS,
+ MCP_FEATURE_LIST_ROLES,
+]
+
+# Features unavailable in this deployment that LLMs should not suggest.
+# Override in superset_config.py to list features not available in your
deployment.
+# You can use the constants above or pass custom strings.
+#
+# Example using constants:
+# from superset.mcp_service.mcp_config import (
+# MCP_FEATURE_ACTION_LOG, MCP_FEATURE_LIST_USERS, MCP_FEATURE_LIST_ROLES,
+# )
+# MCP_UNAVAILABLE_FEATURES = [
+# MCP_FEATURE_ACTION_LOG, MCP_FEATURE_LIST_USERS, MCP_FEATURE_LIST_ROLES,
+# ]
+#
+# Example using custom strings:
+# MCP_UNAVAILABLE_FEATURES = ["Action Log", "Some Custom Feature"]
+MCP_UNAVAILABLE_FEATURES: list[str] = []
Review Comment:
Agreed. The `get_instance_info` tool now queries
`security_manager.user_view_menu_names("menu_access")` and
`get_feature_flags()` at request time, so it reuses the same permission and
feature flag systems that drive the UI. `MCP_UNAVAILABLE_FEATURES` is kept only
as a minimal escape hatch for truly custom deployment-specific notes that can't
be inferred from those systems.
##########
superset/mcp_service/mcp_config.py:
##########
@@ -75,6 +75,38 @@
"config": None, # No additional config
}
+# ---------------------------------------------------------------------------
+# Known Superset UI features that may not exist in all deployments.
+# Use these constants when configuring MCP_UNAVAILABLE_FEATURES to ensure
+# consistent naming across deployments. Custom strings are also accepted.
+# ---------------------------------------------------------------------------
+MCP_FEATURE_ACTION_LOG = "Action Log (Settings > Security > Action Log)"
+MCP_FEATURE_LIST_USERS = "List Users page (Settings > List Users)"
+MCP_FEATURE_LIST_ROLES = "List Roles page (Settings > List Roles)"
+
+# Convenience list of all known Superset-only features for reference.
+MCP_ALL_KNOWN_FEATURES: list[str] = [
+ MCP_FEATURE_ACTION_LOG,
Review Comment:
You're right — I replaced the static approach. Feature availability is now
detected dynamically per-request from FAB menus and feature flags, so it stays
in sync automatically as features are added/removed/toggled. No manual list to
maintain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]