Agentic Data Plane
beta

rpk ai mcp tools call

Invoke a tool on an MCP server through the aigw MCP proxy.

The server’s /mcp/v1/<name> endpoint is reached with the same bearer token used by the rest of rpk ai; aigw resolves user-delegated OAuth tokens from the vault when the MCP server is configured with --user-oauth-provider.

Arguments passed to the tool are a JSON object supplied via --args. Example:

rpk ai mcp tools call gf-servicenow-sand2 listtablerecords \
  --args '{"tableName":"incident","sysparm_limit":3}'

With --code-mode the call targets the virtual code-mode sibling endpoint (/mcp/v1/<name>-code). That endpoint exposes search (tool catalog for the primary) and execute (runs JavaScript in a sandbox with call_tool bound to the primary’s tools). Example:

rpk ai mcp tools call pg-garrett execute --code-mode \
  --args '{"code":"var r = call_tool({name:\"query\", arguments:{query:\"SELECT 1\"}}); JSON.stringify(r);"}'

Usage

rpk ai mcp tools call <server> <tool> [flags]

Flags

Value Type Description

--args

string

JSON object of tool arguments, e.g. '{"foo":"bar"}'. Empty means no arguments.

--code-mode

-

Target the virtual code-mode sibling endpoint (<server>-code) instead of the primary.

-h, --help

-

help for call.

-o, --format

string

output format: table

wide

json

yaml

markdown (env: RPAI_FORMAT) (default "table").

--no-color

-

disable colored output (env: NO_COLOR).

-c, --rpai-config

string

path to rpai config (env: RPAI_CONFIG) (default "/var/lib/redpanda/.rpai/config").

-s, --rpai-endpoint

string

override dataplane URL (env: RPAI_ENDPOINT).

-p, --rpai-profile

string

rpai profile name (env: RPAI_PROFILE).

-v, --rpai-verbose

-

verbose debug logging to stderr (env: RPAI_VERBOSE).

--token

string