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

   ### SUMMARY
   
   Adds a new MCP mutate tool `create_user` that allows admins to provision 
Superset user accounts through the Model Context Protocol.
   
   **What this adds:**
   - New `superset/mcp_service/user/` module with Pydantic schemas and tool 
implementation
   - `CreateUserRequest` schema with fields: `username`, `first_name`, 
`last_name`, `email`, `password`, `role_ids` (at least one role required)
   - `CreateUserResponse` returns only non-sensitive fields: `id`, `username`, 
`first_name`, `last_name`
   - Tool is gated behind `User` write permissions (admin-only)
   - Roles are resolved from IDs via FAB's `security_manager.role_model`
   - User creation delegated to `security_manager.add_user()`
   
   **Privacy considerations:**
   - Response intentionally omits `email`, `password`, and role assignments to 
avoid exposing user directory data
   - Admin-only via `class_permission_name="User"` + 
`method_permission_name="write"` on the `@tool` decorator
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — backend-only change.
   
   ### TESTING INSTRUCTIONS
   
   1. Start the MCP service
   2. Authenticate as an admin user
   3. Call `create_user` with a unique username, email, name, password, and a 
valid role ID (discoverable via `get_instance_info`)
   4. Verify the user appears in Superset's user management UI
   5. Verify the created user can log in with the supplied credentials
   
   To test invalid role IDs:
   - Supply a non-existent role ID; tool should return an error describing 
which IDs were not found
   
   ### 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))
   - [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