Skip to main content

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 Code

跳到安装

来源信息

仓库
arthurgailes/r-package-skills
最近来源活动
2026年4月24日 15:12
检测到的 SKILL.md 语言
英语
星标
21
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
4 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
r-mcptools
description
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 Code
# 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 ```r 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 | Issue | Solution | |-------|----------| | btw vs mcptools confusion | btw = tools TO chat; mcptools = agent INTO R | | mcp_session() in scripts | Call in console, each startup | | Expecting clipboard copy | mcptools is for agent access, not clipboard | | Session not detected | Restart 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
在 GitHub 查看