ClaudeR MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/IMNMV/ClaudeR
cd ClaudeR

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add clauder -- node "<FULL_PATH_TO_CLAUDER>/dist/index.js"

Replace <FULL_PATH_TO_CLAUDER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Connect RStudio to MCP-based LLM agents for interactive coding and analysis.

ClaudeR - The Modern Researcher's Toolkit

<b>Connect RStudio to Claude Code, Codex, Gemini CLI, or any MCP-based LLM agent for interactive coding, multi-agent orchestration, and automated manuscript auditing.</b>

ClaudeR is an R package that forges a direct link between RStudio and MCP configured LLM agents like Claude Code or Codex. This allows interactive coding sessions where the agent can execute code in your active RStudio environment so it can see the executed code and any generated plots in real-time. If you need help editing a script, a quick analysis done, or an LLM to audit your statistical claims against any manuscript before submission: ClaudeR has got your back.

This package, additionally, allows multiple agents to work on one script, or it can make multiple RStudio windows siloed so multiple agents can operate independently on different datasets. It's also compatible with Cursor and any service that supports MCP servers.

Quick Start

# Install
if (!require("devtools")) install.packages("devtools")
devtools::install_github("IMNMV/ClaudeR")

# Set up your AI tool
library(ClaudeR)
install_clauder()          # For Claude Desktop / Cursor
install_cli(tools = "claude")  # For Claude Code CLI

# Start the server in RStudio
claudeAddin()

AI agents: See llms-install.md for automated setup instructions.

Recent Updates (click to expand)
  • verify_references tool. Extracts DOIs from a manuscript's bibliography, queries the CrossRef API for each, and returns metadata (title, authors, year, journal) for comparison against manuscript claims. Non-resolving DOIs, metadata mismatches, and references without DOIs are flagged. Works standalone ("check my references") or as Pass 4 of Reviewer Zero.
  • R Best Practices Protocol. Built-in statistical analysis protocol covering EDA, assumption checking, model building, diagnostics, multiple-corrections, and reporting. Load it with r_best_practices_prompt() or tell the agent to read it.
  • Reviewer Zero: Automated Academic Audits. Now a 4-pass protocol for AI-driven manuscript verification. The agent extracts every statistical and methodological claim, verifies its extraction, recomputes values against the author's R code, and checks references via CrossRef. Methodological claims (e.g., "zero variance made testing impossible") are tested directly rather than accepted at face value. Run reviewer_zero_prompt() to get the full protocol.
  • clean_error_log tool. Point the agent at a session log and it will parse every code block, find errors, check whether a fix follows each one, then strip the error blocks and any duplicate code that preceded them. The result is a clean log with only the working code. Accepts an optional output_path to write to a separate file instead of overwriting the original.
  • Persistent server across UI restarts. Closing the Shiny addin (console stop or Done button) no longer kills the MCP server. Re-running claudeAddin() reconnects to the still-running server with the correct port, session name, and execution count. Only clicking "Stop Server" in the UI actually stops the server.
  • Descriptive log filenames. Log files now include the session name, port, and timestamp: clauder_default_8787_20260301_143022.R. A new log file is created each time you click Start Server. All subsequent code execution appends to that file.
  • Viewer content capture & insert_text tool. Two new tools: get_viewer_content reads HTML from interactive widgets (plotly, DT, leaflet) with pagination so agents can inspect htmlwidget output without blowing up context. insert_text inserts text at the cursor position or a specific line/column in the active document. During agent execution, htmlwidgets open in the browser instead of stealing the Shiny addin's viewer pane.
  • Multi-session routing fix. Agents now prefer the session named "default" when multiple sessions are active, preventing misrouting caused b

Tools (4)

verify_referencesExtracts DOIs from a manuscript and queries CrossRef API to verify metadata and resolve references.
clean_error_logParses session logs to remove error blocks and duplicate code, leaving only working code.
get_viewer_contentReads HTML from interactive widgets like plotly or leaflet for agent inspection.
insert_textInserts text at the cursor position or a specific line/column in the active RStudio document.

Configuration

claude_desktop_config.json
{ "mcpServers": { "clauder": { "command": "Rscript", "args": ["-e", "ClaudeR::run_mcp()"] } } }

Try it

Analyze the statistical claims in my current manuscript and verify them against the R code in the active session.
Check my bibliography for any broken DOIs or metadata mismatches using the verify_references tool.
Clean up my current R session log by removing all error blocks and redundant code.
Read the interactive plot in the viewer and explain the trends shown in the data.
Insert a new ggplot2 code block at the end of my current script to visualize the model residuals.

Frequently Asked Questions

What are the key features of ClaudeR?

Direct integration between RStudio and MCP-based AI agents. Automated academic manuscript auditing via Reviewer Zero protocol. Real-time execution of R code and inspection of generated plots. Interactive log cleaning and error resolution. Multi-session support for independent agent workflows.

What can I use ClaudeR for?

Researchers auditing statistical claims in manuscripts before submission. Data scientists performing interactive EDA with AI assistance in RStudio. Developers cleaning up messy R session logs into reproducible scripts. Academic teams verifying bibliography metadata against CrossRef.

How do I install ClaudeR?

Install ClaudeR by running: devtools::install_github("IMNMV/ClaudeR")

What MCP clients work with ClaudeR?

ClaudeR works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep ClaudeR docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare