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);"}'
Flags
| Value | Type | Description |
|---|---|---|
|
string |
JSON object of tool arguments, e.g. '{"foo":"bar"}'. Empty means no arguments. |
|
- |
Target the virtual code-mode sibling endpoint (<server>-code) instead of the primary. |
|
- |
help for call. |
|
string |
output format: table |
|
json |
yaml |
|
--no-color |
- |
|
-c, --rpai-config |
string |
|
-s, --rpai-endpoint |
string |
|
-p, --rpai-profile |
string |
|
-v, --rpai-verbose |
- |
|
--token |
string |