Skip to contents

Convenience function to initialize and start MCP server in one call. Creates mcprServer instance and begins listening for client connections through blocking event loop with automatic tool discovery and registration.

Usage

mcpr_server(
  registry = NULL,
  resource_registry = NULL,
  log_file = NULL,
  execution_timeout_secs = 300L
)

Arguments

registry

A ToolRegistry instance to use for tool discovery

resource_registry

An MCPResourceRegistry instance for custom MCP resources. If NULL (default), the built-in plot viewer registry is used.

log_file

Optional log file path for the server logger. If NULL, the logger falls back to the package default.

execution_timeout_secs

Default seconds before a forwarded request is considered timed out (default: 300). Individual tools can override via their timeout argument.

Value

The server instance (invisibly)

Details

Start MCP Server

Examples

if (FALSE) { # \dontrun{
MCPR::mcpr_server()
} # }