Skip to main content
Glama

compose_cp

Copy files or folders between a Docker Compose service container and the host filesystem. Specify source and destination as either SERVICE:PATH or a local path, with options for replicas and compose project settings.

Instructions

Copy files/folders between a service container and the server host's filesystem.

Exactly one of source/dest is SERVICE:PATH; the other is a path on the host running this MCP server, read/written as the server's user (same host exposure as the file-path archive tools — see SECURITY.md). Copying to stdout (dest="-") is unsupported; use container_archive_get. Does not raise on a non-zero CLI exit — inspect returncode/stderr in the result. With no local compose plugin and an ssh:// target, runs the real docker compose cp on that host instead and relays whichever side of the copy is local over the same SSH connection — every parameter above behaves the same either way, since the actual copy always runs through the real CLI. The one difference: a container->host copy is refused with FileExistsError if the local destination already exists, since only this host (not the remote one) knows that. unix:///tcp://+TLS hosts with no local plugin are not covered by this fallback (no shell to run the CLI on) and still raise RuntimeError — use container_archive_put (host to container) or container_archive_get_to_file (container to host) there instead; both talk to the daemon directly and need no local CLI (compose_ps gives you the container name).

args: source - SERVICE:SRC_PATH or a host path dest - SERVICE:DEST_PATH or a host path (not "-") index - Container index when the service has multiple replicas (default 1) all_containers - Copy to/from all containers of the service (--all) project_dir - Dir with the compose file (default: server cwd; copied to the target host if no local plugin) files - Explicit compose file paths (repeatable, -f) project_name - Compose project name override timeout_seconds - Subprocess timeout (default 300s) returns: dict - {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destYes
filesNo
indexNo
sourceYes
project_dirNo
project_nameNo
all_containersNo
timeout_secondsNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint=false and destructiveHint=false annotations, the description discloses important behavioral traits: host filesystem exposure as the server's user, non-zero CLI exit handling (inspect returncode/stderr), FileExistsError on existing destinations for container→host copies, RuntimeError conditions for unsupported hosts, and parameter behavior differences under SSH fallback. This is rich, actionable transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but front-loaded with the core purpose, followed by essential edge cases and an args list. Every sentence earns its place, but the wording is verbose, especially in the SSH fallback explanation. It is well-structured but could be tightened slightly without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (SSH fallback, multiple error modes, alternative tools), the description is complete: it covers when to use alternatives, how errors are surfaced, host exposure, parameter behaviors, and the return format. No significant gaps remain, making it sufficient for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully compensates by listing all 8 parameters with semantic meaning: SERVICE:PATH format for source/dest, index for replicas, project_dir defaulting to server cwd, files as repeatable -f flags, project_name override, and timeout_seconds default. It also documents the return dict structure, adding substantial meaning beyond the bare schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Copy files/folders between a service container and the server host's filesystem.' This clearly distinguishes it from sibling archive tools like container_archive_get/put and from other compose tools by naming the exact operation and scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when not to use the tool: dest='-' is unsupported and container_archive_get should be used instead; for unix:///tcp://+TLS hosts without a local plugin, it directs to container_archive_put or container_archive_get_to_file. It also points to compose_ps for obtaining container names, providing clear exclusions and alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/L337-org/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server