Skip to content

Conversation

@michaelneale
Copy link
Collaborator

@michaelneale michaelneale commented Aug 18, 2025

This proposal uses mcp-ui with an (opional) fast, lightweight and 0 dependency built in MCP server called "Auto visualizer" which uses libraries like d3 (which are bundled into inline HTML so no external access required) to make charts and graphs and all sorts of visualisation.

Benefits: you don't need to know or be experts in presentation, you can just ask for goose to make an appropriate visualisation of anything you want and it can find and use the appropriate diagram for you to interact with inline, to complement the textual output.

image image image

and interactive things, all as tool calls.

Currently

  • sankey diagrams
  • radar charts
  • chord diagrams
  • donut/pie charts
  • bar graphs and general charts
  • flow diagrams
  • treemap visualisations (tiles)

Todo:

need to make sure that the blobs are not too large if part of session, d3 type resources should be JIT served not inlined to html

@michaelneale michaelneale self-assigned this Aug 18, 2025
match extension_id {
"developer" => "Developer Tools".to_string(),
"computercontroller" => "Computer Controller".to_string(),
"autovisualiser" => "Auto Visualiser".to_string(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this really only applies to gui (MCP-ui) but not sure of protocol here - if we don't have it in CLI then can't turn it on there (but maybe that is ok?)

<title>Interactive Chart</title>

<script>
{{CHART_MIN}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Over in https://github.com/block/goose/pull/4164/files#diff-10caa690bbc229198a1a7c3c862db533dcdf27944a4b92931d5c47aabe7fa500R63 I have upgraded MCP-UI and started to experiment with the iframe sandbox value by adding allow-forms ...

I mention this because I think we might be able to use a <script src="<d3-script-here.js"> if we adjust the sandbox value to include allow-same-origin, and if we don't want to inline it like this.

IDK how insecure the allow-same-origin value is. If we needed, we could only set that value when it comes from one of our native tools like this one (and turn it off when we load an MCP UI from an 3rd party extension)

How do you feel about storing the minified JS in Goose as opposed to getting it from a CDN via <script src="" />

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think for these cases, can go either way, but for now having it served up from goose is very fast and zero risk which I think feels right (for now) but anything more complicated, yeah.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for anything recommended/out of the box, would ideally not pull in external deps at display time I think - so as this works is ideal for this case (for an arbitrary MCP that people may or may not use - I think can be more open).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed, inlining the deps feels right

* main: (67 commits)
  blog: Transforming AI Assistance with Goose Mentor Mode (#4151)
  upgraded all npm packages and fixed related issues (#4072)
  Docs: @-mentions in goosehints (#4171)
  fix: consistent font sizing in ToolCallWithResponse (#4167)
  Temporarily disable TODO Tool (#4158)
  docs: add integrated MCP server config to jetbrains tutorial  (#4120)
  docs: remove figma MCP from suggested servers (#4123)
  Blog: The AI Skeptic’s Guide to Context Windows (#4152)
  Docs: Auto-compact context (#4116)
  chore(deps): bump brace-expansion from 1.1.11 to 1.1.12 in /documentation (#4149)
  Recipe config to limit tool availability (#4020)
  docs: fix warning message (#4148)
  feat: adds cursor-agent as a cli provider (#4101)
  chore: remove vector search tool selection strategy (#3933)
  docs: add streamable_http install links (#4130)
  feat: iterating on summarize oneshot prompt (#4113)
  feat(mcp): Persist OAuth credentials to keyring (#4007)
  Sanitize Tags Unicode Block at prompt level (#4047)
  Fixing typos (#4114)
  chore(release): release version 1.4.0 (#4069)
  ...
@michaelneale
Copy link
Collaborator Author

hrm current problem:

A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.
- ```

@aharvard
Copy link
Collaborator

FYI - a fix is in the works MCP-UI-Org/mcp-ui#91

@michaelneale michaelneale marked this pull request as ready for review August 20, 2025 10:46
@michaelneale
Copy link
Collaborator Author

fyi @aharvard think this is ready to have a good look. Seems to work now (improved the data validation). there isn't any smarts in the templates for responding to dark mode yet, or posting tings back, but this is a start and still pretty simple and fast.

Copy link
Collaborator

@aharvard aharvard left a comment

Choose a reason for hiding this comment

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

This is excellent!

Works well with other tools to acquire proper data.

I did get stuck in an agent loop once; it kept trying different visualizations, and I don't know why. There might be room to add some lightweight data validation against the D3 rendering requirements. Then, we could return a text statement that clearly indicates whether the visualization was successful or failed for some reason. Result text like that might properly exit the loop. I'd love to learn what you think about this choreography!

Here's a recording of my experience:

goose-dataviz-small.mov

}: PillProps) {
const baseStyles = 'inline-flex items-center justify-center rounded-full transition-all duration-300 ease-out font-medium';

const baseStyles =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these just formatting changes? Looks like it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh good catch - yeah not intended. I am using opus + a fast apply model and sometimes it gets carried away

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah - looks like the prettier/checker requires it? odd...

@michaelneale
Copy link
Collaborator Author

"Then, we could return a text statement that clearly indicates whether the visualization was successful or failed for some reason" - yeah I like that - might be a way to validate the js/total thing in rust side and feed it back (it does push back if the json is invalid, so that can cause it to iterate a bit)

* main:
  docs: Plan tutorial (#4309)
  Extensions Modal Improvements (#4293)
  docs: fixed cicd tutorial pipeline in docs (#4223)
  Read oltp config from config and env (#4292)
  release/1.6.0 (#4280)
  docs: fix broken links in Docker tutorial (#4285)
  Remove half-second wait, rework auto submit (#4282)
  Block send until extensions are ready (#4271)
  fix: improve OpenAI-compatible error handling and add test coverage (#4175)
  Move To-Do Tool to Session Scope from Agent Scope (#4157)
  fix: recipe params not being replaced all the time (#4207)
  chore: removing little-used session sharing feature (#4249)
  Stop auto scrolling when agent responds and let scroll area handle scrolling to bottom (#4257)
  restore cli projects from accidental removal during cleanup (#4266)
  Fix: deep link extension installation to show dialog for headers configuration (#4150)
@michaelneale michaelneale merged commit 3e1557b into main Aug 25, 2025
10 checks passed
@michaelneale michaelneale deleted the micn/hi-viz-autovisualiser branch August 25, 2025 00:42
michaelneale added a commit that referenced this pull request Aug 25, 2025
* main: (24 commits)
  feat: autovisualiser of structured data with mcp-ui (#4153)
  docs: Plan tutorial (#4309)
  Extensions Modal Improvements (#4293)
  docs: fixed cicd tutorial pipeline in docs (#4223)
  Read oltp config from config and env (#4292)
  release/1.6.0 (#4280)
  docs: fix broken links in Docker tutorial (#4285)
  Remove half-second wait, rework auto submit (#4282)
  Block send until extensions are ready (#4271)
  fix: improve OpenAI-compatible error handling and add test coverage (#4175)
  Move To-Do Tool to Session Scope from Agent Scope (#4157)
  fix: recipe params not being replaced all the time (#4207)
  chore: removing little-used session sharing feature (#4249)
  Stop auto scrolling when agent responds and let scroll area handle scrolling to bottom (#4257)
  restore cli projects from accidental removal during cleanup (#4266)
  Fix: deep link extension installation to show dialog for headers configuration (#4150)
  feat: Add message queue system with interruption handling (#4179)
  Start extensions concurrently  (#4234)
  Add X-Title and referer headers on exchange to tetrate (#4250)
  docs: update View/Edit Recipe menu item name (#4267)
  ...
zanesq added a commit that referenced this pull request Aug 25, 2025
* 'main' of github.com:block/goose:
  fix slow typing with long sessions (#4291)
  docs: improvements to release docs (#4317)
  blog: mcp-ui recap blog (#4146)
  added more logging for recipe creation failures (#4299)
  Remove a bit from pre-commit that husky says we should (#4286)
  feat: autovisualiser of structured data with mcp-ui (#4153)
  docs: Plan tutorial (#4309)
  Extensions Modal Improvements (#4293)
  docs: fixed cicd tutorial pipeline in docs (#4223)
  Read oltp config from config and env (#4292)

# Conflicts:
#	ui/desktop/src/App.tsx
shellz-n-stuff pushed a commit to shellz-n-stuff/goose that referenced this pull request Aug 27, 2025
Signed-off-by: Alex Rosenzweig <arosenzweig@squareup.com>
dorien-koelemeijer pushed a commit to dorien-koelemeijer/goose that referenced this pull request Sep 2, 2025
Signed-off-by: Dorien Koelemeijer <dkoelemeijer@squareup.com>
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.

4 participants