Skip to content

CLI parity for MCP chart descriptions, counter labels, widget edits and dashboard images - #75

Merged
rahuldotiyer merged 2 commits into
mainfrom
mcp-parity-8196
Nov 26, 2026
Merged

rahuldotiyer merged 2 commits into
mainfrom
mcp-parity-8196

Conversation

@rahuldotiyer

Copy link
Copy Markdown
Contributor

Brings the CLI up to the Dune MCP features from duneanalytics/core#8196 (live in node-1.0.1008).

  • viz create --chart-type/--config takes --description; viz update gains --counter-label, and --description works with or without a chart config.
  • New dashboard update-widget: move or resize one widget, or edit a text widget, keeping the rest.
  • New dashboard image: save a JPEG of the whole dashboard to check its layout.

Impact map

Area Change Calls
viz create (chart config path) --description no longer rejected with --config; sent as description generateVisualization
viz update --counter-label (new), --description routed through the MCP; empty string removes updateVisualization
dashboard update-widget new updateDashboardWidget
dashboard image new; --file defaults to dashboard-<id>.jpg getDashboardImage
dunemcp.Caller adds CallWithImages (image content blocks) —

Review notes

  • Same permissions as the MCP: the tools do the auth. Checked live: update-widget on someone else's dashboard returns the MCP's "not authorized" error.
  • Licensed data stays withheld: when withheldVisualizationIds is non-empty, dashboard image fails and lists those IDs, and writes no file. Checked live on prod dashboards.
  • No secrets printed: dashboardImageUrl carries a private dashboard's share key, so it is left out of text and JSON output, and stripped from download errors. It is only used to download the image when the MCP leaves it out as too large to inline (>4 MB).
  • viz update --description without --chart-type now goes through updateVisualization instead of the REST GET+PUT only when combined with --counter-label; on its own it still uses REST, unchanged.
  • The chart-config help no longer claims Dune does not check column names; the MCP now rejects unknown columns when the query has results.

Testing

  • go test ./... and go vet ./... pass. New tests cover widget arg shaping (numeric vs UUID IDs, sizeX/sizeY), input rejection before any call, inline image save, the too-large download path, withheld images, the share key never reaching output, and description/counter-label args, including the empty-string removal.
  • Live against api.dune.com: dashboard image 481 saved a valid 2388×2210 JPEG; dashboards with licensed or never-run charts returned the withheld error.

No visual surface: CLI only.

…ts and dashboard images

core#8196 added these to the Dune MCP server (live in node-1.0.1008).
The CLI now matches them:

- viz create --chart-type/--config now takes --description and sends it
  to generateVisualization (it was rejected before).
- viz update gains --counter-label, and --description now works with
  --chart-type/--config or on its own, through updateVisualization. An
  empty value removes the label or description, as in the MCP.
- dashboard update-widget moves or resizes one widget, or edits a text
  widget's markdown, through updateDashboardWidget, keeping every other
  widget as it is.
- dashboard image saves a JPEG of the whole dashboard through
  getDashboardImage. It fails and lists the visualizations when Dune
  withholds the image for licensed datasets. It never prints the image
  URL, which carries a private dashboard's share key; when the image is
  too large to return inline it downloads it from that URL.

dunemcp.Caller gains CallWithImages so commands can read image blocks.
The chart config help no longer says Dune does not check column names:
the MCP now rejects unknown columns when the query has results.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879
@rahuldotiyer
rahuldotiyer requested review from ivpusic and norbertdurcansk and removed request for norbertdurcansk November 25, 2026 21:18

@norbertdurcansk norbertdurcansk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, with suggestions. No blockers. The main open item is the question on the too-large download path, which only ran against httptest.

Comment thread cmd/dashboard/image.go Resolved
Comment thread cmd/dashboard/image.go Resolved
Comment thread cmd/dashboard/widget_image_test.go Resolved
Comment thread cmdutil/mcp.go Resolved
…ors keep the share key out (#78)

Review follow-ups on #75: a 200 that is not an image now fails instead of
being saved as the JPEG; a test covers download failures (connection
refused, HTML page, 403) and asserts the share key never reaches the
error; CallTool now wraps CallToolWithImages.


Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879

Co-authored-by: Amp <amp@ampcode.com>
@rahuldotiyer
rahuldotiyer merged commit 1b75673 into main Nov 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants