Avalonia.Controls.Charts.Mcp
12.3.0
Prefix Reserved
{ "inputs": [ { "type": "promptString", "id": "AVALONIA_LICENSE_KEY", "description": "The same Avalonia license key used by Charts projects. It must include a Charts entitlement.", "password": true } ], "servers": { "Avalonia.Controls.Charts.Mcp": { "type": "stdio", "command": "dnx", "args": ["Avalonia.Controls.Charts.Mcp@12.3.0", "--yes"], "env": { "AVALONIA_LICENSE_KEY": "${input:AVALONIA_LICENSE_KEY}" } } } }
.vscode/mcp.json settings file.
dotnet tool install --global Avalonia.Controls.Charts.Mcp --version 12.3.0
dotnet new tool-manifest
dotnet tool install --local Avalonia.Controls.Charts.Mcp --version 12.3.0
#tool dotnet:?package=Avalonia.Controls.Charts.Mcp&version=12.3.0
nuke :add-package Avalonia.Controls.Charts.Mcp --version 12.3.0
Avalonia Charts MCP Server
This project implements a Model Context Protocol (MCP) server for generating and rendering Avalonia Charts. It allows LLMs to programmatically create, customize, and visualize over 60 different types of charts directly within a conversation.
Features
- 87 MCP Tools: 86 chart-generation tools plus a catalog tool, from basic Bar and Line charts to complex Statistical and Flow visualizations.
- Headless Rendering: Powered by Avalonia's headless platform and SkiaSharp with window management, resource disposal, and graceful shutdown.
- Rich Code Generation: Every tool provides technically accurate C# and XAML snippets alongside the rendered image.
Technical Architecture
The server is built using:
- .NET 9.0: Leveraging the latest C# and performance features.
- Avalonia UI: The core rendering engine, providing cross-platform visual excellence.
- ModelContextProtocol: The standard for AI interaction.
- Serilog: Comprehensive logging for auditing and troubleshooting.
Privacy and Security
The MCP server keeps chart generation features local to this process. It does not call external LLM providers, does not configure OpenAI, Azure OpenAI, Semantic Kernel, Ollama, or embedding/vector-store services, and does not read provider API keys. Any LLM or hosted AI service is controlled by the MCP client that launches this server.
Tool inputs are parsed and rendered locally. The MCP client receives the rendered chart image plus generated C# and XAML snippets; those generated snippets can include labels, values, colors, and other fields from the chart JSON payload. Do not include secrets, API keys, credentials, or sensitive personal data in chart JSON, prompts, titles, labels, or descriptions unless the connected MCP client is approved to receive that data.
Default file logging is intended for lifecycle and fatal host diagnostics only. Logs are written under logs/AvaloniaChartsMcpServer_*.log with an Information default level, while Microsoft and ModelContextProtocol framework logs are limited to Warning and above. MCP tool implementations must not log raw chart JSON, generated code, rendered image data, prompts, or tool payloads by default.
For troubleshooting, the minimum log level can be changed with AVALONIA_CHARTS_MCP_LOG_LEVEL. Treat logs from more verbose levels as potentially sensitive, restrict access to them, and delete them when no longer needed.
Available Tools (87)
The server exposes 86 specialized chart-generation tools plus one catalog tool, organized into the following categories:
Catalog
avalonia_list_charts: Lists all available chart tools with descriptions and example data formats.
Cartesian Charts
avalonia_line_chart: Trends and time-series data.avalonia_area_chart: Quantitative data with filled areas.avalonia_bar_chart: Comparing values across categories.avalonia_scatter_chart: Relationships between two variables.avalonia_combo_chart: Combined series (e.g., Bar and Line together).
Circular Charts
avalonia_pie_chart: Proportions of a whole.avalonia_donut_chart: Proportions with a center hole.avalonia_progress_donut: Single-value circular progress.avalonia_semi_donut: Semi-circle proportions.avalonia_nightingale_rose: Polar area chart (Coxcomb).avalonia_radial_bar_chart: Circular arranged bars.avalonia_sunburst_chart: Hierarchical proportions.
Gauge Charts
avalonia_gauge_chart: Standard dial gauge.avalonia_bullet_chart: Performance vs target and ranges.avalonia_circular_gauge: Circular needle indicator.avalonia_linear_gauge: Horizontal/vertical scale indicator.avalonia_gradient_ring_chart: Progress/value as a colored ring.avalonia_liquid_fill_gauge: Value as a fluid level.
Polar Charts
avalonia_radar_chart: Multi-variate comparisons (Spider chart).avalonia_polar_chart: Angular/radial line data.avalonia_wind_rose_chart: Directional frequency distributions.avalonia_smith_chart: Complex impedance/engineering data.avalonia_polar_area_chart: Equal-angle sectors with variable radii.
Statistical Charts
avalonia_violin_plot: Distribution density and range.avalonia_boxplot_chart: Quartiles, median, and outliers.avalonia_ridgeline_chart: Multiple distribution comparisons.avalonia_beeswarm_plot: Individual point distribution.avalonia_contour_plot: 2D density topo-curves.avalonia_density_plot: Kernel Density Estimation.avalonia_strip_plot: Points along a single categorical axis.
Comparison & Ranking
avalonia_tornado_chart: Paired comparison by category.avalonia_bump_chart: Changes in rank over time.avalonia_slope_chart: Before/after state changes.avalonia_dumbbell_chart: Range or gap comparisons.avalonia_pareto_chart: Frequency vs cumulative percentage.avalonia_mirror_bar_chart: Back-to-back horizontal bars.avalonia_diverging_bar_chart: Opposing positive/negative values.avalonia_pyramid_chart: Hierarchical breakdown.avalonia_population_pyramid: Age/gender structure.avalonia_funnel_chart: Sequential process stages.
Flow & Network
avalonia_sankey_chart: Flow between multiple categories.avalonia_arc_diagram: Links between ordered nodes.avalonia_chord_diagram: Inter-relationships in a circle.avalonia_alluvial_chart: Structural changes over steps/time.avalonia_flow_chart: General process flow diagrams.avalonia_network_chart: Node-link relationships.avalonia_force_directed_graph: Physics-based node graph layout.avalonia_organization_chart: Traditional hierarchy tree.
Proportional & Hierarchical
avalonia_treemap_chart: Nested rectangles for hierarchies.avalonia_icicle_chart: Adjacency diagram hierarchy.avalonia_circle_packing_chart: Hierarchy packed into nested circles.avalonia_dendrogram_chart: Hierarchical clustering tree.avalonia_flame_graph: Stack/profile hierarchy visualization.avalonia_indented_tree_chart: Indented hierarchy tree.avalonia_radial_tree_chart: Hierarchy arranged radially.avalonia_waffle_chart: 10x10 grid for percentages.avalonia_mekko_chart: Variable width stacked bars (Marimekko).avalonia_parliament_chart: Seat distribution hemicycle.avalonia_venn_chart: Set relationships and intersections.
Grid & Matrix Charts
avalonia_heatmap_chart: Value intensity by color grid.avalonia_matrix_chart: Correlation or relationship matrix.avalonia_carpet_plot: Two independent variables against a dependent variable.avalonia_hexbin_chart: Hexagonal bin density for X/Y points.avalonia_mosaic_chart: Proportional groups and sub-groups.avalonia_parallel_coordinates_chart: Multi-dimensional records across parallel axes.avalonia_ternary_chart: Three-part composition plot.avalonia_calendar_heatmap: Activity distribution by date.
Time & Scheduling
avalonia_gantt_chart: Project management and task schedules.avalonia_swimlane_chart: Workflow tasks grouped by lane.avalonia_event_timeline: Chronological time events.avalonia_spiral_timeline: Time represented as a spiral.
Financial Charts
avalonia_candlestick_chart: Financial price movement.avalonia_ohlc_chart: Open-High-Low-Close bars.avalonia_heikin_ashi_chart: Smoothed OHLC trend candles.avalonia_kagi_chart: Price reversal movement chart.avalonia_renko_chart: Fixed-size price movement bricks.avalonia_point_and_figure_chart: X/O price movement columns.
Map Charts
avalonia_choropleth_map: Geo-regions colored by values.avalonia_shape_map: Custom multi-layer geometric shapes.
Dashboards & KPI
avalonia_sparkline_chart: Ultra-compact trend lines.avalonia_kpi_card: Metric display with status/change.
Data & Text
avalonia_table_chart: Tabular data with conditional styling.avalonia_word_cloud: Word frequency cloud.
Bubble Charts
avalonia_bubble_chart: Bubble chart using X, Y, and size values.avalonia_packed_bubble_chart: Non-hierarchical bubble packing.avalonia_bubble_cloud: Force-directed bubble cloud layout.
Quick Start
Build
dotnet build src/Avalonia.Controls.Charts.Mcp
Local Configuration
To use this server from source with MCP clients, add the following to your configuration file:
{
"servers": {
"Avalonia.Controls.Charts.Mcp": {
"type": "stdio",
"command": "dotnet",
"args": [
"run",
"--project",
"src/Avalonia.Controls.Charts.Mcp/Avalonia.Controls.Charts.Mcp.csproj"
],
"env": {
"AVALONIA_LICENSE_KEY": "YOUR_AVALONIA_LICENSE_KEY"
}
}
}
}
AVALONIA_LICENSE_KEY accepts the same online or offline Avalonia portal key used with <AvaloniaUILicenseKey> in Charts projects; there is no separate MCP license. The key must include a Charts entitlement. MCP registry metadata marks it as a required secret so compatible clients can request it without storing it in the package.
MCP configuration formats vary by client; the outer property may be named servers, mcpServers, or something else. Place the env block in this server's entry. GUI-launched clients may not inherit environment variables from your shell profile.
Package
Pack the MCP server as a NuGet MCP server package:
dotnet run --project build/_build.csproj /p:ManagePackageVersionsCentrally=false -- \
--target CreateNugetPackages \
--configuration Release \
--output artifacts/packages
The project emits a small NuGet tool package plus self-contained runtime packages for Windows, macOS, and Linux. Publish every generated .nupkg file for the package to be runnable on every supported platform.
The build uses the same resolved package version for Avalonia.Controls.Charts and Avalonia.Controls.Charts.Mcp. For example, packing from a release/12.0.1 branch produces 12.0.1 for both packages, and the packaged .mcp/server.json also uses 12.0.1.
The build also writes artifacts/packages/Avalonia.Controls.Charts.Mcp.server.json for MCP Registry publishing with that same resolved version.
If you pack the MCP project directly, pass the same PackageVersion as the library package:
dotnet pack src/Avalonia.Controls.Charts.Mcp -c Release -p:PackageVersion=<same-version-as-Avalonia.Controls.Charts>
The packaged .mcp/server.json is generated during pack from the MSBuild PackageVersion, so release branches, release tags, CI builds, and local builds all get the resolved package version. To write the same manifest to an explicit path for registry publishing, pass McpServerManifestOutputPath:
dotnet msbuild src/Avalonia.Controls.Charts.Mcp/Avalonia.Controls.Charts.Mcp.csproj \
-target:GenerateMcpServerManifest \
-property:PackageVersion=<version> \
-property:McpServerManifestOutputPath="$(pwd)/artifacts/mcp-server.json"
NuGet Configuration
After the package is published to NuGet.org, MCP clients with the .NET 10 SDK or later can run the server with dnx. Replace VERSION with the version you are installing, and set your Avalonia license key in the env block:
{
"servers": {
"Avalonia.Controls.Charts.Mcp": {
"type": "stdio",
"command": "dnx",
"args": [
"Avalonia.Controls.Charts.Mcp@VERSION",
"--yes"
],
"env": {
"AVALONIA_LICENSE_KEY": "YOUR_AVALONIA_LICENSE_KEY"
}
}
}
}
The packaged .mcp/server.json declares the NuGet package identity, stdio transport, and registry name net.avaloniaui/charts-mcp.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.