← Back to directory
C

ClaudeR

Community
Connect live R and Python sessions in RStudio or Positron to MCP agents
GitHub source repository ↗
★ 342 Stars Category · Dev Tools Very popular
56FMRS · C

ClaudeR connects MCP agents to live R sessions in RStudio and Positron and to live Python sessions, letting the agent execute code where your data and models already are, see plots, and read or edit the file open in your editor, with tool coverage spanning execution, editor control, audit, citations, logging, and checkpoints. It also brings research workflows: Reviewer Zero manuscript auditing, a typed multi-agent coordination protocol with a consensus gate, systematic-review screening, grant panel mode, and response-to-reviewers. It ships as the clauder-mcp PyPI package over stdio with uvx-based zero-config setup, and supports Claude Desktop, Claude Code, Codex, Qwen, Antigravity, and Cursor. It positions itself as a supervised power tool: it states plainly that binding to localhost is not a security boundary, that its code validator is a seatbelt rather than a sandbox, and that auditing third-party manuscripts carries prompt-injection risk, so it suits local research users who accept those trade-offs and is unsuitable for shared or multi-user environments needing isolation. The README badge states an MIT license, while the repository license field reports NOASSERTION. The supplied README is truncated in the troubleshooting section.

Reliability
8/20
Security and permissions
9/20
Maintenance
12/20
Documentation
14/20
Setup experience
13/20
Read the FMRS scoring method →

ClaudeR connects MCP-configured LLM agents such as Claude Code, Codex, and Gemini to the R session you are already working in (RStudio or Positron), and to a live Python session via its companion package. The agent runs code where your cleaned data and fitted models actually are, sees the plots it draws, reads objects in your environment, and can edit the file open in your editor. Several agents can share one session and divide the work, or run separate sessions side by side. It ships additional research workflows: Reviewer Zero for automated manuscript auditing, a multi-agent coordination protocol with a consensus gate, systematic-review screening, grant panel mode, and response-to-reviewers. The Python bridge is published on PyPI as clauder-mcp and runs with uvx for zero-config setup over stdio; the R package installs from GitHub via devtools::install_github("IMNMV/ClaudeR"). Note: the README badge states an MIT license, while the repository license field reports NOASSERTION.

Tools

execute_r
Execute R code and return the output.
execute_r_with_plot
Execute R code that generates a plot the model can see.
execute_r_async
Execute long-running R code (over roughly 25 seconds) asynchronously, returning a job ID for polling.
get_async_result
Poll for the result of an async job, with a built-in delay to throttle polling.
list_sessions
List all active RStudio sessions an 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 file from disk (.R, .qmd, .csv, .log, etc.) without opening it in RStudio; .docx and .pdf are extracted as structured text with headings marked and table cells kept separated, with line pagination.
check_cross_references
Deterministic internal-reference integrity: flags dangling mentions (e.g. "see Table 4" with no Table 4) and tables or figures never referenced in the text.
reconcile_values
The audit backbone: extracts every numeric value from a manuscript and reconciles each against numbers your code actually produced, respecting displayed precision, and returns a per-value registry.
get_active_document
Read the focused editor buffer, returning content, file path, and whether the buffer has unsaved changes.
get_r_info
Get information about the R environment.
modify_code_section
Regex find-and-replace in an editor document, handling multi-line patterns, saving to disk by default, and accepting a path to target a specific file.
insert_text
Insert text at the cursor or a specific line/column, saving to disk by default.
suggest_edit
Propose an edit for the user to approve instead of applying it.
get_viewer_content
Read HTML content from the viewer pane (plotly, DT, leaflet widgets) with pagination support.
clean_error_log
Clean a session log by removing error blocks and their duplicate predecessors, leaving only working code and the fixes that followed.
search_project_code
Search a regex pattern across project source files (.R, .Rmd, .qmd), returning file, line number, and snippet.
probe_scripts
Source R scripts in a clean background session and report what objects are created, without affecting the main session.
verify_references
Verify academic references: DOIs checked against CrossRef (with retraction and correction flags), arXiv IDs resolved with a published-version check, and DOI-less entries bibliographically matched.
search_citations
Search the OpenAlex scholarly index for the correct reference for a claim instead of citing from memory.
get_bibtex
Fetch the canonical BibTeX entry for a DOI via doi.org content negotiation.
generate_notebook
Turn a session log into a narrated Quarto lab notebook; rendering re-runs the code so outputs and plots regenerate.
generate_codebook
Scan a project and emit the codebook OSF and journals require: versioned package list, script inventory, per-variable summaries, and outputs produced.
screening_report
Summarize systematic-review screening passes: agreement and Cohen's kappa between two model screeners, PRISMA flow counts, and the conflict set a human must adjudicate.
send_message
Send typed multi-agent messages on an append-only shared log.
check_messages
Read message events from the shared coordination log.
wait_for_message
Block until a matching event arrives (rendezvous without polling); works even while the R session is busy.
coordination_roster
Show the live coordination roster of connected agents with last-seen ages.
checkpoint_session
Snapshot the R global environment to disk before risky operations; checkpoints survive R restarts.
restore_session
Roll the environment back to a checkpoint; the current state is saved first, so a restore is itself undoable.
list_checkpoints
List saved checkpoints for the current session.
create_task_list
Generate a task list based on your prompt to prevent omissions in long-context tasks.
update_task_status
Track progress for each task in the generated list.
load_annotation_data
Load a CSV dataset with a _schema column definition to start an AI annotation session.
annotate
Label a single dataset row; the original file is never modified.
set_agent_name
Set an agent's working name so execution history, message attribution, presence, and its read cursor all carry that name.

