RStudio

v1.0.0Data Science & MLstable

MCP server providing AI assistants with deep RStudio integration capabilities

rstudiomcpai-integration
Share:
8
Stars
0
Downloads
0
Weekly
0/5

What is RStudio?

RStudio is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server providing ai assistants with deep rstudio integration capabilities

MCP server providing AI assistants with deep RStudio integration capabilities

This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP server providing AI assistants with deep RStudio integra

Use Cases

Access RStudio functionality for statistical computing.
Execute R scripts and analyses through Claude.
cafferychen777

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 27, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx rstudio

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use RStudio

The RStudio MCP Server provides AI assistants with deep integration into R and RStudio, enabling Claude to execute R code, manage R environments, install and update packages, create and open RStudio projects, and retrieve execution history — all through a local MCP server that bridges Claude's conversational interface with a live R runtime.

Prerequisites

  • Python 3.9 or later installed
  • R 4.0 or later installed and accessible as 'Rscript' in PATH
  • RStudio Desktop (optional, for project management tools)
  • Git to clone the repository
  • Claude Desktop or Claude Code
1

Clone the repository and install dependencies

Download the RStudio MCP server and install its Python dependencies.

git clone https://github.com/cafferychen777/Rstudio-mcp.git
cd Rstudio-mcp
pip install -e .
pip install -r requirements.txt
2

Initialize the configuration file

Run the built-in init command to create the default configuration file at ~/.rstudio-mcp/config.yaml.

rstudio-mcp --init-config
3

Review and customize the configuration

Edit the generated config file to set your R version, environment storage path, execution timeout, and any functions to block for security.

# ~/.rstudio-mcp/config.yaml
debug: false
logging:
  level: INFO
rstudio:
  default_r_version: "4.3"
environments:
  default_location: "~/.rstudio-mcp/environments"
security:
  execution_timeout: 30
  blocked_functions:
    - system
    - shell
4

Start the MCP server

Launch the server. Use --debug for verbose output during initial setup.

rstudio-mcp
# or for debug output:
rstudio-mcp --debug
5

Configure Claude Desktop

Add the RStudio MCP server to your Claude Desktop configuration.

{
  "mcpServers": {
    "rstudio": {
      "command": "rstudio-mcp",
      "env": {
        "R_HOME": "/usr/local/lib/R",
        "RSTUDIO_MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}
6

Verify R integration with a test execution

Ask Claude to execute a simple R expression to confirm the server is connected to the R runtime.

RStudio Examples

Client configuration

Claude Desktop configuration for the RStudio MCP server with R_HOME specified.

{
  "mcpServers": {
    "rstudio": {
      "command": "rstudio-mcp",
      "env": {
        "R_HOME": "/usr/local/lib/R",
        "RSTUDIO_MCP_LOG_LEVEL": "INFO",
        "RSTUDIO_MCP_CONFIG": "/Users/you/.rstudio-mcp/config.yaml"
      }
    }
  }
}

Prompts to try

R analysis prompts to use with Claude once the RStudio MCP server is connected.

- "Create a new R environment called 'data-analysis' and install the tidyverse package"
- "Execute this R code in my data-analysis environment: mtcars %>% group_by(cyl) %>% summarise(mean_mpg = mean(mpg))"
- "List all packages installed in my current R environment"
- "Create a new RStudio project called 'sales-forecast' in ~/projects"
- "Show me the last 10 R commands I executed in this session"

Troubleshooting RStudio

execute_r_code fails with 'R not found' or 'Rscript: command not found'

Set the R_HOME environment variable in the Claude Desktop config to the directory where R is installed (e.g., /usr/local/lib/R on macOS with Homebrew, or /usr/lib/R on Linux). You can find it by running 'R RHOME' in your terminal.

'rstudio-mcp' command not found after pip install

The CLI entry point may not be in PATH. Run 'python -m rstudio_mcp' as an alternative, or find the installed script with 'pip show rstudio-mcp' and add its location to PATH. In the Claude Desktop config, use the full path to the binary.

R code execution times out for long-running analyses

Increase the security.execution_timeout value in ~/.rstudio-mcp/config.yaml (value is in seconds, default is 30). For data-intensive work, set it to 120 or higher and restart the server.

Frequently Asked Questions about RStudio

What is RStudio?

RStudio is a Model Context Protocol (MCP) server that mcp server providing ai assistants with deep rstudio integration capabilities It connects AI assistants to external tools and data sources through a standardized interface.

How do I install RStudio?

Follow the installation instructions on the RStudio GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with RStudio?

RStudio works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is RStudio free to use?

Yes, RStudio is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Data Science & ML MCP Servers

Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "rstudio": { "command": "npx", "args": ["-y", "rstudio"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use RStudio?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides