R MCP Server

# R-Server MCP A specialized Model Context Protocol (MCP) server that enables AI models to generate data visualizations using R's ggplot2 library and

Local serverstdioGo

What is the R MCP Server?

R-Server MCP A specialized Model Context Protocol (MCP) server that enables AI models to generate data visualizations using R's ggplot2 library and execute R

The short version

This MCP server provides a streamlined interface for creating statistical visualizations and executing R scripts without requiring direct access to an R environment. It exposes two MCP tools: - render_ggplot: Generates visualizations from R code containing ggplot2 commands - execute_r_script: Executes any R script and returns the text output

  • ggplot2 Rendering — Execute R code containing ggplot2 commands and return the resulting visualization
  • R Script Execution — Execute any R script and return the text output
  • Format Options — Support for PNG, JPEG, PDF, and SVG output formats
  • Customization — Control image dimensions and resolution
  • Error Handling — Clear error messages for invalid R code or rendering failures
  • MCP Protocol Compliance — Full implementation of the Model Context Protocol

What it needs from you

  • Go 1.22 or later - R 4.0 or later with ggplot2 package - Docker (for containerized execution)

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

How to install the R MCP Server

{
  "mcpServers": {
    "r-server": {
      "command": "/path/to/r-server",
      "disabled": false,
      "autoApprove": []
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Go 1.22 or later - R 4.0 or later with ggplot2 package - Docker (for containerized execution)

Frequently asked questions

It provides two MCP tools: `render_ggplot` to create plots from ggplot2 code and return them as image files, and `execute_r_script` to run any R code and capture text output. Both are accessed through the stdio MCP transport.