Skip to content

MCP Overview

The Model Context Protocol lets a chain call tools hosted by an external MCP server. MCPStepDescription invokes one such tool. (In v0.3.0 MCP graduated from experimental.)

Terminal window
pip install 'mmar-carl[mcp]'
from mmar_carl import MCPStepDescription, MCPStepConfig, MCPServerConfig
MCPStepDescription(
number=1,
title="Search via MCP",
config=MCPStepConfig(
server=MCPServerConfig(
server_name="my_server",
command="python",
args=["-m", "my_mcp_server"], # stdio transport
),
tool_name="search",
argument_mapping={"query": "$history[-1]"},
),
)
FieldDefaultPurpose
server_name—Logical name for the server.
transport"stdio""stdio" (subprocess), "http" (streamable HTTP), "sse" (HTTP + Server-Sent Events).
command / args—How to launch a stdio server.
url—Base URL for http / sse.
headers{}Extra HTTP headers (e.g. Authorization) for http / sse.
FieldDefaultPurpose
server—The MCPServerConfig.
tool_name—MCP tool to call.
arguments{}Static arguments.
argument_mapping{}Arguments resolved from references.
timeout60.0Seconds.

Connections are managed by an internal pool (mcp_pool), and MCP runs support pause/resume, cancellation, streaming, and lossless serialization.