claude-r

Execute R code in RStudio via MCP tools and return results.

2|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/naoto-iwase/Claude-R --skill claude-r
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-r
Source: https://github.com/naoto-iwase/Claude-R/tree/main/.claude/skills/claude-r
Command: npx skills add https://github.com/naoto-iwase/Claude-R --skill claude-r

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

AI-driven coding typically requires translating natural language prompts into executable R code within an IDE. This skill bridges Claude Code or OpenCode to RStudio via MCP, enabling seamless code execution inside the familiar environment.

Core Features & Use Cases

  • RStudio integration: Run AI-generated R code directly in RStudio through MCP.
  • MCP tools access: Retrieve environment info, active document, and modify code sections, or execute code with or without plots.
  • Use Case: Data analysts and researchers can prompt an AI to perform statistical analyses or create visualizations and immediately see results in RStudio.

Quick Start

Open RStudio, install ClaudeR, and start the MCP server per the guide.

Frequently Asked Questions about claude-r

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run AI-generated R code directly in RStudio?

Yes, Claude Code connects to RStudio through a locally hosted HTTP server at http://127.0.0.1:8787, leveraging MCP tools to execute R code and return results including plots and environment details.

Can I retrieve R environment info and active documents using MCP tools?

Yes, the Skill provides MCP tools like get_r_info and get_active_document to retrieve environment details and active documents, alongside execute_r and modify_code_section for code execution.

What do I need to set up before executing R code via AI in RStudio?

Before executing R code via AI, ensure RStudio is open, install the httpx dependency, and start the local RStudio HTTP server at http://127.0.0.1:8787 to enable MCP communication.

Does RStudio integration with Claude Code support generating and viewing plots?

Yes, RStudio integration with Claude Code supports generating and viewing plots using the execute_r_with_plot MCP tool, allowing AI agents to execute R code and return visualizations directly.

How do I modify code sections in RStudio through an AI agent?

To modify code sections in RStudio through an AI agent, use the modify_code_section MCP tool, which allows Claude Code or OpenCode to update specific parts of your active document.