Docker MCP Server

Docker MCP Server

Enables AI assistants like Claude to manage Docker containers, images, and Docker Compose deployments through the Model Context Protocol. Provides secure container lifecycle management, image operations, and multi-host Docker server connections.

Category
Visit Server

README

🐳 Docker MCP Server

Docker Node.js MCP Claude

Docker Model Context Protocol (MCP) Server - Permite que IAs como Claude gerenciem containers Docker através do protocolo MCP de forma segura e intuitiva.

🌟 Features

  • 🔧 Gerenciamento completo de containers: Start, stop, restart, logs, estatísticas
  • 📦 Controle de imagens: Pull, remove, verificar atualizações
  • 🐳 Docker Compose: Deploy e remoção de stacks via YAML
  • 🌐 Múltiplos servidores: Conectar a vários Docker hosts simultâneamente
  • 🔒 Segurança: Socket Unix local ou TCP com TLS
  • 📊 Monitoramento: Logs estruturados e métricas em tempo real
  • ⚡ Integração Claude: Pronto para uso com Claude Code/Desktop

🚀 Quick Start

# 1. Navegar para o diretório
cd /home/marcelo/docker/mcp-docker-server

# 2. Instalar dependências
npm install

# 3. Configurar ambiente (opcional)
cp config/.env.example .env

# 4. Iniciar servidor
npm start

📋 Prerequisites

  • Node.js >= 18.0.0
  • Docker Engine funcionando
  • Usuário no grupo docker
  • Claude Code ou Claude Desktop

🛠️ Available Tools

Category Tools Description
Containers list_containers, start_container, stop_container, restart_container Gerenciamento completo de containers
Images list_images, pull_image, remove_image, check_updates Controle de imagens Docker
Compose run_docker_compose, remove_docker_compose Deploy via YAML inline
Networks/Volumes list_networks, list_volumes Visualização de recursos
Servers list_docker_servers, add_docker_server Multi-host management

🔌 Claude Integration

Método 1: Configuração de projeto

Criar .claude/mcp.json:

{
  "servers": {
    "docker-local": {
      "type": "stdio",
      "command": "node",
      "args": ["src/index.js"],
      "env": {
        "DOCKER_SOCKET": "/var/run/docker.sock"
      },
      "description": "Local Docker management via MCP"
    }
  }
}

Método 2: Claude Desktop global

Ver exemplos em config/claude-desktop-sample.json.

📖 Examples

Listar containers via Claude

"Liste todos os containers Docker ativos e parados"

Deploy Docker Compose via Claude

"Deploy este Docker Compose:

version: '3.8'
services:
  redis:
    image: redis:alpine
    ports:
      - '6379:6379'"

Gerenciar container específico

"Reinicie o container 'nginx-proxy' e mostre os logs recentes"

📁 Project Structure

mcp-docker-server/
├── src/
│   └── index.js              # Servidor principal
├── scripts/
│   ├── start-server.sh       # Script de inicialização
│   └── stop-server.sh        # Script de parada
├── config/
│   ├── .env.example          # Configuração de ambiente
│   ├── claude-desktop-sample.json
│   └── env.sample.sh
├── docs/
│   └── SETUP.md             # Documentação completa
├── logs/                    # Logs de execução
├── .claude/
│   └── mcp.json            # Configuração MCP do projeto
└── package.json

⚙️ Configuration

Socket Unix (Padrão)

DOCKER_SOCKET=/var/run/docker.sock

Docker remoto

DOCKER_HOST=192.168.1.10
DOCKER_PORT=2375
DOCKER_PROTOCOL=http

Múltiplos servidores

DOCKER_SERVERS=local:socket:/var/run/docker.sock,prod:prod-docker:2376:https

🐛 Troubleshooting

Erro de permissão

sudo usermod -aG docker $USER
newgrp docker

Dependências

rm -rf node_modules package-lock.json
npm install

Debug

export LOG_LEVEL=debug
npm start

📊 Monitoring

# Logs em tempo real
tail -f logs/server-*.log

# Status básico
timeout 5s npm start < /dev/null

🚨 Security Notes

⚠️ IMPORTANTE: O acesso ao socket Docker concede privilégios equivalentes ao root. Use apenas em ambientes confiáveis.

  • Socket local: Preferir quando possível
  • TCP remoto: Sempre usar TLS em produção
  • Firewall: Limitar acesso às portas Docker
  • Containers: Revisar imagens antes de executar

📚 Documentation

📝 License

MIT License - Ver arquivo LICENSE para detalhes.

🤝 Contributing

  1. Fork o projeto
  2. Criar feature branch (git checkout -b feature/nova-funcionalidade)
  3. Commit as mudanças (git commit -am 'Adiciona nova funcionalidade')
  4. Push to branch (git push origin feature/nova-funcionalidade)
  5. Abrir Pull Request

⭐ Support

Gostou do projeto? Deixe uma estrela ⭐

Encontrou algum problema? Abra uma issue 🐛


Criado por: Marcelo Matos
Baseado em: mcp-docker por FlorentB974

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured