You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mistercrunch (via GitHub)" <gi...@apache.org> on 2026/04/23 20:21:55 UTC
[PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
mistercrunch opened a new pull request, #39601:
URL: https://github.com/apache/superset/pull/39601
> ⚠️ **DRAFT / POC** — this is an exploratory PR for MCP Apps integration. Not ready for merge.
### SUMMARY
Adds a new `show_chart` MCP tool and a `ui://superset/chart-viewer` MCP resource that together let MCP Apps clients (e.g. Claude Desktop) render a live, interactive Superset chart inline via a sandboxed iframe — without the user needing an active Superset session in the host app.
Mechanism:
- `show_chart(identifier)` mints a short-lived (5 min), chart-scoped guest token and returns `explore_url` (`/explore/?slice_id=…&standalone=1&guest_token=…`) plus a resource descriptor for the MCP Apps UI mount point.
- `GuestTokenResourceType` gains a `CHART` member so guest tokens can be scoped to a single chart (in addition to the existing dashboard-scoped path).
- `SupersetSecurityManager.validate_guest_token_resources` and a new `has_guest_chart_access` branch honor chart-scoped tokens.
- `ChartFilter` grants read access when the guest token's resource matches the requested chart (by id or uuid).
- The `ui://superset/chart-viewer` resource holds the iframe shell the host client mounts.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
To be added after the client-side iframe is wired up end-to-end.
### TESTING INSTRUCTIONS
Automated:
```bash
pytest tests/unit_tests/mcp_service/chart/tool/test_show_chart.py \
tests/unit_tests/security/chart_guest_token_test.py
```
Manual (POC):
1. Run the Superset MCP service against a running Superset instance.
2. Call the `show_chart` tool with `{"identifier": "<chart_id_or_uuid>"}`.
3. Open the returned `explore_url` in a browser — the chart should render standalone without a login redirect.
4. (Optional) Point an MCP Apps-capable client at the MCP server; the tool result includes the `ui://superset/chart-viewer` resource descriptor so the client can embed the chart inline.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [x] Introduces new feature or API (new MCP tool + chart-scoped guest token type)
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi closed pull request #39601: feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC)
URL: https://github.com/apache/superset/pull/39601
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-6332048629
> @aminghadersohi just checking in on this one, been quiet since your July update. Heads up that `pre-commit` and one of the jest shards are currently failing on the head here, might be worth a look whenever you're back on the fragment-token/RLS work. Still moving forward on this, or has it stalled out?
sorry man this fell my radar. let me see if we need this or we can close it
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-4307745834
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 5c17bf7dc7aae2c79bd1e684227b9ef1bad0d636 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69ea7f6492299c000807272b |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39601--superset-docs-preview.netlify.app](https://deploy-preview-39601--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-39601--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-5943198177
@aminghadersohi just checking in on this one, been quiet since your July update. Heads up that `pre-commit` and one of the jest shards are currently failing on the head here, might be worth a look whenever you're back on the fragment-token/RLS work. Still moving forward on this, or has it stalled out?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-4307756956
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/39601?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `35.17241%` with `94 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 55.46%. Comparing base ([`bc2ffc6`](https://app.codecov.io/gh/apache/superset/commit/bc2ffc66e5181a369c918b4aa080d126a3c15ab4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5c17bf7`](https://app.codecov.io/gh/apache/superset/commit/5c17bf7dc7aae2c79bd1e684227b9ef1bad0d636?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 9 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/39601?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [superset/mcp\_service/chart/tool/show\_chart.py](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fchart%2Ftool%2Fshow_chart.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvY2hhcnQvdG9vbC9zaG93X2NoYXJ0LnB5) | 29.03% | [44 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [superset/security/manager.py](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&filepath=superset%2Fsecurity%2Fmanager.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | 4.00% | [23 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [superset/charts/filters.py](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&filepath=superset%2Fcharts%2Ffilters.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY2hhcnRzL2ZpbHRlcnMucHk=) | 10.00% | [17 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [superset/mcp\_service/middleware.py](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fmiddleware.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvbWlkZGxld2FyZS5weQ==) | 0.00% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...perset/mcp\_service/chart/resources/chart\_viewer.py](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&filepath=superset%2Fmcp_service%2Fchart%2Fresources%2Fchart_viewer.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvbWNwX3NlcnZpY2UvY2hhcnQvcmVzb3VyY2VzL2NoYXJ0X3ZpZXdlci5weQ==) | 88.88% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (bc2ffc6) and HEAD (5c17bf7). Click for more details.
>
> <details><summary>HEAD has 130 uploads less than BASE</summary>
>
>| Flag | BASE (bc2ffc6) | HEAD (5c17bf7) |
>|------|------|------|
>|python|120|1|
>|presto|12|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #39601 +/- ##
==========================================
- Coverage 64.58% 55.46% -9.13%
==========================================
Files 2564 2566 +2
Lines 133576 133775 +199
Branches 31033 31073 +40
==========================================
- Hits 86271 74197 -12074
- Misses 45813 58924 +13111
+ Partials 1492 654 -838
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.61% <35.17%> (-0.06%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.61% <35.17%> (-20.50%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/39601/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/39601?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-5007708946
Hey @mistercrunch 👋 — we're taking this PR over to carry it from POC to merge-ready (coordinated with Amin). Recent pushes: rebased onto latest master (twice), wired the standalone Explore page so the chart actually renders end-to-end (SupersetClient now picks up the guest token client-side), and added an `EMBEDDED_SUPERSET` fail-fast in the tool.
Direction from here:
- Move the guest token out of the URL query string (fragment-based delivery, so it never reaches server logs)
- Inherit the MCP caller's RLS rules when minting chart-scoped tokens (currently `rls=[]`)
- Integration deny-case tests for the new authz branches
- Converge with the MCP service's embedded guest auth (`MCP_EMBEDDED_GUEST_AUTH_ENABLED`) where it makes sense
Happy to adjust course if you had a different plan for any of this — comments welcome.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-4307718933
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(mcp): add show_chart MCP tool + chart-scoped guest tokens (POC) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39601:
URL: https://github.com/apache/superset/pull/39601#issuecomment-6329368095
@aminghadersohi pre-commit and a jest shard are red on the current head, and it's conflicting again. Want me to take the rebase and lint fix so you can stay on the guest-token/RLS work?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org