| openai_hosted_mcp_tool | R Documentation |
Give the model access to a remote MCP server, executed
server-side by OpenAI. This is independent of aisdk's local MCP client
(R/mcp_client.R) — that one connects from R, this one tells OpenAI to
connect on the model's behalf.
openai_hosted_mcp_tool(
server_label,
server_url = NULL,
connector_id = NULL,
server_description = NULL,
allowed_tools = NULL,
require_approval = NULL,
authorization = NULL,
headers = NULL
)
server_label |
Required label used to identify the server in tool calls. |
server_url |
URL of a custom MCP server. Exactly one of |
connector_id |
OpenAI-managed connector ID (e.g. |
server_description |
Optional human-readable description. |
allowed_tools |
Optional character vector of tool names to expose, or
a list filter (e.g. |
require_approval |
|
authorization |
Optional OAuth access token. |
headers |
Optional named list of HTTP headers sent to the MCP server. |
A plain list ready to drop into tools = list(...).
## Not run:
generate_text(
model,
"Roll 2d4+1",
tools = list(openai_hosted_mcp_tool(
server_label = "dmcp",
server_url = "https://dmcp-server.deno.dev/sse",
allowed_tools = "roll",
require_approval = "never"
))
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.