No description
Find a file
2026-05-31 18:36:57 +02:00
.idea + 2026-05-31 18:36:57 +02:00
.gitignore Rename config files to match Copilot home conventions 2026-05-03 03:54:00 +02:00
config.example.json Rename config files to match Copilot home conventions 2026-05-03 03:54:00 +02:00
copilot-instructions.md Rename config files to match Copilot home conventions 2026-05-03 03:54:00 +02:00
LICENSE Initial commit 2026-05-03 02:38:17 +02:00
README.md Rename config files to match Copilot home conventions 2026-05-03 03:54:00 +02:00
requirements.txt v1.0.0 2026-05-03 02:43:35 +02:00
server.py Rename config files to match Copilot home conventions 2026-05-03 03:54:00 +02:00

Docker MCP

Remote Docker management over SSH — exposed as a local MCP server for GitHub Copilot sessions.

No server-side component required. The MCP runs locally and SSHes into the remote host to execute Docker commands.

Tools

Tool Description
docker_ps List containers
docker_logs Fetch logs (tail, since, grep)
docker_exec Run command inside container
docker_run Start new container
docker_start / docker_stop / docker_restart Lifecycle control
docker_rm Remove container(s)
docker_inspect Detailed container/image info
docker_stats Resource usage snapshot
docker_top Processes inside container
docker_images List images
docker_pull / docker_rmi / docker_build Image management
docker_compose_ps/up/down/logs/restart/pull Compose operations
docker_system_df Disk usage
docker_info / docker_version System info
docker_network_ls / docker_volume_ls Network & volume listing

Setup

1. Clone the repository

git clone git@github.com:Isak-Landin/mcp-docker-engine.git ~/mcp-docker-engine
cd ~/mcp-docker-engine

2. Install dependencies

sudo apt install python3.12-venv
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

3. Configure SSH target

cp config.example.json config.json
# Edit config.json with your server details

config.json fields:

{
  "host": "your-server.example.com",
  "user": "ubuntu",
  "key_path": "~/.ssh/id_rsa",
  "port": 22
}

4. Verify SSH access

Using the values from your config.json:

ssh -i <key_path> <user>@<host> docker ps

5. Register with GitHub Copilot

Replace $HOME with your actual home directory path (run echo $HOME).

Copilot CLI — mcp-config.json

Add the docker-mcp entry to the mcpServers object in your Copilot home's mcp-config.json:

"docker-mcp": {
  "command": "$HOME/mcp-docker-engine/.venv/bin/python3",
  "args": ["$HOME/mcp-docker-engine/server.py"]
}

VS Code — .vscode/mcp.json

Add the docker-mcp entry to the servers object:

"docker-mcp": {
  "type": "stdio",
  "command": "$HOME/mcp-docker-engine/.venv/bin/python3",
  "args": ["$HOME/mcp-docker-engine/server.py"]
}

Copilot instructions — copilot-instructions.md

Add the contents of copilot-instructions.md to your Copilot home's copilot-instructions.md.

Notes

  • The SSH connection uses StrictHostKeyChecking=accept-new - safe for known hosts, will warn on key changes.
  • docker_build and docker_pull use a 5-10 min timeout; adjust timeout in server.py if needed.
  • For Compose tools, project_dir is the remote path containing docker-compose.yml.
  • docker_logs and docker_exec redirect stderr to stdout so output is always captured.