Skip to main content

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.
  • We have provided a helper script that you can use to set up the MCP server to work with Claude Desktop. You can run it with uv run --python=3.13 https://raw.githubusercontent.com/zygi/r-playground-mcp/refs/heads/master/scripts/setup_helper.py. With your permission, it will:
    • Set the R_HOME environment variable to your R installation
    • Install the MCP inside your Claude Desktop configuration.
  • That's it! Starting Claude Desktop should now display

Release files for rplayground-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rplayground-mcp 0.1.2
File Size Uploaded
rplayground_mcp-0.1.2.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rplayground-mcp 0.1.2
File Interpreter ABI Platform
rplayground_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / rplayground_mcp-0.1.2.tar.gz

Download URL rplayground_mcp-0.1.2.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba5db918e6cf703c5bfd6c1acae71e3b686338a952554fec5916bd17d570aa1
BLAKE2b-256 checksum
How to use checksums
5533e02f53ba316b553472b8b9931e67a692c7e2c0028c5d8efb39f5160693ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release files / rplayground_mcp-0.1.2-py3-none-any.whl

Download URL rplayground_mcp-0.1.2-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e6525a46f5cbbfd91038db6aaa40e87b0d9b7f2faa6280716e65327ccedd124
BLAKE2b-256 checksum
How to use checksums
f26edd1b772906a067740960bdb970342f8b28bb9428465c02b8f6cf07eae7b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page