Serveur MCP MatPlotLibNet
Commit 7 nov. 2026Permet aux agents IA de générer des graphiques complexes et des visualisations de données au format PNG, SVG ou PDF à partir d'une spécification JSON.
Aussi connu sous xkqg/MatPlotLibNet
- Étoiles
- 20
- Outils
- —
- Téléchargements, 30 jours
- —
- Dernière version
- 1.18.1
- Dernier commit
- 7 nov. 2026
- Licence
- MIT
Qu'est-ce que MatPlotLibNet MCP ?
MatPlotLibNet est un serveur MCP. Permet aux agents IA de générer des graphiques complexes et des visualisations de données au format PNG, SVG ou PDF à partir d'une spécification JSON.
Résumé généré à partir du README du projet
À propos du MCP server MatPlotLibNet
La génération de visualisations de données complexes directement depuis un agent IA est ce que permet matplotlibnet. Ce MCP server permet aux développeurs d'utiliser l'IA pour générer 91 types de graphiques différents en fournissant une spécification JSON. Il traduit ces instructions en rendus visuels de haute qualité, incluant les formats PNG, SVG, PDF ou GIF animés.
Conçue pour l'écosystème .NET, la bibliothèque sous-jacente prend en charge C#, .NET 8 et .NET 10. Elle fonctionne comme une passerelle permettant à un client IA de commander à un serveur de dessiner tout type de visuel, des graphiques à barres standards aux tracés scientifiques spécialisés tels que les diagrammes ternaires, les diagrammes de cordes ou les nuages de mots. Grâce à sa spécification basée sur le JSON, le serveur peut gérer des figures complexes contenant des formes, des annotations et des axes multiples sans nécessiter de framework JavaScript ou de WebView.
Les utilisateurs peuvent demander des visualisations techniques sophistiquées comme des spectrogrammes, des diagrammes en violon ou des indicateurs financiers. Le serveur est conçu pour gérer des fonctionnalités avancées telles que le MathText de style LaTeX, les axes Y multiples et les projections cartographiques avec données Natural Earth intégrées, ce qui le rend adapté aussi bien à la science des données générale qu'aux tâches d'ingénierie spécialisées.
Ce que vous pouvez faire avec
- 1Générer des tracés de données scientifiquesDemandez à l'IA de créer un graphique scientifique spécialisé, comme un diagramme ternaire ou un diagramme de Piper, à partir d'un jeu de données.
- 2Créer des indicateurs techniques financiersDonnez l'instruction à un agent de visualiser les tendances du marché en utilisant des indicateurs techniques spécifiques ou des données de type chandeliers japonais.
- 3Rendre des visualisations de données géographiquesDemandez une carte utilisant une coloration choroplèthe ou affichant des points de données le long de grands cercles.
- 4Produire des séquences de données animéesDemandez à l'IA de générer un GIF animé ou un SVG qui parcourt différentes étapes de données.
Extrait du README du projet. Chaque cas d'utilisation est vérifié par rapport à une citation du document.
Configuration
MATPLOTLIBNET_FONTSFont files (.ttf, .otf) and directories of them, separated by ';', registered at startup so a chart can use a script the bundled font lacks (Devanagari, Thai, Chinese). Arabic and Hebrew work without it.
MATPLOTLIBNET_MCP_OUTPUT_ROOTThe only directory save_chart may write under. Defaults to the system temp directory.
| Nom | Description | Type |
|---|---|---|
| MATPLOTLIBNET_FONTS | Font files (.ttf, .otf) and directories of them, separated by ';', registered at startup so a chart can use a script the bundled font lacks (Devanagari, Thai, Chinese). Arabic and Hebrew work without it. | |
| MATPLOTLIBNET_MCP_OUTPUT_ROOT | The only directory save_chart may write under. Defaults to the system temp directory. |
Vérifications automatisées
Exécuté le 13 nov. 2026Rapport complet →Pas encore vérifié. Un serveur nécessite un score de 80, aucune faille sérieuse et suffisamment de données pour que nous puissions effectuer les vérifications. Fonctionnement des vérifications · Ce qu'il faut corriger pour gagner des points
- Dépôt source lié et accessibleRéussi
- Licence open source (OSI)Réussi
- Commit ou version publiée au cours de l'année écouléeRéussi
- Nom du package non proche d'un package populaireNon vérifié
- L'endpoint distant utilise HTTPSNon vérifié
- Les outils destructifs sont étiquetésNon vérifié
- Aucune instruction cachée destinée au modèleRéussi
- Aucun avis critique dans le package ou ses dépendancesNon vérifié
README
Voir sur GitHubMatPlotLibNet — matplotlib for .NET
MatPlotLibNet is a charting library for C#, .NET 10 and .NET 8, inspired by matplotlib. It draws 91 chart types and saves them as SVG, PNG, PDF or an animated GIF, straight from your server code. It does not need a JavaScript framework, a WebView or a hosted service.
It has a fluent API and it works with dependency injection. It ships with 148 colormaps, 30 themes, 13 map
projections with embedded Natural Earth data, LaTeX-style MathText, text in any script, O(1) streaming (57 of its 59
technical indicators have a streaming form), a control room (Plt.OpsDashboard() — KPI tiles, state timelines, one shared trend window),
and an MCP server so an AI agent can draw with it. Charts render natively in Blazor, WPF, MAUI, Avalonia, Uno and
ASP.NET Core, inside a Verso notebook cell, and TypeScript clients are there for Angular, React and Vue.
Where this is going
1.29.0 puts shapes on an axes and lets an axis show another unit. A rectangle, a polygon, an arrow, a circle, an
ellipse, a wedge and an arc (AddPatch) are placed in data coordinates and bend with the axes they stand on, as
matplotlib's patches do: on a log axis a circle bends and a straight edge stays straight. They count in the automatic
range, a labelled one has a row in the legend, and they travel through JSON and the MCP server. A top or side axis can
show the same values in another unit through a function and its inverse (Link with an AxisTransform: degrees
Celsius against Fahrenheit, a frequency against its period), as matplotlib's secondary_xaxis and secondary_yaxis
do. The top X axis now follows its own tick locator and scale, a series on it follows a log primary Y axis, a
translucent line or text keeps its opacity in the SVG, a figure built with AddSubPlot(rows, cols, index) keeps its
cell through JSON, and the MCP server draws a spec that holds shapes, spans or annotations and no series. The three
rows that were still to come on the roadmap are done.
1.28.0 draws more of what matplotlib draws. Stairs, VLines, HLines and Triplot join the chart verbs, and a
sixth family of verbs (Psd, Csd, Cohere, MagnitudeSpectrum, PhaseSpectrum, AngleSpectrum, Acorr,
Xcorr) draws a sampled signal in the frequency domain, and its correlation, with matplotlib's defaults; the twelve
bring the chart verbs to thirty-eight. A contour label follows its line, upright and in the line's colour; a figure
carries text, a legend and an image of its own (FigText, FigLegend, FigImage), drawn on a figure with no subplot
too; and an inset marks the region it zooms into (IndicateZoom). The spectrogram windows each frame once and draws
its rows at the frequencies they are, a line that is downsampled keeps its gaps, and a line set to LineStyle.None
draws no line. A figure's texts, legend and images and an inset's zoom travel through JSON and the MCP server.
1.27.0 finishes the roadmap. A word cloud, a chord diagram, a ternary plot and a Piper diagram are new charts, a selection in one chart can light the same rows in another, and an animation can be saved as one SVG that steps through its frames. A live chart sends its own gestures, one handler interface receives them, and several viewers of one chart share it by design. The native controls return Home to the first view, the MAUI view reaches the same functions, and the Windows heads are tested by CI. 57 of the 59 indicators have a streaming form that follows each new bar, and transfer entropy follows a window.
1.26.0 gives marks that are a size in data units a home. A waffle chart, a calendar of events, Point and Figure
and Renko charts draw squares, stripes and boxes that tile the plot area, and Kagi draws its thick and thin lines. A
fill can run from one colour to another, an arrow can follow a connected scatter, and the frame of a plot can be
trimmed: a spine spans only the data's range, a plot keeps an equal scale on request, and parallel coordinates label
every column in its own units. An icicle chart, an arc diagram and a stem-and-leaf plot join the layouts, a waterfall
chart can mark a target on each bar, and the comparison with matplotlib now runs in CI. Three new series types (the
waffle chart, Point and Figure and the icicle chart) join the chart types, and six new verbs (CalendarEvents,
Renko, Kagi, ConnectedScatter, StemAndLeaf, MatShow) bring the chart verbs to 26.
1.25.0 gives each value a chart resolves one owner that every reader asks. The colour bar puts its ticks where the
chart's normaliser puts its colours, a theme owns the neutral grey that reference lines and outlines wear, a grid the
author changed stays a change over whichever theme the figure is drawn under (a polar chart's rings and a 3-D chart's
walls included), and a light's strength reaches the surfaces and bars it lights. Saving to .png, .pdf or .gif
without the Skia package is refused rather than written as SVG, and axes that share a scale share its margins, so a table
stands directly under the curve it counts. The statistics grow: the violin reads the same Gaussian estimator as the
density plot, ProbabilityPlot draws a Q-Q plot against an exponential, uniform, log-normal or Student t distribution (or
one of your own), RiskTable puts the numbers at risk and the log-rank test under a survival plot, and ShewhartChart
draws the individuals, moving range, X-bar, range, p and c charts and marks points by Nelson's eight tests. The volume
tools gain an anchored VWAP (Vwap(bars, anchor)) and a volume profile (VolumeProfile). The library now has 59
indicators.
1.24.0 gathers every Y axis of a chart into one container. The primary axis is the first axis of the left side,
and each further axis stacks outward past the one before it, on either side and as many times as the chart needs one:
WithAddRightYAxis and WithAddLeftYAxis add an axis with its own range, ticks, colour, series and legend entry,
there is no "second" or "third" in the name to count, and the four scales 1.23.0 stopped at are no limit any more. The
older verbs for a secondary and for an outward-stacked Y axis keep working and are marked obsolete in favour of them;
the changelog lists each with what replaces it. A Y axis title now stands the same distance from its tick labels on the
left and on the right, 4 px between the title and the widest label by default, and WithYAxisTitleGap sets another
distance for the whole chart; the left title no longer runs off the edge of the figure. Every axis draws the way the
primary one does, with its own log or symlog scale, tick locator, minor ticks and a title in math markup, and a line on
a left-hand axis can carry its name at its end. A figure written to JSON keeps every axis, whatever their number, and
a figure that stays within the old four writes the file 1.23.0 wrote. A chart server drops a zoom or pan that names a
subplot it does not have, and one event that fails no longer ends the chart's session for good, as it used to; the MCP
server checks every axis of a chart spec instead of the first two. The texts of a chart are placed with more care: a
legend left at Best stands where it covers the fewest marks, as matplotlib's loc='best' does, an annotation takes the
theme's text size and can move by a number of pixels or out of the way of the data and the legend, a bar's value label
stands beyond the bar's end whichever way the bar points, and a turned tick label has room beside the plot.
The same release picks up thirteen more rows of the roadmap, each one rule where there had been two. A colour bar puts
its ticks at round numbers, as many as fit along its length. A polar chart has one radial scale that its rings, lines,
bars and heatmap all read, and polar bars stack, so a wind rose is one PolarBar call for each speed class. Bars stack
on both sides of zero, so a Likert scale is a stacked bar chart. A filled contour fills the bands between its levels
over the grid and follows the limits you set. A series that cannot be drawn from the data it was given is refused when
it is built, and not when the chart is drawn, and the MCP server names the place in the spec where it stands. A stacked
area names its layers in the legend, a state timeline's legend entry shows its states, and a series says for itself
whether it needs axes around it. A map from MatPlotLibNet.Geo keeps its holes, comes back from JSON, colours its
regions by a value (Choropleth) and takes points, bubbles, hexagon bins, flows along great circles, a cartogram and a
Dorling map.
1.23.0 moves the technical indicators that read a candle's open, high, low, close and volume from separate
array parameters to one OhlcvBars value, built with the factory that names the columns the indicator actually
uses (OhlcvBars.Hlc(high, low, close), OhlcvBars.Cv(close, volume), and so on) instead of repeating the same
arrays across every indicator on a chart. A chart with more than two scales now has somewhere to put the extra
ones: a verb that stacks a second axis past the first on either side — four scales total, two left and two
right, each with its own range, ticks, series and legend entry, the way matplotlib moves a twin's spine outward. A
secondary axis restores through the same registry the primary one does, so a bar or an area survives there and on
the top axis too, not only a line or a point; and a wheel zoom, a drag pan, a rectangle zoom and Home now move
every one of those axes, each by its own amount, whether the server answers the gesture or a native control does.
Underneath, the close to a hundred chart verbs the fluent API builds from now live one-per-file as extension
members on Axes instead of all sharing one class — a file-layout change only, no call a reader writes is any
different because of it.
1.22.0 lets several series share one colour instead of each taking the next one from the theme's cycle, and
spends it on three things: a Kaplan-Meier curve now draws its confidence band and its censor marks in the curve's
own colour, and two new verbs, Raincloud (a half violin, a narrow box and a group's raw points in one colour) and
Horizon (a signed series folded into bands of two hues), bring the axes builder to seventeen verbs.
1.21.0 makes every chart type and every axes setting round-trip through JSON whole. A Sankey's nodes and
links, a treemap's, sunburst's, dendrogram's and clustermap's trees, a tree grid's rows, a polar chart's data, a
streaming chart's current points and a planar 3-D bar's data all come back from JSON as themselves now, not a
placeholder — the MCP server lists and accepts all eight
again, where it used to refuse them by name. An axes' Z axis, its 3-D pane colours and its tooltip switch come back
too. The one series this release did not reach is MatPlotLibNet.Geo's GeoPolygonSeries, named on the
roadmap; 1.24.0 brings it back from JSON too.
1.20.0 turns charts that took a page of code into one call. Fifteen verbs on the axes builder, among them
Pareto, Ridgeline, CalendarHeatmap, QQPlot, ControlChart, KaplanMeier, StreamGraph and Marimekko, take
the data as you hold it (names, groups, samples, dates) and build the chart from the series the library already has.
Underneath them, a figure written to JSON now reads back as the picture it was, with every setting it draws, so the
MCP server and every transport carry it whole. NaN is the one missing value: a line breaks at a gap, as in
matplotlib, and nothing is drawn at NaN. Bars on a log axis reach the bottom edge, horizontal bars work, category
names are tick labels with room for the axis title, and WithDpi and SaveOptions now reach the file. Every new call
is shown in code on the wiki's examples page.
1.19.0 is for charts with more than one line and more than one axis. WithDirectLabel() writes a line's name at
its end, in the line's own colour, instead of in the legend, and SetYAxisColor / SetXAxisColor colour an axis to
match its line in one call, on the left, bottom, right and top axis alike. The right-hand and top axes now follow their
own tick settings, get room of their own in the layout and keep their colours through JSON, and a line on them hides
when its legend entry is clicked. On a server-interactive chart and in the WPF, Avalonia and Uno controls, hover,
selection, zoom, pan and the data cursor report the values the reader sees, on log axes too, and an axis limit you
set, reversed or not, is now exactly the range drawn. Every new call
is shown in code on the wiki's examples page, and every C#
example in the wiki now compiles.
After that, releases follow what the community needs: bug fixes, documentation, and whatever comes up in real use. Open a Discussion or an Issue; that is what decides the next release. Every release, with its migration notes, is listed in the CHANGELOG, and the roadmap says what is done, what is still to come and what is left out on purpose, with a section for each row on the wiki's page.
Quality bar: every class must pass a strict coverage gate of ≥90 % line and branch coverage (1,161 classes, at
99.8 % line / 98.9 % branch) across 28,839 tests. A separate suite (Tst/MatPlotLibNet.Fidelity) compares the
rendering with reference images drawn by matplotlib, and CI runs it.
Documentation
- Wiki — getting started, cheatsheet, all 91 chart types, the control room, styling, streaming, SignalR, packages
- From matplotlib to C# — the pyplot call you know, and the line that draws it here
- Cookbook — copy-paste examples with rendered output
- Playground — try charts live in the browser
- API Reference — generated from the XML docs
- Roadmap — what is done and what is still to come, in the order each row needs the one above it; the wiki's page says what each row takes and what is left out on purpose
- Benchmarks · Coverage policy · CHANGELOG
Packages
| Package | Install | What it does |
|---|---|---|
| MatPlotLibNet | dotnet add package MatPlotLibNet |
Core: models, fluent API, SVG rendering, JSON, transforms |
| MatPlotLibNet.DataFrame | dotnet add package MatPlotLibNet.DataFrame |
Microsoft.Data.Analysis.DataFrame extension methods — plot, indicators (SMA/EMA/RSI/MACD/…), and polynomial regression from named columns |
| MatPlotLibNet.Skia | dotnet add package MatPlotLibNet.Skia |
PNG, PDF, and animated GIF export via SkiaSharp |
| MatPlotLibNet.Blazor | dotnet add package MatPlotLibNet.Blazor |
MplChart + MplLiveChart Razor components with SignalR |
| MatPlotLibNet.AspNetCore | dotnet add package MatPlotLibNet.AspNetCore |
REST endpoints, SignalR hub, IChartPublisher |
| MatPlotLibNet.Interactive | dotnet add package MatPlotLibNet.Interactive |
figure.ShowAsync() — browser popup, no server needed |
| MatPlotLibNet.GraphQL | dotnet add package MatPlotLibNet.GraphQL |
GraphQL queries + subscriptions via HotChocolate |
| MatPlotLibNet.Maui | dotnet add package MatPlotLibNet.Maui |
Native MplChartView via Microsoft.Maui.Graphics |
| MatPlotLibNet.Avalonia | dotnet add package MatPlotLibNet.Avalonia |
Native MplChartControl for Avalonia 12 — Skia backend, optional local interaction |
| MatPlotLibNet.Uno | dotnet add package MatPlotLibNet.Uno |
Native MplChartElement for Uno Platform (WinUI 3 / Android / iOS / macCatalyst) |
| MatPlotLibNet.Wpf | dotnet add package MatPlotLibNet.Wpf |
Native WPF MplChartControl via SkiaSharp — all 15 interaction modifiers — and MplStreamingChartControl for live data; your project targets netX.0-windows10.0.19041.0 |
| MatPlotLibNet.Geo | dotnet add package MatPlotLibNet.Geo |
13 map projections, GeoJSON parser, Natural Earth 110m data, geographic polygons |
| MatPlotLibNet.Verso | Verso → Extensions panel | A chart inside a Verso notebook cell, drawn as SVG (cookbook) |
| MatPlotLibNet.Notebooks | #r "nuget: MatPlotLibNet.Notebooks" |
Inline SVG in Polyglot / Jupyter notebooks. Microsoft has ended Polyglot Notebooks and .NET Interactive, which this package builds on, so existing notebooks keep working but nothing new is coming — for new work use MatPlotLibNet.Verso |
| MatPlotLibNet.Mcp | dnx MatPlotLibNet.Mcp |
MCP server — an AI agent renders charts over stdio (cookbook) |
| @matplotlibnet/angular | npm install @matplotlibnet/angular |
Angular components + TypeScript SignalR client |
| @matplotlibnet/react | npm install @matplotlibnet/react |
React hooks + components + TypeScript SignalR client |
| @matplotlibnet/vue | npm install @matplotlibnet/vue |
Vue 3 composables + TypeScript SignalR client |
Quick start
using MatPlotLibNet;
using MatPlotLibNet.Styling;
double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];
Plt.Create()
.WithTitle("My First Chart")
.WithTheme(Theme.Dark)
.AddSubPlot(1, 1, 1, ax => ax
.Plot(x, y, s => { s.Color = Colors.Blue; s.Label = "Data"; })
.WithLegend())
.Save("chart.svg");
Questions sur MatPlotLibNet MCP
Quels formats de fichiers le serveur peut-il exporter ?
Le serveur peut générer des graphiques sous forme de fichiers SVG, PNG, PDF ou GIF animés.
Nécessite-t-il un navigateur web ou JavaScript pour fonctionner ?
Non, il ne nécessite ni framework JavaScript, ni WebView, ni service hébergé pour le rendu des graphiques.