Cover image
Try Now
2025-04-04

3 years

Works with Finder

1

Github Watches

0

Github Forks

2

Github Stars

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 scripts.

Overview

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

Features

  • 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
  • Docker Integration: Secure execution of R code in isolated containers

Requirements

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

Building

# Build the Docker image
task docker:build

# Run the server in Docker
task docker:run

Using Docker with stdin/stdout

The server can be run in Docker while preserving stdin/stdout communication, which is essential for MCP:

# Build and run using docker-compose
./start_server.sh --docker

Or set an environment variable:

USE_DOCKER=true ./start_server.sh

This approach ensures that stdin and stdout are properly connected between the host and the container, allowing seamless MCP communication.

Usage

MCP Integration

To use this server with an MCP client, configure it in your MCP settings file:

Local Execution

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

Docker Execution

{
  "mcpServers": {
    "r-server": {
      "command": "/path/to/start_server.sh",
      "args": ["--docker"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

The MCP client will automatically communicate with the server using stdio transport, which is the recommended approach for stability and reliability. The dockerized version maintains this communication pattern while providing isolation and dependency management.

License

Creative Commons Attribution-NonCommercial 4.0 International (CC-BY-NC 4.0)

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

See the LICENSE file for details.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • HiveNexus
  • Un bot de chat IA pour les petites et moyennes équipes, soutenant des modèles tels que Deepseek, Open AI, Claude et Gemini. 专为中小团队设计的 Ai 聊天应用 , 支持 Deepseek 、 Open Ai 、 Claude 、 Gemini 等模型。

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Sysc4lls
  • Lecteur de documentation IDA (Sort-of) MCP Server

    Reviews

    1 (1)
    Avatar
    user_txdEnm0Q
    2025-04-17

    As a dedicated user of rlang-mcp-server, I am thoroughly impressed by its robust performance and seamless integration capabilities. Created by gdbelvin, this server stands out for its reliability and efficiency. Whether you're dealing with complex data analysis or straightforward tasks, this tool consistently delivers excellent results. Check it out at https://github.com/gdbelvin/rlang-mcp-server and see how it can enhance your workflow.