Skip to content
AI Release

Microsoft Releases Flint to Help AI Agents Generate Better Charts

A new open-source visualization language and MCP server shift chart generation from verbose configuration to high-level semantic specifications.

Mariana Souza
Mariana Souza
Senior Editor · Jul 8, 2026 · 5 min read
Microsoft Releases Flint to Help AI Agents Generate Better Charts

Getting an LLM to generate a clean, responsive, and accurate chart is a recipe for frustration. If you ask an agent to output raw Vega-Lite or Chart.js configurations directly, it often struggles. LLMs frequently hallucinate scale configurations, overlap labels, or fail to adjust spacing when the underlying data cardinality changes.

To solve this, Microsoft has open-sourced Flint, a visualization intermediate language designed specifically for the AI agent era. Available on GitHub, Flint acts as a buffer between the agent's high-level intent and the low-level rendering engine. Instead of forcing an agent to write verbose JSON layout code, developers can have the agent produce a compact, semantic specification. A deterministic compiler then handles the math, spacing, and layout constraints to output production-ready charts.

Why LLMs Fail at Direct Visualization

LLMs are excellent at identifying patterns and summarizing data, but they lack spatial reasoning. When generating a chart configuration directly, the model must make hardcoded decisions about canvas size, label rotation, legend positioning, and scale steps.

If the data contains five rows, a hardcoded layout might look fine. If the next run returns fifty rows, the labels will overlap, the bars will compress into unreadable lines, and the visualization breaks.

Flint shifts this responsibility. The agent only needs to declare the data, map the fields to basic encodings (like x-axis, y-axis, or color), and assign semantic types to the data columns. The Flint compiler then analyzes the data density and semantic types to dynamically calculate the optimal layout.

The Compilation Pipeline

At the core of Flint is a JavaScript and TypeScript library (flint-chart) that compiles a single unified input into multiple target formats. Currently, Flint supports compiling to Vega-Lite, Apache ECharts, and Chart.js specs, covering more than 30 chart types.

Here is how you use the library in a TypeScript codebase:

import { assembleVegaLite } from 'flint-chart';

const spec = assembleVegaLite({
  data: { values: myData },
  semantic_types: {
    weight: 'Quantity',
    mpg: 'Quantity',
    origin: 'Country'
  },
  chart_spec: {
    chartType: 'Scatter Plot',
    encodings: {
      x: { field: 'weight' },
      y: { field: 'mpg' },
      color: { field: 'origin' }
    },
    baseSize: { width: 400, height: 300 },
  },
});

If you decide to switch your frontend rendering engine from Vega-Lite to ECharts or Chart.js, you do not need to change the agent's output format or prompt structure. You simply swap the compiler function:

import { assembleECharts, assembleChartjs } from 'flint-chart';

const echartsOption = assembleECharts(input);
const chartjsConfig = assembleChartjs(input);

By defining fields with semantic types (Flint supports over 70, including Rank, Temperature, Price, and Country), the compiler understands the nature of the data. It knows that a Country field represents categorical geographical data, while Temperature is a continuous physical measurement, and adjusts the scales and legends accordingly.

The Developer Angle: Integrating Flint into Agent Workflows

For developers building agentic applications, Flint offers two primary integration paths depending on how your architecture is structured.

1. The Library Approach

If you run a custom backend where you parse agent outputs, you can install the library directly:

npm install flint-chart

You instruct your LLM to output JSON matching the ChartAssemblyInput schema. Once received, your backend compiles it to the target spec and sends it to the frontend for rendering. This keeps the LLM's output token count low, saving on latency and API costs.

2. The Model Context Protocol (MCP) Server

If you are building on the Model Context Protocol, Microsoft has released a dedicated server:

npx -y flint-chart-mcp

The MCP server exposes tools directly to the agent. This allows the agent to choose an appropriate chart template, validate the data structure, and open an interactive chart view directly within MCP-compatible clients (such as Claude Desktop or VS Code). The server can also return static PNG or SVG outputs if the client does not support interactive rendering.

For Python developers, Microsoft has included a source-only preview of a Python port in the repository, with an official package release planned for the future.

Where Flint Fits in the Agent Ecosystem

This release comes on the heels of Microsoft's broader push into production-grade agent tooling. Following the General Availability of Microsoft Agent Framework 1.0 in April 2026, and the subsequent expansion of Azure Foundry's observability and tracing tools at Build 2026, Flint addresses the user-interface layer of the agent stack.

While frameworks handle orchestration and observability tools handle tracing, Flint standardizes how agents present structured data back to humans.

There are, however, clear trade-offs to consider before adopting Flint:

  • Design Control: Because the layout math is deterministic and handled entirely by the compiler, you lose granular control over highly custom CSS, custom animations, or non-standard chart types. If your application requires bespoke interactive visualizations, Flint's automated layout engine might feel too restrictive.
  • Language Ecosystem: The Python port is still in a source-only preview state. If your entire agent stack is built on Python (using frameworks like LangChain or LangGraph), you will either need to run a Node.js sidecar to handle the compilation or wait for the official Python package release.

Despite these caveats, Flint is a highly practical solution to a persistent problem. By moving layout logic out of the LLM prompt and into a compiler, it makes agent-generated data visualization reliable enough to run in production environments.

Sources & further reading

  1. Show HN: Microsoft releases Flint, a visualization language for AI agents — microsoft.github.io
  2. GitHub - microsoft/flint-chart: 🪄 Flint is a visualization language that lets AI agents reliably create expressive, good-looking charts from simple, human-editable chart specs. — github.com
  3. Build 2026: From observability to ROI for AI agents on any framework | Microsoft Foundry Blog — devblogs.microsoft.com
Mariana Souza
Written by
Mariana Souza · Senior Editor

Mariana covers the fast-moving world of machine learning and generative AI, with a particular focus on how these technologies are reshaping development workflows. When she isn't stress-testing the latest foundation models, she's usually at a local hackathon.

Discussion 0

Join the discussion

Sign in or create an account to comment and vote.

No comments yet

Be the first to weigh in.

Related Reading