# rpk ai mcp tools call

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [agentic-data-plane-full.txt](https://docs.redpanda.com/agentic-data-plane-full.txt)

---
title: rpk ai mcp tools call
page-beta-text: This is a beta feature. Beta features are available for testing and feedback. They are not supported by Redpanda and should not be used in production environments.
latest-operator-version: v26.1.5
latest-console-tag: v3.7.4
latest-connect-version: 4.96.1
latest-redpanda-tag: v26.1.10
docname: rpk/rpk-ai/rpk-ai-mcp-tools-call
page-component-name: agentic-data-plane
page-version: master
page-component-version: master
page-component-title: Agentic Data Plane
page-relative-src-path: rpk/rpk-ai/rpk-ai-mcp-tools-call.adoc
page-edit-url: https://github.com/redpanda-data/adp-docs/edit/main/modules/reference/pages/rpk/rpk-ai/rpk-ai-mcp-tools-call.adoc
description: rpk ai mcp tools call
# Beta release status
page-beta: "true"
page-git-created-date: "2026-05-27"
page-git-modified-date: "2026-06-10"
release-status: beta - This is a beta feature. Beta features are available for testing and feedback. They are not supported by Redpanda and should not be used in production environments.
---

<!-- Source: https://docs.redpanda.com/agentic-data-plane/reference/rpk/rpk-ai/rpk-ai-mcp-tools-call.md -->

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)Usage

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

## [](#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 |