The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Using MVPapp with AI

Last updated: 2026-12-03

Motivation

You can ask an AI assistant such as Claude to run MVP for you, in plain language:

Use MVP to simulate 100 mg once daily for a week in 50 adults with a one-compartment oral model, and show me the concentrations over time.

The assistant picks the model, sets up the dosing and the virtual patients, runs the simulation with MVPapp, and shows you the plot and the key numbers, together with the assumptions it made. You do not need to know R or install anything on your computer.

Everything the app does is available this way: simulations with a built-in model or your own (from a paper, a NONMEM run or model code), virtual populations, comparing doses, the percentage of patients above a target, parameter sensitivity, and exploring your own data. The results come from MVPapp itself, so they are the same as in the app.

Setup

Pick the line that best describes your situation (you only do this once).

What you have What to set up Time
An AI chat app that supports skills and can run code (e.g. Claude), no R The MVPapp skill 2 minutes
R and MVPapp on your computer, and Claude desktop or Claude Code The MVPapp plugin 5 minutes
R and MVPapp on your computer, and another assistant that supports MCP (e.g. Codex, Gemini CLI, Cursor) MVPapp’s MCP server (see “Technical details” at the end) 10 minutes

No R: an AI chat app with skills

MVPapp’s skill is a folder in the open Agent Skills format, so it is not tied to one assistant. The assistant installs MVPapp in its own workspace in the cloud and runs it there. You need an app that supports skills and can run code with internet access (MVPapp is installed from GitHub and the Ubuntu package archives). It has been tested with Claude.

  1. In the app’s settings, turn on code execution (in Claude: Settings > Capabilities, “Create and edit files”).
  2. Download mvpapp-skill.zip.
  3. Add it as a skill (in Claude: Customize > Skills, click +, then Create skill > Upload a skill, and choose the file). Upload the ZIP as it is, not just the SKILL.md inside it: it also holds the installer and the reference files the skill needs.

That’s it. The first request in each new conversation takes about 2 minutes while the assistant sets up MVPapp; after that, answers come in seconds. Everything runs in the assistant’s workspace except opening results in the MVPapp app, which needs R on your own computer.

If your organisation manages the app, an administrator may need to turn on code execution, skills and network access, or can add the skill for everyone. In Claude (Team or Enterprise plans), an owner controls these settings:

No install usage (prompt-only): in an AI chat app that can run code with internet access, you can also start a conversation by pasting this paragraph before your request:

Use MVP (the MVPapp R package) for this. First set it up: run "git clone --depth 1 https://github.com/stevechoy/MVPapp",
then "bash MVPapp/claude-plugin/skills/mvpapp/scripts/install_mvpapp.sh", and read
MVPapp/claude-plugin/skills/mvpapp/SKILL.md and the reference files it points to, and follow them.

Without the skill or this paragraph, the assistant does not know how to install MVPapp in its workspace and will tell you it cannot run it.

R and MVPapp on your computer

MVPapp then runs on your own computer: your files stay there, and the assistant can open results in the MVPapp app for you. The assistant connects to MVPapp’s tools through the Model Context Protocol (MCP). For Claude, the MVPapp plugin sets this up:

For other assistants that support MCP (e.g. OpenAI Codex, Gemini CLI, Cursor), see “Technical details” at the end. The MVPapp tools need the optional packages mcptools and ellmer: install.packages(c("mcptools", "ellmer")).

Example requests

Start your request with “Use MVP” (or “Use MVPapp”: the assistant knows both names) so it knows which tool to use, and say what you know: the dose and schedule, the units, and who the patients are. Anything you leave out is filled in with the model’s default values, which the assistant lists for you.

Simulate a dosing regimen

Use MVP to simulate 100 mg once daily for a week in 50 adults with a one-compartment oral model, and show me the concentrations over time.

Use MVP to simulate a two-compartment model with CL = 3 L/h and Vc = 10 L: a 500 mg 1-hour infusion, then 250 mg every 12 hours for 3 days, in a typical 70 kg adult.

