Skip to content

StdioMcpServer

Base classes

Name Children Inherits
BaseMcpServer
aclientp.schema.mcp
MCP server base class.

⋔ Inheritance diagram

graph TD
  95970859915728["mcp.StdioMcpServer"]
  95970858786304["mcp.BaseMcpServer"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970858786304 --> 95970859915728
  95970862258240 --> 95970858786304
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: BaseMcpServer

Stdio transport configuration.

All Agents MUST support this transport.

Source code in src/aclientp/schema/mcp.py
class StdioMcpServer(BaseMcpServer):
    """Stdio transport configuration.

    All Agents MUST support this transport.
    """

    args: Sequence[str]
    """Command-line arguments to pass to the MCP server."""

    # typ: Literal["stdio"] = Field(default="stdio", init=False)
    # """Stdio transport type."""

    command: str
    """Path to the MCP server executable."""

    env: Sequence[EnvVariable]
    """Environment variables to set when launching the MCP server."""

    def get_env_dict(self) -> dict[str, str]:
        return {env.name: env.value for env in self.env}

args instance-attribute

args: Sequence[str]

Command-line arguments to pass to the MCP server.

command instance-attribute

command: str

Path to the MCP server executable.

env instance-attribute

env: Sequence[EnvVariable]

Environment variables to set when launching the MCP server.

:fa-brands-github: Show source on GitHub