The docker-mcp server provides four primary tools for managing Docker environments via the Model Context Protocol (MCP). These tools allow an AI agent to create containers, deploy multi-container stacks, list running containers, and retrieve logs.
Tool Definitions
| Tool Name | Description | Required Arguments |
|---|
create-container | Create a new standalone Docker container | image |
deploy-compose | Deploy a Docker Compose stack | compose_yaml, project_name |
get-logs | Retrieve the latest logs for a specified Docker container | container_name |
list-containers | List all Docker containers | None |
### create-container
Input Schema:
```json
{
"type": "object",
"properties": {
"image": {"type": "string"},
"name": {"type": "string"},
"ports": {
"type": "object",
"additionalProperties": {"type": "string"}
},
"environment": {
"type": "object",
"additionalProperties": {"type": "string"}
}
},
"required": ["image"]
}
deploy-compose
Input Schema:
{
"type": "object",
"properties": {
"compose_yaml": {"type": "string"},
"project_name": {"type": "string"}
},
"required": ["compose_yaml", "project_name"]
}
get-logs
Input Schema:
{
"type": "object",
"properties": {
"container_name": {"type": "string"}
},
"required": ["container_name"]
}