aminghadersohi opened a new pull request, #37964:
URL: https://github.com/apache/superset/pull/37964
### SUMMARY
When the MCP service can't answer a user's question via available tools
(e.g., "show me recent SQL Lab queries by other users"), LLMs fall back to
suggesting Superset UI features. Some of these features (Action Log, List
Users, List Roles) are Superset-only and don't exist in all deployments (e.g.,
Preset). This misleads users.
This PR adds a configurable `MCP_UNAVAILABLE_FEATURES` list that gets
injected into the MCP system instructions, so LLMs know not to suggest
unavailable features.
**Changes:**
- **`mcp_config.py`**: Added `MCP_UNAVAILABLE_FEATURES: list[str] = []`
default (empty for open-source Superset)
- **`app.py`**: `get_default_instructions()` now accepts
`unavailable_features` param and appends an "IMPORTANT - Unavailable Features"
section when non-empty. `init_fastmcp_server()` reads the config from Flask at
runtime (same pattern as `APP_NAME`)
- **`test_mcp_config.py`**: Added 3 tests covering empty list, non-empty
list, and Flask config integration
**Usage in `superset_config.py`:**
```python
MCP_UNAVAILABLE_FEATURES = [
"Action Log (Settings > Security > Action Log)",
"List Users page (Settings > List Users)",
"List Roles page (Settings > List Roles)",
]
```
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - backend config change, no UI impact
### TESTING INSTRUCTIONS
1. Verify default behavior (empty list) produces no "Unavailable Features"
section in MCP instructions
2. Set `MCP_UNAVAILABLE_FEATURES` in `superset_config.py` with some entries
and verify the section appears in MCP instructions
3. Run tests: `pytest tests/unit_tests/mcp_service/test_mcp_config.py -x`
### 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]