Gives the settings that connect Claude Desktop or Claude Code to MVPapp's
MCP server, with the full path of this computer's Rscript, and can add
them to Claude Desktop's configuration file for you.
Arguments
- output_dir
Folder for the files the tools write (plots, data, bundles). Created if needed when the server writes its first file.
- install
If
TRUE, add (or update) themvpappserver in Claude Desktop's configuration file, keeping its other settings (the previous file is kept with.bakadded to its name). Restart Claude Desktop afterwards. Needs the 'jsonlite' package.- config_file
Claude Desktop's configuration file (default: its usual place on Windows and macOS).
Value
Invisibly, a list with rscript, desktop_json (the
mcpServers entry for Claude Desktop), claude_code (the command for
Claude Code) and config_file. The settings are also printed.
Details
For Claude Desktop chats, install = TRUE adds the server to
Claude Desktop's settings; then quit Claude Desktop completely (from the
system tray on Windows) and open it again. If Claude Desktop reads another
settings file (Settings > Developer > Edit Config shows it), give that
file as config_file. For Cowork and Claude Code, the MVPapp plugin adds
the server and the assistant guide together: in Claude, Customize >
Plugins > Add > Add marketplace, stevechoy/MVPapp (in newer versions of
Claude, the Customize page is called Plugins: Plugins > Add > Add
marketplace); in Claude Code,
claude plugin marketplace add stevechoy/MVPapp then
claude plugin install mvpapp@mvpapp. Use this function when you set up
the server by hand, or to find the Rscript path the plugin asks for.
Examples
cfg <- mvp_mcp_config(output_dir = "~/MVP-outputs")
#> Rscript on this computer:
#> /opt/R/4.6.2/lib/R/bin/Rscript
#>
#> Claude Desktop (claude_desktop_config.json):
#> {
#> "mcpServers": {
#> "mvpapp": {
#> "command": "/opt/R/4.6.2/lib/R/bin/Rscript",
#> "args": ["-e", "MVPapp::mvp_mcp_server(output_dir = '~/MVP-outputs')"]
#> }
#> }
#> }
#>
#> Claude Code (in a terminal):
#> claude mcp add mvpapp -- "/opt/R/4.6.2/lib/R/bin/Rscript" -e "MVPapp::mvp_mcp_server(output_dir = '~/MVP-outputs')"