Skip to content
MCP profile

ClaudeR - RStudio MCP Server

Connect RStudio to AI assistants for interactive R coding and data analysis.

Productivity & WorkflowPackagePythonOpen SourceExternal
Last updated
March 16, 2026
Visibility
Public
ByRegistry

About This MCP Server


Connect RStudio directly to Claude Desktop, Claude Code, Codex, Gemini CLI, or any other MCP based AI assistant for interactive coding and data analysis.

This package is also compatible with Cursor and any service that support MCP servers.

ClaudeR uses the Model Context Protocol (MCP) to create a bidirectional connection between an AI assistant and your RStudio environment. MCP is an open protocol from Anthropic that allows the AI to safely interact with local tools and data.

Here's the workflow: 1. The Python MCP server acts as a bridge. 2. The AI sends a code execution request to the MCP server. 3. The server forwards the request to the R add-in running in RStudio. 4. The code executes in your R session, and the results are sent back to the AI.

This architecture ensures that the AI can only perform approved operations through well-defined interfaces, keeping you in complete control of your R environment.

Capabilities
execute_r: Execute R code and return the output.execute_r_with_plot: Execute R code that generates a plot.execute_r_async: Execute long-running R code asynchronously (>25 seconds). Returns a job ID for polling.get_async_result: Poll for the result of an async job. Includes a built-in delay to throttle polling.list_sessions: List all active RStudio sessions the agent can connect to.connect_session: Connect to a specific RStudio session by name for multi-session workflows.get_session_history: View execution history filtered by agent ID.read_file: Read any text file from disk (.R, .qmd, .csv, .log, etc.) without needing it open in RStudio.get_active_document: Get the content of the active document in RStudio.get_r_info: Get information about the R environment.modify_code_section: Modify a specific section of code in the active document.insert_text: Insert text at the current cursor position or a specific line/column in the active document.

Tools & Endpoints5

Example Workflow

• "I have a dataset named data in my environment. Perform exploratory data analysis on it."

• "Load the mtcars dataset and create a scatterplot of mpg vs. hp with a trend line."

• "Fit a linear model to predict mpg based on wt and hp."

• "Generate a correlation matrix for the iris dataset and visualize it."

• "I have a qmd file active. Please make a nice quarto presentation on gradient descent. The audience is very technical. Make sure it looks smooth. Save the presentation in /Users/nyk/QuartoDocs/"

Why Use ClaudeR - RStudio MCP Server?

  • execute_r: Execute R code and return the output.
  • execute_r_with_plot: Execute R code that generates a plot.
  • execute_r_async: Execute long-running R code asynchronously (>25 seconds). Returns a job ID for polling.
  • get_async_result: Poll for the result of an async job. Includes a built-in delay to throttle polling.
  • list_sessions: List all active RStudio sessions the agent can connect to.
  • connect_session: Connect to a specific RStudio session by name for multi-session workflows.
  • get_session_history: View execution history filtered by agent ID.
  • read_file: Read any text file from disk (.R, .qmd, .csv, .log, etc.) without needing it open in RStudio.
  • get_active_document: Get the content of the active document in RStudio.
  • get_r_info: Get information about the R environment.
  • modify_code_section: Modify a specific section of code in the active document.
  • insert_text: Insert text at the current cursor position or a specific line/column in the active document.

Limitations

  • Each R session can connect to one Claude Desktop/Cursor app at a time. However, multiple CLI agents (Claude Code, Gemini CLI) can share the same session alongside a Desktop app. To isolate agents, run separate RStudio windows with different session names and ports.
  • You can stop the connection to the Shiny UI by clicking the Stop button in the console to make changes alongside the AI, but to stop the connection you will need to restart the RSession.
  • R is single-threaded, but async jobs run in a separate process via callr so the main session stays responsive. The background process does not share the main session's environment, so async code must be self-contained.

Specifications

Status
live
Industry
Productivity & Workflow
Category
General
Server type
Package
Language
Python
License
Open Source
Verified
Yes

Hosting


Hosting Options

  • Package

Performance


Usage


Quick Reference


Name
ClaudeR - RStudio MCP Server
Function
Connect RStudio to AI assistants for interactive R coding and data analysis.
Available Tools
"I have a dataset named data in my environment. Perform exploratory data analysis on it.", "Load the mtcars dataset and create a scatterplot of mpg vs. hp with a trend line.", "Fit a linear model to predict mpg based on wt and hp.", "Generate a correlation matrix for the iris dataset and visualize it.", "I have a qmd file active. Please make a nice quarto presentation on gradient descent. The audience is very technical. Make sure it looks smooth. Save the presentation in /Users/nyk/QuartoDocs/"
Transport
Package
Language
Python
Source
External (Registry)
License
Open Source
Get started

Ready to integrate this MCP server?

Book a demo to see how this server fits your workflow, or explore the full catalog.

Related MCP Servers


Catalog Workspace

Discover agents, MCP servers, and skills in one governed surface

Use structured catalog views to compare readiness, ownership, integrations, and deployment posture before rollout.