Agentic Data Plane

rpk ai mcp-server tools call

Invoke a tool on an MCP server through the AI Gateway MCP proxy.

The command reaches the server’s /mcp/v1/<name> endpoint with the same bearer token as the rest of rpk ai. If the server uses user-delegated OAuth, AI Gateway authenticates the call with your stored connection for that server’s OAuth provider.

Pass the tool’s arguments as a JSON object with --args. Example:

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

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

rpk ai mcp-server tools call my-postgres execute --code-mode \
--args '{"code":"var r = call_tool({name:\"query\", arguments:{query:\"SELECT 1\"}}); JSON.stringify(r);"}'
This command was introduced in ai version 0.2.28.

Usage

rpk ai mcp-server tools call [flags]

Flags

Value Type Description

--args

string

JSON object of tool arguments, for example, '{foo:`bar`}'. Empty means no arguments.

--code-mode

bool

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

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.