agentsclimarketplace

R mcptools

Skill arthurgailes/r-package-skills/skills/r-mcptools

Use when code loads or uses mcptools (library(mcptools), mcptools::), connecting AI agents to R sessions via MCP, or exposing R as an MCP server for Claude Code or VS CodeFrom its SKILL.md

Install
npx -y skills add arthurgailes/r-package-skills --skill r-mcptools

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 23 stars23 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.2 KB, as published. Nobody here has run it

mcptools: R as Model Context Protocol Server

Overview

mcptools lets AI agents INTO your R session. Agents (Claude Code, VS Code, etc.) can run R code, query data, call functions in your live R environment.

btw vs mcptools: btw gives tools TO ellmer (R → LLM). mcptools lets agents INTO R (LLM → R).

Install: install.packages("mcptools")

References

Read references/API.md before writing code.

  • references/API.md - Complete function reference
  • references/package-docs.md - Setup and configuration
  • references/server.md - MCP server setup and agent configuration

When to Use

  • Let Claude Code/VS Code run R code
  • Give agents access to live R session
  • Expose R functions as MCP tools
  • Query R data stores from agents

When NOT to Use

  • Want to call LLMs FROM R (use r-ellmer)
  • Just need R object descriptions (use r-btw)
  • Building chatbot in R (use r-ellmer + r-btw)

Quick Reference

library(mcptools)

# In R console (each startup, NOT in scripts)
mcp_session()

# Now Claude Code can:
# - Run R code
# - Query data frames
# - Call your R functions
# - Access documentation

CRITICAL: Call mcp_session() in console at each R startup, NOT in scripts.

Common Mistakes

IssueSolution
btw vs mcptools confusionbtw = tools TO chat; mcptools = agent INTO R
mcp_session() in scriptsCall in console, each startup
Expecting clipboard copymcptools is for agent access, not clipboard
Session not detectedRestart R, call mcp_session() in console

Core Functions

Session Management:

  • mcp_session(): Initialize MCP session (console only, per startup)
  • mcp_mcp_server(): Launch MCP server

Advanced

See references/ for:

  • API.md: Complete function reference
  • server.md: R as MCP server details
  • Package docs: Full package documentation

Integration

With Claude Code: Call mcp_session() in R console With ragnar: Agents can query ragnar stores Cross-package patterns: See r-ai meta-skill

Keep looking

Skills are one crate of 611,676. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.