ClaudeR

Runs code from an AI assistant inside your live R or Python session in RStudio or Positron

By I M NV (individual) Python Local · stdio Data and analyticsDeveloper tools

57 popularity score ★ 365 ↓ 5.8k/mo

Connect your client

Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add clauder -- uvx clauder-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "clauder": {
      "command": "uvx",
      "args": [
        "clauder-mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "clauder": {
      "command": "uvx",
      "args": [
        "clauder-mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "clauder": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "clauder-mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.clauder]
command = "uvx"
args = ["clauder-mcp"]
Gemini CLITerminal
gemini mcp add --scope user clauder uvx -- clauder-mcp

Settings 1

CLAUDER_AGENT_ID Optional: Name this bridge logs its code under when several agents share a session; same as --agent-id. For multi-agent logging.

What it does

ClaudeR links an MCP client to an R session that is already open in RStudio or Positron. It has two parts. The ClaudeR R package adds an add-in that starts a small HTTP listener inside the session, and the clauder-mcp Python package is the stdio bridge your client launches. The assistant can then run R where your data frames and fitted models already sit, get plots back as images, read and edit the open editor buffer, and run long jobs in a background R process. A companion Python package (clauder) does the same for a live Python session, without the editor, checkpoint and audit tools.

Around that core it carries tools for academic work: checking a manuscript's numbers against the outputs your code produced, verifying references against CrossRef and arXiv, finding citations in OpenAlex, fetching BibTeX, building codebooks and Quarto lab notebooks, and summarising systematic-review screening. Several agents can share one session and message each other through a shared log, and the environment can be checkpointed and rolled back.

The bridge registers 41 tools in server.py. Since 0.16.2, get_async_result holds the call open until the background job ends, checking every 2 to 10 seconds, and gives up after wait_s seconds (300 by default, never more than 1800). The add-in can hide groups of tools per session. With a Python session connected, the bridge refuses 27 tools that post R code, read_file among them.

run_annotation_job starts a fresh claude, codex, agy or qwen process for each row of a dataset, or calls a local Ollama server. Gemini CLI was dropped after Google shut it down in June 2026, and asking for "gemini" now returns an error pointing to agy. Claude calls start in an empty folder with no tools loaded. By default each call sees one row. batch_size raises that to 200, which is cheaper but lets rows in one call sway each other. With no_api_key set, the Anthropic and OpenAI key variables are stripped so the CLI uses your subscription login.

What it needs

RuntimePython 3.10+
Runs onmacOS, Windows, Linux
Also
  • R with the ClaudeR package from GitHub
  • RStudio or Positron with the ClaudeR add-in server started
  • uv, for the uvx command

R with the ClaudeR package installed from GitHub (devtools::install_github("IMNMV/ClaudeR")), RStudio or Positron, and the add-in started with claudeAddin() and Start Server before the client connects. uv for the uvx command, or Python 3.10+ for the pip install. run_annotation_job needs the chosen CLI (claude, codex, agy or qwen) on PATH, or a running Ollama server.

Limits

  • Not covered Does nothing until the R add-in (or clauder.start() in Python) is running
  • Not covered Against a Python session, 27 R-only tools such as read_file, get_async_result and the audit tools are refused
  • Limit Each R session takes one Claude Desktop or Cursor app at a time
  • Limit Async jobs run in a separate callr process and see only the objects passed in inputs
  • Limit get_async_result waits 300 seconds by default and at most 1800, so a client with a shorter tool timeout needs a lower wait_s
  • Limit The default port 8787 clashes with RStudio Server's own port
  • Limit The code blocklist is a regex the docs call trivially bypassable
  • Limit Changing the R version means re-running install_clauder() or install_cli()

Does nothing until the R add-in (or clauder.start() in Python) is running. A Python session gets code execution, plots, logging and coordination only; editor, suggest_edit, checkpoint and audit tools are R only. Each R session takes one Claude Desktop or Cursor app at a time. Async jobs run in a separate callr process with no access to the main session's objects. The default port is 8787, which clashes with RStudio Server's own port. The code blocklist is a regex the docs call trivially bypassable. Changing the R version means re-running install_clauder() or install_cli().

Who it suits

Suits researchers and analysts who work in RStudio or Positron and want an assistant to act on the objects already loaded in their session, or to audit a manuscript against the code behind it. It runs entirely on your machine and needs no account. It is a poor fit if you want an assistant that cannot run arbitrary code with your own permissions, or if you do not use R or a live Python session: the bridge is useless without the add-in running.

Tools 41

19 only read, 20 change things, 2 can delete or overwrite. A ? marks an optional parameter.

execute_r changes
Run R code in the connected session and return its outputcode: string
execute_r_with_plot changes
Run R code and return the plot it draws as an imagecode: string
get_r_info
Summarise the R environment: package count, first 20 variables, R versionwhat: string
get_active_document
Read the focused editor buffer, its path and whether it has unsaved changespath?: string
modify_code_section deletes
Regex find-and-replace in an editor document, saved to disk by defaultsearch_pattern: stringreplacement: stringline_start?: numberline_end?: numberpath?: stringsave?: boolean
insert_text changes
Insert text at the cursor or a given line and columntext: stringline?: numbercolumn?: numberpath?: stringsave?: boolean
suggest_edit changes
Stage an edit for the user to accept or rejectsearch_pattern: stringreplacement: stringpath?: string
create_task_list changes
Build a task list from the request to track long jobstasks: array
update_task_status changes
Mark progress on an item of the task listtask_id: stringstatus: stringnotes?: string
clean_error_log changes
Strip failed blocks from a session log, keeping working codelog_path: stringoutput_path?: string
execute_r_async changes
Start long-running R code in a background process and return a job ID, copying named objects in and outcode: stringinputs?: arrayoutputs?: array
get_async_result
Wait for a background job and return its result when it finishes, or its status after wait_s secondsjob_id: stringwait_s?: number
cancel_async_job changes
Stop a running background jobjob_id: string
list_sessions
List the R and Python sessions available to connect to
connect_session changes
Switch to a named sessionsession_name: string
read_file
Read a file from disk, extracting text from .docx and .pdf, with line rangesfile_path: stringstart_line?: numberend_line?: number
search_project_code
Regex search across the project's .R, .Rmd and .qmd filespattern: stringfile_extensions?: stringroot_dir?: stringmax_results?: numberignore_case?: boolean
probe_scripts
Source scripts in a clean background session and report the objects they createscript_paths: arraytimeout?: numbercapture_output?: boolean
verify_references
Check references against CrossRef and arXiv, flagging retractionsfile?: stringtext?: stringstart_line?: integerend_line?: integer
get_viewer_content
Read HTML from the viewer pane, page by pagemax_length?: numberoffset?: number
get_session_history
Show code run in the session, filtered by agentagent_filter?: stringlast_n?: numberinclude_past?: boolean
run_annotation_job changes
Annotate each row of a dataset with a separate AI CLI process or local Ollamacsv_path: stringtool?: stringmodel?: stringtimeout?: numberreasoning_effort?: stringollama_base_url?: stringbatch_size?: integerno_api_key?: boolean
get_annotation_job_status
Report progress of an annotation jobjob_id: string
cancel_annotation_job changes
Stop an annotation jobjob_id: string
load_annotation_data changes
Load a dataset for row-by-row annotation in the conversationcsv_path: string
annotate changes
Record the annotation for the current rowannotations: object
checkpoint_session changes
Save the R global environment to disklabel?: string
restore_session deletes
Roll the environment back to a saved checkpointcheckpoint?: string
list_checkpoints
List checkpoints for the current session
screening_report changes
Compute agreement, Cohen's kappa and PRISMA counts for review screeningpass_a: stringpass_b?: stringinclude_field?: stringreason_field?: string
set_agent_name changes
Set the name this agent is logged undername: stringforce?: boolean
send_message changes
Post a typed message to the shared multi-agent logbody: anyto?: stringtype?: stringreply_to?: numberas_agent?: string
check_messages
Read new messages from other agentsack?: booleanas_agent?: string
wait_for_message
Block until a matching message arrivestimeout_s?: numberfrom_agent?: stringtype?: stringas_agent?: string
coordination_roster
Show which agents are active in the sessionstale_after_s?: numberhide_after_s?: number
check_cross_references
Flag table and figure mentions with no target, and targets never mentioneddocument: string
reconcile_values
Match each number in a manuscript against outputs the code produceddocument: stringsources: arrayignore_years?: boolean
generate_codebook changes
Write a project codebook: packages, scripts, variable summaries, outputsproject_dir?: stringdata_files?: arrayoutput_path?: string
generate_notebook changes
Turn a session log into a Quarto lab notebooklog_path?: stringoutput_path?: stringtitle?: string
search_citations
Look up a reference for a claim in OpenAlexquery: stringmax_results?: number
get_bibtex
Fetch the BibTeX entry for a DOI from doi.orgdoi: string

Similar servers