Use MVP to simulate a loading dose of 100 mg, then 50 mg once weekly for 12 weeks, with a two-compartment model. Show the concentrations in weeks on a log scale.

You get a plot of the concentrations (the median and the 95% range for a population), the peak, trough and AUC, and the list of doses and parameter values used.

Choose the patients

Use MVP to simulate 10 mg/kg once daily for 5 days in 100 children aged 6 to 12, using the CDC growth data. How do concentrations differ between the lightest and heaviest children?

Use MVP to simulate 200 adults aged 40 to 75 from NHANES, with creatinine clearance normally distributed (mean 60, SD 20 mL/min) and 30% Japanese patients. Show me a summary of the simulated patients.

Virtual patients are drawn from the NHANES (US adults and children), CDC or WHO (children) growth data, with extra characteristics you describe.

Compare doses and check targets

With MVP, compare 200 mg once daily and 100 mg twice daily over 2 weeks in 200 adults. What percentage of patients stay above 0.5 mg/L at the trough?

Use MVP to find which dose keeps 90% of patients above 2 mg/L at the trough at steady state: 50, 100 or 200 mg once daily.

Use MVP to compare Model 1 (CL = 3 L/h) and Model 2 (CL = 6 L/h) for 100 mg once daily, as box plots of the trough concentration on the last day.

You get the profiles side by side, box plots or a table of exposures, and the percentage of patients above (or below) the target.

Start from a published model

Give the link or DOI of the paper. The assistant downloads the paper and its supplementary files (the model code is often there), loads the final model, and uses the study’s dosing, patients and sampling times unless you say otherwise.

Use MVP to simulate the model from this paper with the dosing they studied: (paste its DOI or link)

Use MVP to simulate the final model in PMC7654321 in 200 children aged 2 to 11, at the doses the study used. Show the concentrations at the study’s sampling times.

Use MVP to simulate the model in this paper’s supplementary NONMEM code for 12 weeks of the recommended dose, and compare the steady-state exposure with what the paper reports.

You get the model it used (the file or table), each default it took from the study (with the section or table), the simulation, and a comparison with the exposures the paper reports. Open-access papers work best. For a paywalled paper, it works only if your computer has access to it; otherwise the assistant asks you to attach the PDF and the supplementary files. When MVPapp runs in the assistant’s workspace (no R), allow www.ebi.ac.uk (Europe PMC) in the app’s network settings first.

Start from a model you already have

(attach the paper as a PDF) Use MVP to simulate the final model in this paper: 300 mg every 3 weeks for 6 cycles in 100 patients aged 40 to 75. List every parameter value you used and the table it came from.

(attach the NONMEM control stream, e.g. run7.mod, and its run7.ext) Use MVP to simulate this NONMEM model with 10 mg/kg every 2 weeks in 100 adults, and plot the concentrations.

Use MVP to simulate this model: one compartment with first-order absorption, ka = 1.2 /h, CL = 4 L/h, V = 35 L, 30% variability on CL and V. Dose 50 mg twice daily for 10 days.

The assistant translates the model into MVPapp’s format using the same instructions as the app’s AI translation, checks that it works, and tells you which values it took from where. Attach the NONMEM .ext file too, so it uses the final estimates rather than the initial ones.

Get the model as code

You can also ask only for the translation, e.g. to check the model or to use it in the app later.

(attach the paper as a PDF) Use MVP to translate the final model in this paper into mrgsolve code and give me the .cpp file. List each parameter value and the table it came from.

(attach run7.mod and run7.ext) Use MVP to translate this NONMEM model to mrgsolve and give me the .cpp file.

(attach the paper as a PDF) Use MVP to translate the final model in this paper into rxode2 code.

(attach the paper as a PDF) Use MVP to write this model as a NONMEM control stream.

For mrgsolve, you get a .cpp file that has compiled in MVPapp, the parameter values with where each came from, and what was checked. Open it in the app with “Upload External .cpp File”, or in mrgsolve. For NONMEM or rxode2, you get a .ctl or .R file written with the app’s NONMEM or rxode2 instructions: MVPapp checks that a control stream has the blocks it needs, and rxode2 code is checked by rxode2 where it is installed, but MVPapp cannot run either, so check them in NONMEM or rxode2. This needs no API key: the assistant translates the model itself, with the same instructions as the app’s AI translation.

