Package 'rairai'

Title: Model Context Protocol Server for Package Intelligence
Description: Helps artificial intelligence (AI) agents develop 'R' packages more efficiently and make better-informed code changes. Provides focused, package-aware context through the Model Context Protocol (MCP) so agents can understand existing behavior and assess changes with less manual exploration. Inspects packages without loading or executing their code.
Authors: Juha Itkonen [aut, cre]
Maintainer: Juha Itkonen <[email protected]>
License: MIT + file LICENSE
Version: 0.2.7
Built: 2026-11-19 03:56:48 UTC
Source: https://github.com/cran/rairai

Help Index


Serve the MCP tools

Description

Runs a Model Context Protocol (MCP) server over standard input and output.

Usage

serve(path = ".")

Arguments

path

Existing package directory to inspect by default. Accepts absolute, relative, and tilde paths. Defaults to the current working directory.

Details

Tools that inspect a local package can use package_root to select a different directory for one request. Supply an absolute path; this does not change the server's default directory.

Value

Called for its side effect of serving MCP requests over standard input and output. Blocks the current R process until standard input closes.

File access and security

The path argument is not a sandbox. It selects a default directory but does not restrict access to other directories. An MCP client can request any directory readable by the R process. Responses may disclose file names, file contents, and absolute paths to that client. The inspected package's code is not loaded or executed.

To limit access, run the server with restricted filesystem permissions or in a container that exposes only the files you intend to share.

See Also

vignette("tools", package = "rairai") for the tool guide.