# phisanti/MCPR [Health: Active]

**Category:** 🧮 Data Science Tools  
**Repository:** https://github.com/phisanti/MCPR  
**GitHub Stars:** 26  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/phisanti-mcpr

## Description
Model Context Protocol for R: enables AI agents to participate in interactive live R sessions.

## Claude Desktop Quick Installation
Heuristic fallback — verify the package name and runner against the repository README before running it. Uses `npx` (confidence: low):

```json
"mcpServers": {
  "mcpr": {
    "command": "npx",
    "args": ["-y","phisanti-mcpr"]
  }
}
```

## Documentation

## What phisanti/MCPR MCP server does

phisanti/MCPR MCP server connects an MCP client to a live R runtime. The default server process is a private R session belonging to the agent, so objects created during one tool call remain available to later calls. This supports workflows such as loading packages, transforming data, fitting models, checking results, and refining plots without rerunning a complete script each time.

The package also supports collaboration with a human R session. A person can start an MCPR session from an interactive R console, after which the agent can discover and attach to it. The server is described as experimental in the project materials.

## How it works

The client launches `MCPR::mcpr_server()` as an R process. MCPR communicates using JSON-RPC 2.0 over `nanonext` sockets. Agent-facing functions are exposed as separate MCP tools rather than as one general protocol endpoint.

Ordinary operations use the currently active session and do not take a session identifier. Session routing is controlled independently through `manage_r_sessions`. The default route is the agent’s private session; joining another session changes where ordinary tools execute until the agent detaches.

Plot output can use `httpgd` for off-screen rendering when available. MCPR can fall back to standard R graphics devices, and its graphics handling includes token management for image responses.

## Setup and configuration

R must be installed before MCPR. The package is installed from GitHub with `remotes::install_github("phisanti/MCPR")`; the README also shows installing `remotes` first when it is not present.

After installation, `install_mcpr(agent = "claude")` can configure the server for supported agents. The documented agent names are Claude, Gemini, Copilot, and Codex. Manual Claude Desktop configuration uses an R command with the following arguments:

```json
{
  "command": "R",
  "args": ["--quiet", "--slave", "-e", "MCPR::mcpr_server()"]
}
```

Configuration locations vary by operating system and client. Claude Desktop, Gemini, Copilot, and Codex each have documented configuration paths in the project README.

## Tools and capabilities

phisanti/MCPR MCP server documents these core tools:

- `execute_r_code(code)` evaluates arbitrary R expressions and returns structured results, output, warnings, and errors.
- `show_plot(expr, target, width, height, format)` creates plots. User-targeted output displays through the active graphics device; agent-targeted output returns an encoded image with metadata and token information.
- `manage_r_sessions(action, session)` lists sessions, joins a human session, starts an MCPR-owned secondary session, detaches to the private session, or closes an MCPR-owned secondary session.
- `view(what, max_lines)` provides environment introspection and debugging. The documented options include session summaries and terminal output.

## Limitations and notes

MCPR is intended for stateful, iterative R work, not merely isolated command execution. Attaching to an existing R console requires the user to start that session with `mcpr_session_start()` before the agent can join it. The README does not document authentication, hosted deployment, or remote service credentials. Support for graphics depends on the available R graphics setup: `httpgd` is optional because standard graphics devices provide a fallback. The project labels its lifecycle as experimental, so client configuration details and behaviour may change.

_Full upstream README: https://allmcps.com/mcp/phisanti-mcpr/readme_