Work with your own data

(attach a de-identified CSV) Use MVP to summarise this dataset, plot concentration over time coloured by dose, and run a non-compartmental analysis (NCA) on the first dose.

Use MVP to overlay my observed data on the simulation, only the plasma concentrations (CMT 2), with the median of the data.

Use MVP to show the correlations between weight, age and creatinine clearance in my dataset, and histograms of each.

If MVPapp runs on your computer, give the file’s location instead of attaching it, e.g. C:/data/study1.csv.

Understand what drives exposure

Use MVP to show which parameters affect the AUC the most for this model, as a tornado plot.

Use MVP to show what happens to the trough concentration if clearance is halved or doubled.

Keep and share the results

Give me a file that a pharmacometrician can use to reproduce this simulation.

Give me one file that reproduces this comparison.

Save the simulated concentrations as a CSV file.

Open both regimens in the MVP app so I can keep exploring. (R on your computer only.)

Follow-up requests

Once you have a result, keep the conversation going:

Now double the dose.

Use 500 patients instead.

Zoom in on the last day, on a log scale.

Only show me the trough concentrations, as a table.

Checking the answers

Treat the assistant like a capable colleague whose work you review:

Privacy and limits

Technical details

This section is for people who set up the connection by hand or support other users.

How it works. MVPapp’s analyses are R functions (see vignette("scripting")). An assistant reaches them in one of two ways: it runs R code itself, guided by MVPapp’s skill file (in a chat app, in the app’s own workspace), or it calls MVPapp’s tools through the Model Context Protocol (MCP), served by R on your computer with mvp_mcp_server(). The tools (mvp_load_model, mvp_simulate, mvp_compare, mvp_target, mvp_plot, mvp_open_in_app, …) wrap the same functions; plots are returned to the assistant as images, and files are written to output_dir. No API key is needed for translating models: the assistant translates them itself with the app’s prompts (or your own, with mvp_mcp_server(prompts_path = ...)). The mvp_guide tool gives the assistant the skill’s advice.

Settings for your computer. mvp_mcp_config() prints them, with the full path to Rscript:

MVPapp::mvp_mcp_config(output_dir = "~/MVP-outputs")                 # prints the settings
MVPapp::mvp_mcp_config(output_dir = "~/MVP-outputs", install = TRUE) # adds them to Claude Desktop

For Claude Desktop the settings look like this (claude_desktop_config.json):

{
  "mcpServers": {
    "mvpapp": {
      "command": "Rscript",
      "args": ["-e", "MVPapp::mvp_mcp_server(output_dir = '~/MVP-outputs')"]
    }
  }
}

and for Claude Code:

claude mcp add mvpapp -- Rscript -e "MVPapp::mvp_mcp_server(output_dir = '~/MVP-outputs')"

Other assistants. Any assistant that can start a local MCP server takes the same command and arguments, e.g. OpenAI Codex (codex mcp add mvpapp -- Rscript -e "MVPapp::mvp_mcp_server(output_dir = '~/MVP-outputs')") or Gemini CLI (gemini mcp add mvpapp Rscript -e "..."). On Windows, use the full path to Rscript.exe. Ask the assistant to read mvp_guide first.

The skill files. Assistants that run R code themselves can use the skill shipped with the package (the plugin and mvpapp-skill.zip include it):

# SKILL.md and its references/ folder; e.g. for Claude Code, as a personal skill:
src  <- system.file("ai", package = "MVPapp")
dest <- "~/.claude/skills/mvpapp"
for (f in list.files(src, recursive = TRUE)) {
  dir.create(dirname(file.path(dest, f)), recursive = TRUE, showWarnings = FALSE)
  file.copy(file.path(src, f), file.path(dest, f), overwrite = TRUE)
}

In a workspace without R, the skill’s installer (claude-plugin/skills/mvpapp/scripts/install_mvpapp.sh on GitHub) sets up R and MVPapp, also where CRAN cannot be reached.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.