Skip to main content

An MCP that lets the model transiently execute R code.

Project description

MCP R Playground

An MCP server that allows AI models to execute R code, see its results, and draw and observe plots. It can be used for sophisticated agentic deployments, but also as a way to augment AI clients like Claude Desktop when talking to them about scientific papers.

Features:

  • Stateful sessions: each conversation thread gets a new session, but the session can persist across calss and user/assistant interactions.
  • Graphics output: multimodal models can draw plots using standard R libraries like ggplot, see those plots, and react to them.
  • NO HOST ISOLATION: while each session runs as a separate R environment, they have access to global dependencies and all files on the computer. While unlikely, a rogue model could write R code that deletes your important files.
  • Works in all common operating systems/architectures - Windows x64 / arm64, MacOS, Linux

Configuration

Currently there's just one configuration parameter that can be set as an environment variable:

  • RPLAYGROUND_MCP_SUPPORT_IMAGE_OUTPUT, default True. If set to False, image output will be disabled, and tool descriptions will be made to reflect that.

Installation

Basic instructions for technical users:

  1. Have R installed, and the R_HOME environment variable set
  2. Have a recent version of the uv installed
  3. run uvx --python=3.13 rplayground-mcp, and it should just work.

Detailed Installation

This section is for less technical users who want to set up this MCP to use with Claude Desktop or similar AI user interfaces that support MCP extensions.

Windows

  • Make sure you have R installed. The recommended source is here https://cran.rstudio.com/ .
  • Make sure you have uv installed. uv is the project management tool for Python, the programming language this tool is written in. More detailed instructions can be found here https://docs.astral.sh/uv/getting-started/installation/#pypi, we provide the instructions for the most straightforward method:
    1. Open the Terminal app
    2. In the terminal, paste in the following installation command: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    3. Close the Terminal app and reopen it
    4. type in uv and confirm you don't see any red errors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rplayground_mcp-0.1.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rplayground_mcp-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file rplayground_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: rplayground_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for rplayground_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ffef97fdf79f206f8c8686a4b46f69eec6035be068b1e8f809ad31f9d1ba0ee9
MD5 f43c0ea23262c26392eaf00960ffc305
BLAKE2b-256 d15c917f2d5b627977f0d0bd2e37bc3ce40e4bcd5f10ffe535263dbf6f1dc8e7

See more details on using hashes here.

File details

Details for the file rplayground_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rplayground_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c4a582772e2f73547a2e3a8cd19e6ac947efc1f1bb35be68b5c05b9d420adea
MD5 885e328b3d52cb6225e915d306f9d82c
BLAKE2b-256 ad361d48b49699112ba88c339c4bc2ffa4e8c213331da7956558b0efe411d0cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page