Starts an stdio MCP server exposing curated btw tools, the host's built-in
Certara knowledge / memory / meta tools, and the tools contributed by every
discovered provider package (e.g. Certara.RsNLME). Intended to be the
command an MCP client runs (see write_mcp_config()). Blocks serving
requests.
Arguments
- btw_groups
Which general-purpose
btwR tool groups to expose alongside the Certara tools (default"docs")."docs"lets the agent read R documentation; add"pkg"for package-development actions. For a live session bridged withbtw::btw_mcp_session()(needssession_tools = TRUE),"env"exposes read-only object inspection and"run"exposesbtw_tool_run_r. Other groups:"files","git","github","ide","cran","web","sessioninfo". Usecharacter(0)for none. Callcertara_session_status()to see which are active.- session_tools
Whether to expose tools that bridge to a separate, live R session registered with
btw::btw_mcp_session(). DefaultFALSEuses only the server's own R process.- server_name
MCP config key this process serves (default
"certara-r"). Advertised incertara_mcp_capabilities()and used to build CursorCallMcpToolrouting (user-<server_name>).- job_watch_wait_seconds
Per-call server-side watch budget (seconds) for provider long-job watch tools. Default
45keeps a single call under Cursor's ~60s timeout;write_mcp_config()bakes a larger value (600) into the Claude Code and Codex launch commands. Clamped to0..600.- dev_roots
Optional dev source-tree roots for KB and tool-provider discovery (unpublished provider trees).
- providers
Optional character vector of provider package names to include (default: every discovered provider).
- tool_profile
Which curated tool subset to expose, to keep the tool list focused:
"full"(default, every tool),"core"(authoring/validation + data inspection, no job launches),"authoring"(core + model comparison),"execution"(core + fit/job tools), or"diagnostics"(core + execution + comparison + interpretation).find_certara_tools(),certara_mcp_capabilities(), andcertara_session_status()are present in every profile.
Value
Does not return under normal operation (serves until the client
disconnects). Must be run non-interactively (the Rscript -e command an MCP
client launches); calling it from an interactive R session is an error.
Examples
if (FALSE) { # \dontrun{
# You do not call this in an interactive R session. Configure a client, which
# then launches the server as a non-interactive command:
write_mcp_config("cursor")
# The client runs the equivalent of:
# Rscript -e 'Certara.R::launch_certara_mcp(tool_profile = "core")'
} # }