Skip to contents

Starts an MCP session in the current process, optionally binding to a specific session ID and working directory. This lower-level entry point is used for non-interactive/headless sessions that the MCPR server provisions on demand; ordinary users should prefer mcpr_session_start() in an interactive R session.

Usage

mcp_session(
  session_id = NULL,
  timeout_seconds = 900,
  working_dir = NULL,
  daemon = FALSE
)

Arguments

session_id

Optional integer session/socket identifier to bind.

timeout_seconds

Session timeout before auto-cleanup (default: 900 seconds).

working_dir

Optional path to set as the working directory before launch.

daemon

Logical. If TRUE, return immediately after starting session (for processx spawning). If FALSE, block in event loop until session stops (for interactive use). Default FALSE.

Value

The mcprSession instance (invisibly).

Details

Launch Headless MCP Session

Examples

if (FALSE) { # \dontrun{
mcp_session()
} # }