MCP server MatPlotLibNet
Коммит 7 нояб. 2026 г.Позволяет ИИ-агентам отрисовывать сложные графики и визуализации данных в форматах PNG, SVG или PDF на основе спецификации JSON.
Также известен как xkqg/MatPlotLibNet
- Звёзды
- 20
- Инструменты
- —
- Загрузки, 30 дней
- —
- Последняя версия
- 1.18.1
- Последний коммит
- 7 нояб. 2026 г.
- Лицензия
- MIT
Что такое MatPlotLibNet MCP?
MatPlotLibNet — это MCP server. Позволяет ИИ-агентам отрисовывать сложные графики и визуализации данных в форматах PNG, SVG или PDF на основе спецификации JSON.
Сводка сгенерирована из README проекта
О MatPlotLibNet MCP server
matplotlibnet позволяет генерировать сложные визуализации данных прямо из ИИ-агента. Этот MCP server дает разработчикам возможность использовать ИИ для отрисовки 91 типа графиков, передавая спецификацию в формате JSON. Сервер преобразует эти инструкции в высококачественные визуальные результаты, включая форматы PNG, SVG, PDF или анимированные GIF.
Библиотека, лежащая в основе решения, разработана для экосистемы .NET и поддерживает C#, .NET 8 и .NET 10. Она служит мостом, который позволяет ИИ-клиенту отдавать команды серверу на построение чего угодно: от стандартных столбчатых диаграмм до специализированных научных графиков, таких как тройные диаграммы, хордовые диаграммы и облака слов. Благодаря использованию спецификации на базе JSON, сервер может обрабатывать сложные фигуры, содержащие геометрические формы, аннотации и несколько осей, не требуя наличия JavaScript-фреймворка или веб-представления.
Пользователи могут запрашивать сложные технические визуализации, такие как спектрограммы, скрипичные диаграммы или финансовые индикаторы. Сервер поддерживает продвинутые функции, включая MathText в стиле LaTeX, несколько осей Y и картографические проекции с встроенными данными Natural Earth, что делает его подходящим как для общего анализа данных, так и для специализированных инженерных задач.
Что вы можете с ним делать
- 1Генерация научных графиков данныхПопросите ИИ создать специализированный научный график, например, тройную диаграмму или диаграмму Пайпера, на основе набора данных.
- 2Создание финансовых технических индикаторовДайте агенту команду визуализировать рыночные тренды, используя конкретные технические индикаторы или данные в стиле японских свечей.
- 3Отрисовка географических визуализацийЗапросите карту с использованием картограмм (choropleth) или отображением точек данных вдоль дуг большого круга.
- 4Создание анимированных последовательностей данныхПопросите ИИ сгенерировать анимированный GIF или SVG, последовательно отображающий различные кадры данных.
Взято из README проекта. Каждый вариант использования проверен на соответствие цитате из него.
Конфигурация
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.
| Название | Описание | Тип |
|---|---|---|
| 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. |
Автоматические проверки
Запущено 13 нояб. 2026 г.Полный отчёт →Еще не проверено. Для сервера требуется оценка 80, отсутствие серьезных проблем и достаточно данных для нашей проверки. Как работают проверки · Что исправить, чтобы получить больше баллов
- Связанный и доступный исходный репозиторийПройдено
- Open source лицензия (OSI)Пройдено
- Коммит или релиз за последний годПройдено
- Имя пакета не похоже на популярный пакетНе проверялось
- Удаленная конечная точка использует HTTPSНе проверялось
- Деструктивные инструменты помеченыНе проверялось
- Нет скрытых инструкций для моделиПройдено
- Нет критических предупреждений в пакете или его зависимостяхНе проверялось
README
Открыть на 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");
Вопросы о MatPlotLibNet MCP
В каких форматах сервер может выводить файлы?
Сервер может отрисовывать графики в форматах SVG, PNG, PDF или в виде анимированных GIF-файлов.
Требуется ли для работы веб-браузер или JavaScript?
Нет, для отрисовки графиков не требуются JavaScript-фреймворки, WebView или сторонние хостинговые сервисы.