You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "chrispward (via GitHub)" <gi...@apache.org> on 2026/05/04 17:26:44 UTC
[D] MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl [superset]
GitHub user chrispward created a discussion: MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl
MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl`
---
## The problem we're hitting
We've been driving Superset from Claude Desktop via the MCP service (Apache Superset 6.1.0rc2, fronted by an OAuth/JWT proxy so the agent runs as a real RBAC user). The MCP write surface today is essentially **create-only**:
- `generate_chart`, `generate_dashboard`, `add_chart_to_existing_dashboard`, `create_virtual_dataset`
- `update_chart` / `update_chart_preview` exist — but **only for charts**
- No `update_dataset`, no `update_dashboard`
- No `delete_*` of any kind
What that means in practice for an iterative agent workflow:
1. We ask Claude to build a dashboard.
2. We review, ask for tweaks ("make the legend horizontal", "switch the chart from pie to donut", "add a country filter to the dataset").
3. Claude **cannot edit** the dashboard or the dataset, so it does the only thing the tool surface allows: **regenerates** them. New dashboard, new virtual dataset. Old ones remain.
4. Repeat 5-10 iterations on a typical session, and the workspace fills with `My Dashboard (3)`, `My Dashboard (4)`, `My Dashboard - copy`, plus a trail of orphan virtual datasets that nothing references.
5. There is no `delete_*` tool, so Claude cannot clean up after itself. We end up doing janitorial work in the UI by hand — which is exactly the thing MCP was meant to remove.
This is manageable at one-user scale (annoying, not blocking). **It is not manageable at the scale we're planning.** We're preparing to roll MCP access out to hundreds of users in our org. If every user generates a long tail of versioned duplicates and orphan virtual datasets every session, the workspace becomes unsearchable, the metadata DB grows unboundedly, the `list_*` tools start returning truncated/oversized payloads (the very thing #38959 / #39107 are trying to defend against), and admins are stuck running periodic cleanup scripts against the catalog. The problem doesn't surface until the user count goes up, but at that point it's already a mess.
The same pain shows up when the LLM is *correct* about what it wants to do: it tries to call `update_dataset` or `delete_dashboard` (perfectly reasonable names by analogy with `update_chart`), the upstream dispatcher returns `Unknown tool`, and Claude falls back to "regenerate" again.
## What we'd like
A coherent in-place edit + cleanup surface across the three first-class objects, mirroring the proven shape of `update_chart`:
### Edit-in-place tools
- `update_dataset` — same shape as `update_chart`. Lets the agent change column metadata, filters, the SQL behind a virtual dataset, owners, tags, certification fields, etc., on an existing dataset.
- `update_dashboard` — title, description, layout (`position_json`), filters, ownership, tags, css, theme. A `preview` flow comparable to `update_chart_preview` would be especially valuable here, since dashboards are large and irreversible-feeling.
### Cleanup tools
- `delete_chart`, `delete_dashboard`, `delete_dataset` (incl. virtual)
- An optional `unlink_chart_from_dashboard` (the inverse of `add_chart_to_existing_dashboard`) so an agent can prune a chart from one dashboard without destroying it.
- An `orphan_check` query — given a list of object IDs (or all objects owned by the calling user), report which are unreferenced (no parent dashboard, no scheduled report, no recent view). This is the single most useful tool for an agent that knows it has been making versioned copies and wants to volunteer to clean up.
## Design notes / things we're aware of
- We've read SIP-171 — Phase 2 explicitly targets ">80% of daily actions scriptable", and edit/delete are on that path. So this is in-scope of the existing SIP; no new SIP needed.
- We've also seen #39621 (`fix(mcp): Block destructive DDL in execute_sql`) — the project is currently tightening destruction surfaces, not loosening, so the deletes need a careful design. We'd suggest:
- Gate the `delete_*` family behind a config flag (e.g., `MCP_ENABLE_DELETE_TOOLS = False` default), or have it inherit from existing FAB delete permissions per-user.
- Reuse existing `*Command` classes (`DeleteDashboardCommand`, etc.) so RBAC, audit-log, and dependency-rejection (no deleting a dashboard with a scheduled alert) flow through the same path as the REST endpoint and UI.
- Optional `dry_run=True` parameter so the agent can preview what would be deleted (e.g., "this dashboard has 4 charts; 1 is shared with another dashboard, 3 are not") before committing.
- `confirm_token` pattern: `dry_run` returns a token; commit requires that token. Closes the `agent-deletes-prod-dashboard` failure mode.
- For `update_dashboard`, the `position_json` is the painful surface. A two-step "preview-token then commit" model (mirroring `update_chart_preview` → `update_chart`) lets the agent fail loudly on bad layouts without writing them.
## Why this matters
Right now MCP turns into a "create button" for the agent — and a janitor task for the human. The cost compounds with every iteration. A handful of edit + delete + orphan-check tools would close the loop and let agents own the full lifecycle the way human users already do through the UI.
Happy to break this into individual issues / PRs once there's directional alignment. We're prepared to draft and submit (mirroring the `update_chart` shape) if a committer is willing to shepherd review.
---
## Once this discussion gets traction
Per the project's contributing flow:
1. Convert / mirror to **GitHub Issues** for the agreed-on tools (one issue per tool family, e.g., one for `update_dataset`, one for `update_dashboard`, one umbrella for `delete_*`).
2. Open PRs against `master` (not `6.1`) titled with conventional commits — `feat(mcp): add update_dataset tool`, `feat(mcp): add delete_dashboard tool with feature flag`, etc. — and reference the issue number in the PR template's `Has associated issue:` line.
3. Backport candidates to `6.1` are decided by the maintainers; the destructive ones probably won't be, so we'd plan to live with them on master/6.2.
GitHub link: https://github.com/apache/superset/discussions/39864
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl [superset]
Posted by "matebenyovszky (via GitHub)" <gi...@apache.org>.
GitHub user matebenyovszky added a comment to the discussion: MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl
Let administrators decide on this. Agents could already use shell and curl in other projects after approval
GitHub link: https://github.com/apache/superset/discussions/39864#discussioncomment-16862085
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl [superset]
Posted by "musaabhasan (via GitHub)" <gi...@apache.org>.
GitHub user musaabhasan added a comment to the discussion: MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl
This is a real risk with agent-facing MCP surfaces. A create-only API nudges agents toward object sprawl because the lowest-friction repair path is to create a new dataset/chart/dashboard instead of reconciling what already exists.
I would add mutation tools with guardrails rather than broad write access: patch-style updates with revision or ETag preconditions, dry-run diff output, idempotency keys, object ownership/session tags, and soft delete with restore. The cleanup tool should first list objects created by a session or service identity and refuse deletion when there are external references unless explicitly confirmed.
For Superset specifically, it would help to keep the mutation boundaries narrow: update dataset metadata separately from SQL, chart properties separately from dashboard layout, and permissions separately from content. Every mutation should record the RBAC user, MCP tool name, source request id, before/after summary, and whether the operation came from a dry run or an executed request. That gives agents enough power to repair work while still preserving auditability and least privilege.
GitHub link: https://github.com/apache/superset/discussions/39864#discussioncomment-16860757
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl [superset]
Posted by "matebenyovszky (via GitHub)" <gi...@apache.org>.
GitHub user matebenyovszky added a comment to the discussion: MCP: agents need in-place edits and cleanup tools — current write-only surface causes object sprawl
As we are working on an Agent SupX extension with planning etc. capabilities I highly agree and support this!
https://github.com/integrityauthority/superset-extensions
https://github.com/apache/superset/discussions/38356
We validate and check SQL queries before run, I think basically only selects should be executed (for end users) - and yes, more configuration options would help: https://github.com/apache/superset/pull/39171
GitHub link: https://github.com/apache/superset/discussions/39864#discussioncomment-16853025
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org