# mcptools MCP server

> Lets AI clients run R code in active sessions and registers third-party MCP servers as tools in R chats.

- Repository: https://github.com/posit-dev/mcptools
- Page: https://hostedmcp.org/servers/posit-dev/mcptools
- Official: yes
- Transport: —
- Stars: 206

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GITHUB_PERSONAL_ACCESS_TOKEN` | no | no |  |

## FAQ

### Can Claude Desktop run R code from my session?

Yes. With mcptools configured as an MCP server, tools like Claude Desktop, Claude Code, and VS Code Copilot can run R code in the sessions you have running.

### How do I install mcptools in R?

Install the released version from CRAN with install.packages("mcptools"), or the development version from GitHub with pak::pak("posit-dev/mcptools").

### How do I connect mcptools to Claude Desktop?

Add an entry to your Claude Desktop configuration file that runs Rscript -e "mcptools::mcp_server()" as the server command.

### Can R use third-party MCP servers as tools?

Yes. mcptools registers third-party MCP servers using the Claude Desktop config format, and mcp_tools() returns ellmer tools you can pass to a chat's $set_tools() method.

### Can I deploy an mcptools MCP server to Posit Connect?

Yes. Add a _server.yml with engine: mcptools and a tools file, deploy the directory as an R API, and mark it as MCP content.
