NAME
Claude::Agent::MCP::StdioServer - An external MCP server the CLI starts
SYNOPSIS
use Claude::Agent::MCP::StdioServer;
my $server = Claude::Agent::MCP::StdioServer->new(
command => '/usr/bin/npx',
args => ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'],
env => { API_KEY => $key },
);
DESCRIPTION
Configuration for an MCP server the CLI runs as a child process and talks to over its standard streams. The command and arguments are passed to the CLI as given: build them from trusted values only.
The constructor refuses a relative command, an argument containing a null byte or a shell metacharacter, an environment name that is not a POSIX identifier, and an environment value containing a control character.
ATTRIBUTES
command
Absolute path of the executable. Required.
args
ArrayRef of arguments.
env
HashRef of environment variables for the server.
type
Always stdio. Read only.
METHODS
new
Takes a flat list of name/value pairs. Unknown names are ignored.
to_hash
my $hash = $server->to_hash;
{ type, command, args, env }, the --mcp-config entry.
AUTHOR
LNATION, <email at lnation.org>
LICENSE
This software is Copyright (c) 2026 by LNATION.
This is free software, licensed under The Artistic License 2.0 (GPL Compatible).