aminghadersohi opened a new pull request, #40343: URL: https://github.com/apache/superset/pull/40343
### SUMMARY Adds 4 new MCP (Model Context Protocol) tools across two new domains: **CSS Template domain** (`superset/mcp_service/css_template/`): - `list_css_templates` – list with filtering/search/pagination; `css` field excluded from defaults (large), requestable via `select_columns` - `get_css_template_info` – fetch by ID or UUID **Theme domain** (`superset/mcp_service/theme/`): - `list_themes` – list with filtering/search/pagination; default columns include `id`, `theme_name`, `uuid` - `get_theme_info` – fetch by ID or UUID (includes `json_data` and `is_system` flags) Both domains follow the established patterns from `database/`, using `ModelListCore` and `ModelGetInfoCore` from `mcp_core.py`. Supporting changes: - `constants.py` – `ModelType` extended with `"css_template"` and `"theme"` - `schema_discovery.py` – column configs and getter functions for both models - `system/tool/get_schema.py` – CSS templates and themes registered for unified schema discovery - `app.py` – tool registration and instructions update ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A – backend MCP tools, no UI changes. ### TESTING INSTRUCTIONS 1. Start the MCP server 2. Use an MCP client to call `list_css_templates` and `list_themes` — both should return paginated results with default columns 3. Use `get_css_template_info` with a numeric ID or UUID — should return full CSS content 4. Use `get_theme_info` with a numeric ID or UUID — should return `json_data` and `is_system` flags 5. Use `get_schema` with `model_type="css_template"` and `model_type="theme"` — should return column/filter/sort metadata Unit tests: ``` pytest tests/unit_tests/mcp_service/css_template/ pytest tests/unit_tests/mcp_service/theme/ pytest tests/unit_tests/mcp_service/system/tool/test_get_schema.py ``` ### 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]
