| mcp_serve_store | R Documentation |
Launches an MCP server (via mcptools::mcp_server()) that exposes a
retrieval tool backed by a Ragnar store. This lets MCP-enabled clients (e.g.,
Codex CLI, Claude Code) call into your store to retrieve relevant
excerpts.
mcp_serve_store(
store,
store_description = "the knowledge store",
...,
name = NULL,
title = NULL,
extra_tools = NULL
)
store |
A |
store_description |
Optional string used in the tool description presented to clients. |
... |
arguments passed on to |
name, title |
Optional tool function name and title. By default,
|
extra_tools |
Optional additional tools (list of |
To use this function with
Codex CLI,
add something like this to ~/.codex/config.toml
[mcp_servers.quartohelp]
command = "Rscript"
args = [
"-e",
"ragnar::mcp_serve_store('/path/to/ragnar.store', top_k=10)"
]
You can confirm the agent can search the ragnar store by inspecting the
output from the /mcp command, or by asking it "What tools do you have
available?".
This function blocks the current R process by running an MCP server. It is intended for non-interactive use. Called primarily for side-effects.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.