mcptools
An R package that lets R run as an MCP server, so tools such as Claude Desktop or Code and VS Code Copilot can run R code in a live session, and as an MCP client, registering third-party MCP servers with ellmer chats.
mcptools implements the Model Context Protocol for R in both directions. As a server, it lets MCP-enabled tools run R code in the sessions a user already has open, and pairs with the btw package's default tool set for browsing installed package documentation, inspecting objects in the global environment, and retrieving session and platform metadata; calling mcp_session() in a running R session registers it so models can access its variables. As a client, it registers third-party MCP servers with ellmer chats for use in Shiny chat and querychat apps.
It installs from CRAN or as a development version from GitHub, configures into Claude Desktop or Claude Code with a small JSON or CLI snippet, and can also be deployed as an HTTP MCP server on Posit Connect by adding a _server.yml file naming the mcptools engine.