Setup

  1. Install the R package in the RStudio console: if (!require("devtools")) install.packages("devtools") then devtools::install_github("IMNMV/ClaudeR").
  2. Configure your AI tool. For desktop apps (Claude Desktop / Cursor) run library(ClaudeR); install_clauder(), or install_clauder(for_cursor = TRUE) for Cursor. For CLI tools run install_cli(tools = "claude"), which also supports "codex", "qwen", "agy", and the legacy "gemini". Both default to running the PyPI package clauder-mcp with uvx; if uvx is unavailable, fall back with use_uvx = FALSE and python_path.
  3. Apply the printed configuration manually: for Claude / Codex / Qwen copy the printed command into your terminal; for Antigravity (agy) put the generated JSON in ~/.gemini/config/mcp_config.json (global) or .agents/mcp_config.json (per-workspace); for legacy Gemini add it to ~/.gemini/settings.json.
  4. Quit and restart your desktop app or terminal sessions so the new settings load.
  5. In RStudio run library(ClaudeR); claudeAddin(), click Start Server in the Viewer pane, and keep the window open. On RStudio Server, port 8787 is the IDE's own port, so choose a different one.

Fit and risk

Best for

  • Statisticians and data scientists working in RStudio or Positron who want an agent operating on their live session.
  • Researchers who need to audit the numeric and citation consistency of their own or others' manuscripts.
  • Developers and researchers who want to orchestrate multi-agent workflows on their existing model subscription.
  • Users who prefer local sessions, auditable logs, and zero-config uvx startup.

Not for

  • Anyone exposing the R session on an untrusted network or a shared machine: binding to 127.0.0.1 is not a security boundary.
  • People who need sandboxed code execution: the guardrail is a regex blocklist, not a sandbox, and is trivially bypassable.
  • Users unwilling to accept prompt-injection risk when auditing third-party documents.
  • People who only want editor and audit tooling from a Python session: those tools drive the IDE through rstudioapi and have no Python equivalent.

Required permissions

  • Execute arbitrary R code in the live R session (via execute_r and related tools).
  • Read any file your account can read (read_file, get_viewer_content, and others).
  • Write to and save files open in your editor (modify_code_section, insert_text).
  • Install R packages, overwrite objects in your environment, make network calls, and consume compute.
  • Listen on a local port (default 8787) and write session discovery files under ~/.claude_r_sessions/; when a token is enabled that file is written with mode 0600.

