Because the output is a page rather than an image in the reply, the chart can be as large as it needs to be without filling the context window, and it stays open in a browser tab while the conversation moves on. The public URL setting is the one to get right, since that is what determines whether the link you receive actually resolves.
A small Go server with a single job: take an ECharts JSON configuration, write a self-contained HTML page for it, and return the address where that page can be opened.
- One tool, generate_echarts_page, that takes a title and an ECharts configuration object
- Optional width and height in pixels, defaulting to 800 by 600
- A URL to the generated page as the return value, so the chart lives outside the conversation
- A published Docker image, so it can run as a container the client starts or as a long-lived service
Go 1.24 or newer to build from source, or the published Docker image. Four settings, all environment variables or a .env file: the listening port, which defaults to 8989; the public URL the generated links should use; the log level; and the directory the HTML files are written to. Clients connect over SSE, and the endpoint is /sse rather than the root.
