aminghadersohi opened a new pull request, #40350:
URL: https://github.com/apache/superset/pull/40350

   ### SUMMARY
   
   Adds a new MCP mutation tool `create_css_template` that allows AI assistants 
to create named CSS templates for dashboards via the Model Context Protocol.
   
   Changes:
   - `superset/commands/css/create.py` — new `CreateCssTemplateCommand` 
following the existing command pattern
   - `superset/commands/css/exceptions.py` — adds 
`CssTemplateCreateFailedError` and `CssTemplateInvalidError`
   - `superset/mcp_service/css_template/` — new MCP module with Pydantic 
schemas and the `@tool`-decorated function
   - `superset/mcp_service/app.py` — registers `create_css_template` on startup
   
   The tool requires `CssTemplate` write permission (same as `POST 
/api/v1/css_template/`), uses `readOnlyHint=False`, and returns the created 
template's `id`, `template_name`, and `css`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — backend MCP tool, no UI changes.
   
   ### TESTING INSTRUCTIONS
   
   1. Start the MCP server
   2. Call `create_css_template` with `{"template_name": "My Theme", "css": 
".header { color: red; }"}`
   3. Verify the response returns a non-null `id`, the `template_name`, and the 
`css`
   4. Confirm the template appears in `GET /api/v1/css_template/`
   
   ### 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]

Reply via email to