aminghadersohi opened a new pull request, #40347: URL: https://github.com/apache/superset/pull/40347
### SUMMARY Adds four new MCP (Model Context Protocol) tools to Apache Superset across two new domains: **Row Level Security (`superset/mcp_service/rls/`):** - `list_rls_filters` — list RLS filters with filtering, search, column selection, sorting, and pagination. Requires admin access. - `get_rls_filter_info` — get full RLS filter details by ID (name, type, tables, roles, clause, group key). Requires admin access. **Dynamic Plugins (`superset/mcp_service/plugin/`):** - `list_plugins` — list registered dynamic plugins with filtering, search, column selection, sorting, and pagination. - `get_plugin_info` — get plugin details by ID (name, key, bundle_url, timestamps). Both domains follow the established MCP service patterns: - `@tool` decorator with `class_permission_name` for RBAC (`"Row Level Security"`, `"DynamicPlugin"`) - `ModelListCore` / `ModelGetInfoCore` from `mcp_core.py` for reusable list/get logic - Pydantic schemas with `model_serializer` for column-filtered responses - `ColumnOperator`/`ColumnOperatorEnum` for structured filter objects - `event_logger` instrumentation and FastMCP `ctx` logging The `DynamicPluginDAO` is co-located in `superset/mcp_service/plugin/dao.py` since no top-level DAO existed for the `DynamicPlugin` model. The `DEFAULT_INSTRUCTIONS` in `app.py` are updated to clarify that `get_schema` covers chart/dataset/dashboard/database resource types only; RLS and plugin tools document their filterable/sortable columns inline in their docstrings. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — backend MCP tools only. ### TESTING INSTRUCTIONS 1. Start the MCP service 2. Connect with an MCP client (e.g. Claude Desktop) 3. Call `list_rls_filters` — returns paginated RLS filters with id, name, filter_type, clause by default 4. Call `list_rls_filters` with `select_columns: ["id", "name", "tables", "roles"]` — includes relationship data 5. Call `get_rls_filter_info` with a valid RLS filter ID — returns full filter details 6. Call `list_plugins` — returns paginated plugin list with id, name, key, bundle_url by default 7. Call `get_plugin_info` with a valid plugin ID — returns full plugin details Unit tests: `pytest tests/unit_tests/mcp_service/rls/ tests/unit_tests/mcp_service/plugin/` ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
