aminghadersohi opened a new pull request, #42656:
URL: https://github.com/apache/superset/pull/42656
### SUMMARY
Adds an optional tri-state `certified` field to the MCP `list_datasets` and
`list_charts` request schemas:
- `true` returns certified assets only
- `false` returns uncertified assets only
- omission preserves the existing unfiltered behavior
The tools reuse Superset's existing dataset and chart certification filters,
keeping their semantics aligned with the REST APIs. The schema descriptions
explicitly recommend the filter when an agent needs governed semantic-layer
assets.
## Why
MCP consumers otherwise need to retrieve every visible dataset or chart and
filter the response client-side. Server-side filtering makes governed asset
discovery explicit and can reduce response tokens without changing defaults.
## What
A small adapter binds MCP request values to Flask-AppBuilder custom filters,
and the shared list core passes those filters to the DAO. Both dataset and
chart list tools expose the same tri-state request field.
## Blast radius
Limited to authenticated MCP dataset and chart list calls. Existing
RBAC/base filters remain in place and run before the certification filter. No
database, migration, RLS, workspace-isolation, UI, or feature-flag changes.
## Risk & rollback
Low risk. Omitted values retain the prior DAO query path. The main risk is
divergence from certification semantics, mitigated by reusing the existing REST
filter classes. Rollback is a normal revert.
## Review guidance
Start with the request fields in the chart and dataset schemas, then review
the bound-filter adapter and tool wiring. The most important behavior is that
`None` does not install a custom filter.
## Eval evidence
The affected MCP unit suites pass 99/99. The full staging agent eval suite
was not run because this OSS worktree has no deployed staging build/workspace
target.
## Cost & latency delta
No model, prompt, routing, or model-parameter changes (0). Omitted-filter
requests execute the same asset query as before. Opt-in certified filtering
adds one existing SQL predicate and reduces returned rows; no deployed
before/after token or latency sample is available from this worktree.
## Prompt / non-determinism
No prompt or model-routing changes. The tool schema description is
deterministic and is covered by request/tool tests.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable; no UI changes.
### TESTING INSTRUCTIONS
```bash
pytest -q tests/unit_tests/mcp_service/chart/tool/test_list_charts.py \
tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py
pre-commit run --files \
superset/mcp_service/mcp_core.py \
superset/mcp_service/dataset/schemas.py \
superset/mcp_service/dataset/tool/list_datasets.py \
superset/mcp_service/chart/schemas.py \
superset/mcp_service/chart/tool/list_charts.py \
tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py \
tests/unit_tests/mcp_service/chart/tool/test_list_charts.py
```
The tests cover `certified=true`, `certified=false`, and omitted
certification for both asset types.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [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]