Get the FREE Ultimate OpenClaw Setup Guide →

ClaudeR

Connect RStudio to Claude, Codex, Gemini, and other AI assistants via MCP. Multi-agent orchestration, async execution, and zero-config setup with uvx.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio imnmv-clauder R -e if (!requireNamespace('ClaudeR', quietly = TRUE)) install.packages('devtools'); devtools::install_github('IMNMV/ClaudeR'); library(ClaudeR); clauder_start_server() \
  --env CLAUDE_R_PORT="default port if overridden (optional)" \
  --env CLAUDE_R_LOG_DIR="path/to/log/dir (optional)"

How to use

ClaudeR is an R package that creates an MCP server bridging RStudio with Claude-based AI assistants (such as Claude Desktop, Claude Code, Codex, Gemini CLI, or other MCP-based tools). This enables interactive coding sessions where the AI can execute R code in your active R session and return results in real time. The server supports multi-agent orchestration, session routing, and tools to read viewer content, insert text, and export clean scripts. To use it, install the ClaudeR package in your R environment, start the MCP server, and connect your MCP-enabled agent to the running ClaudeR server. Once connected, agents can send code execution requests, fetch results, inspect plots and outputs, and persist logs across sessions. The system also supports non-default RStudio sessions, session routing, and per-agent contexts so you can run multiple AI agents within the same or across different RStudio windows.

How to install

Prerequisites:

  • R (4.x or newer) and RStudio (optional but recommended)
  • Internet access to install packages from CRAN or GitHub
  1. Install required R tooling
  • If you don’t have devtools installed, install it:
if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
  1. Install ClaudeR from GitHub
  • Install the ClaudeR MCP server package from the official repository:
devtools::install_github("IMNMV/ClaudeR")
  1. Load the package and start the MCP server
library(ClaudeR)
# Start the MCP server (the function name may vary by version; use clauder_start_server() if available)
clauder_start_server()
  1. Configure your MCP client to connect to the ClaudeR server
  • The server typically listens on a port (default) on localhost. Ensure your MCP client points to that address/port.
  • If your setup requires environment overrides, set CLAUDE_R_PORT or related variables as described in the mcp_config section.

Note: For ongoing integration, refer to the package documentation for updated startup commands, ports, and client libraries.

Additional notes

Tips and common issues:

  • Ensure you have the latest ClaudeR version from GitHub for the most up-to-date MCP annotations and tools.
  • If you run multiple RStudio sessions, each session can publish to a distinct MCP server port; use session routing to connect agents to the desired session.
  • Check logs in the configured log directory to troubleshoot startup or agent connection issues.
  • When updating the MCP bridge or agent tools, restart the ClaudeR server to ensure agents re-register properly.
  • For advanced usage, you can customize environment variables (e.g., log paths, port) via the mcp_config env section.
  • If using multiple agents, each agent gets a unique ID and per-agent context to keep actions isolated and attributable.
  • Ensure your firewall or network policy allows the MCP client to reach the server port.

Related MCP Servers

Sponsor this space

Reach thousands of developers