Risks and side effects

  • Binding to 127.0.0.1 is not a security boundary: other local processes, and even any webpage you visit, can POST code to the port, which is arbitrary code execution in your session. ClaudeR always rejects requests carrying an Origin header with a 403, and offers an opt-in session token (X-Clauder-Token).
  • The session token is off by default because enforcing it rejects any bridge older than clauder-mcp 0.6.0, so the local-process vector stays open until you enable it.
  • validate_code_security() is a regex blocklist (system(), system2(), shell(), rstudioapi::terminal, recursive/wildcard deletes) and is trivially bypassable via get("system")(...), do.call, or eval(parse(...)). It is a seatbelt, not a sandbox.
  • Prompt injection: combining tools that pull untrusted third-party content (read_file, get_viewer_content, verify_references, load_annotation_data) with arbitrary R execution, file writes, and network access means a manuscript, CSV, or HTML widget authored by someone else is untrusted input on a path to code execution. Auditing someone else's manuscript is the riskiest shape.
  • The agent can read any file you can read, install packages, and make network calls; work in a project directory and keep credentials out of the working directory.
  • Async jobs run in a separate R process via callr and do not have access to the main session's environment; the agent must write self-contained code using saveRDS, and misuse leads to inconsistent results.

Troubleshooting

  1. Connection issues: ensure your AI tool is configured correctly, the Python path or CLI command is right, and the server is running in the add-in; free the port or restart RStudio if it is in use.
  2. "could not find function install_clauder": restart the R session (Session -> Restart R) and try again.
  3. MCP server failed to start: with uvx, ensure uv is installed (curl -LsSf https://astral.sh/uv/install.sh | sh); with the legacy method this usually means the wrong Python environment was detected, so re-run the installer with the correct python_path or switch to use_uvx = TRUE.
  4. Bridge broke after the mcp 2.0.0 release: clauder-mcp >= 0.6.1 pins mcp<2; run uvx --refresh clauder-mcp.
  5. After upgrading R versions re-run install_cli() or install_clauder() to update the MCP server path; the CLI installer removes stale registrations before adding fresh ones.
  6. The AI can't see results: make sure the add-in window is open and the server is running.
  7. Plots not displaying: instruct the AI to wrap plot objects in print(), or to use execute_r_with_plot.
  8. Long-running code timing out: have the AI use execute_r_async for code taking more than 25 seconds and poll with get_async_result.
  9. "address already in use" after restarting the server: this is a UI bug and the server is still active; switch the port in the Viewer pane or restart RStudio.
  10. Settings don't apply after closing and reopening the add-in UI: the server keeps running in the background; re-running claudeAddin() reconnects with the same port, session name, and execution count, and only Stop Server actually stops it.

Use cases

Let an agent run code, see plots, and read objects in the R session where your cleaned data and fitted models already live.
Run multiple agents (e.g. Claude Code plus Codex) on one RStudio session with the coordination protocol and consensus gate.
Audit a manuscript for numeric, reference, and reasoning defects with Reviewer Zero, and write findings back as Word comments.
Screen systematic-review titles and abstracts with two independent model screeners and get agreement, kappa, PRISMA counts, and a conflict set.
Turn a session log into a re-runnable Quarto notebook or a clean script, and generate the codebook OSF and journals require.
Label a CSV dataset row by row with an AI agent without the agent writing any code.
Convene a mock grant study section with grant_panel_prompt() against NIH or NSF criteria and get a ranked revision list.
Parse a decision letter into point-by-point reviewer responses with reviewer_response_prompt(), rerunning analyses so answers carry real numbers.

Supported clients

Claude DesktopFull support
Claude CodeFull support
CodexFull support
Qwen CodeFull support
Google Antigravity (agy)Full support
Gemini CLIFull support
CursorFull support