mcp-docker-compose
Provides tools for inspecting and managing local Docker Compose environments: listing services with state, health, and ports; fetching recent logs with secret redaction; inspecting resolved service configuration; and gracefully restarting individual services.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-docker-compose list my Docker Compose services and their health status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-docker-compose
An open-source Model Context Protocol (MCP) server that gives AI coding agents safe, structured access to local Docker Compose services, logs, configuration inspection, and service restarts.
Security Guarantees
No shell execution: All
docker composecommands are invoked directly vianode:child_processexecFilewith explicit argument arrays—neverexecor shell string concatenation. Flag-like arguments (-...) are rejected.Automatic secret redaction: Sensitive environment variables (
PASSWORD,SECRET,TOKEN,API_KEY,PRIVATE_KEY,ACCESS_KEY,AUTH,DSN,DATABASE_URL), bearer tokens, and embedded URI credentials (e.g.,postgres://user:pass@host) are automatically replaced with[REDACTED]in bothcompose_inspect_configandcompose_get_logs.Non-destructive toolset: Exposes only read/inspection tools and single-service graceful restarts—no
down,rm,prune, orexecoperations.Output & timeout safety: Commands enforce configurable timeouts and
maxBufferlimits, and log output is capped at 20,000 characters.
Related MCP server: docker-compose-mcp
Quick Start
Run directly with npx (requires Node.js >= 20 and Docker Compose v2):
npx -y mcp-docker-composeClient Configuration
Claude Code
Add to your project .mcp.json or ~/.claude.json:
{
"mcpServers": {
"docker-compose": {
"command": "npx",
"args": ["-y", "mcp-docker-compose"]
}
}
}Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"docker-compose": {
"command": "npx",
"args": ["-y", "mcp-docker-compose"]
}
}
}Cursor
Add to .cursor/mcp.json in your project or global Cursor settings:
{
"mcpServers": {
"docker-compose": {
"command": "npx",
"args": ["-y", "mcp-docker-compose"]
}
}
}Tools Reference
Tool | Description | Parameters |
| Lists services with state, health status, and published ports. |
|
| Fetches recent logs with secret redaction, optional error filtering, and 20k-char truncation. |
|
| Inspects resolved service config ( |
|
| Gracefully restarts a single service with a shutdown timeout. |
|
Development
npm install
npm run lint
npm run build
npm testLicense
Available Tools
4 toolscompose_get_logsGet Docker Compose LogsRead-only
Fetch recent Docker Compose logs with automatic secret redaction, optional error filtering, and 20,000-char safety truncation.
Inputs: cwd, tail, service, errorsOnly, +1 more.
compose_inspect_configInspect Docker Compose ConfigRead-only
Inspect resolved Docker Compose service configuration (image, redacted environment variables, ports, and depends_on).
Inputs: cwd, service, composeFile.
compose_list_servicesList Docker Compose ServicesRead-only
List local Docker Compose services with their state, health status, and published ports.
Inputs: cwd, composeFile.
compose_restart_serviceRestart Docker Compose ServiceIdempotent
Restart a single Docker Compose service with a configurable graceful shutdown timeout.
Inputs: service (required), cwd, composeFile, timeoutSeconds.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Deploy local apps, add managed Postgres, and inspect logs from your AI coding agent.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Docker containers through safe, permission-controlled access to inspect, manage, and diagnose containers, images, and compose services with built-in timeouts and AI-powered analysis.-
- AlicenseAqualityDmaintenanceEnables Claude to manage Docker Compose containers by updating, running commands, and viewing status/logs.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to autonomously check, diagnose, and recover Dockerized services through safe, tool-based ops without direct host shell access.MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Docker containers and Compose stacks through natural language, including lifecycle operations, logs, stats, and secure remote access.219 npm3MIT