mcp-vegalite-server

mcp-vegalite-server

0

This project is an MCP server that specializes in working with VegaLite to create and visualize data diagrams. It provides tools for data saving and visualization, requiring prior installation of the vl-convert CLI.

tech.unravel/mcp-vegalite-server

An MCP server for working with Vegalite, using vl-convert.

We create two simple tools:

  • save-data
  • visualize-data

Using these, a host can create beautiful vegalite diagrams by:

  • calculating the data needed and saving it,
  • then generating the vegalite-spec using an LLM
  • then rendering the spec using the data and access to vl-convert

Usage

Building the Jar

$ make clean && make build

Running the MCP server

PRE-REQUISITES: Needs vl-convert CLI to be installed.

Some example commands you can try in Claude Desktop or Inspector:

Here is some example data for you:

[
    { "year": 2011, "value": 14.6, "growth_type": "Market Cap Growth" },
    { "year": 2011, "value": 11.4, "growth_type": "Revenue Growth" },
    { "year": 2011, "value": 26.6, "growth_type": "Net Income Growth" },
    { "year": 2012, "value": 40.1, "growth_type": "Market Cap Growth" },
    { "year": 2012, "value": 42.7, "growth_type": "Revenue Growth" },
    { "year": 2012, "value": 36.9, "growth_type": "Net Income Growth" },
    { "year": 2013, "value": 16.9, "growth_type": "Market Cap Growth" },
    { "year": 2013, "value": 14.6, "growth_type": "Revenue Growth" },
    { "year": 2013, "value": 15.3, "growth_type": "Net Income Growth" },
    { "year": 2014, "value": 9.6, "growth_type": "Market Cap Growth" },
    { "year": 2014, "value": 7.9, "growth_type": "Revenue Growth" },
    { "year": 2014, "value": 10.9, "growth_type": "Net Income Growth" },
    { "year": 2015, "value": 5.8, "growth_type": "Market Cap Growth" },
    { "year": 2015, "value": 6.7, "growth_type": "Revenue Growth" },
    { "year": 2015, "value": 6.2, "growth_type": "Net Income Growth" },
    { "year": 2016, "value": -12.4, "growth_type": "Market Cap Growth" },
    { "year": 2016, "value": -3.9, "growth_type": "Revenue Growth" },
    { "year": 2016, "value": -32.2, "growth_type": "Net Income Growth" },
    { "year": 2017, "value": 25.3, "growth_type": "Market Cap Growth" },
    { "year": 2017, "value": 5.9, "growth_type": "Revenue Growth" },
    { "year": 2017, "value": 43.9, "growth_type": "Net Income Growth" }
]

Visualize this data for me using vega-lite.

Before running the vegalite MCP server

Remember:

  1. Replace the full-path to the mcp-vegalite-server JAR with the correct path on your system
  2. Specify the full-path to vl-convert on your system
In Claude Desktop
    "vegalite": {
      "command": "java",
      "args": [
        "-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory",
        "-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog",
        "-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector",
        "-Dlog4j2.configurationFile=log4j2-mcp.xml",
        "-Dbabashka.json.provider=metosin/jsonista",
        "-Dlogging.level=INFO",
        "-Dmcp.vegalite.vl_convert_executable=/Users/vedang/.cargo/bin/vl-convert",
        "-cp",
        "/Users/vedang/mcp-vegalite-server/target/tech.unravel/mcp-vegalite-server-1.0.0.jar",
        "tech.unravel.mcp_vegalite_server"
      ]
    }
In MCP Inspector

Remember to use the full-path to the mcp-vegalite-server JAR on your system.

npx @modelcontextprotocol/inspector java -Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j2.configurationFile=log4j2-mcp.xml -Dbabashka.json.provider=metosin/jsonista -Dlogging.level=INFO -Dmcp.vegalite.vl_convert_executable=/Users/vedang/.cargo/bin/vl-convert -cp /Users/vedang/mcp-vegalite-server/target/tech.unravel/mcp-vegalite-server-1.0.0.jar tech.unravel.mcp_vegalite_server

License

Copyright © 2025 Unravel.tech Engineering

Distributed under the MIT License