Tool StdioMcpClient

Tool StdioMcpClient

Certified

Run MCP tools over stdio

Starts an MCP server via a local command and exposes its advertised tools to the agent over stdio. command is required; logEvents defaults to false. Use env to pass credentials or config needed by the server process.

yaml
type: io.kestra.plugin.ai.tool.StdioMcpClient

Agent calling an MCP server via Stdio

yaml
id: mcp_client_stdio
namespace: company.ai

inputs:
  - id: prompt
    type: STRING
    defaults: What is the current time in New York?

tasks:
  - id: agent
    type: io.kestra.plugin.ai.agent.AIAgent
    prompt: "{{ inputs.prompt }}"
    provider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      apiKey: "{{ secret('GEMINI_API_KEY') }}"
      modelName: gemini-3.5-flash-lite
    tools:
      - type: io.kestra.plugin.ai.tool.StdioMcpClient
        command: ["docker", "run", "--rm", "-i", "mcp/time"]
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-ai --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties
SubTypestring

MCP server command

Command that starts the MCP server process, split into its parts, which the client talks to over standard input/output. No default: this property is required.

Environment variables

Environment variables passed to the MCP server process, typically to supply credentials. Not set by default.

Defaultfalse

Log events

If true, MCP protocol events exchanged with the server process are logged. Defaults to false.