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.
README
đł Docker MCP Server
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
- đ Setup Guide - Guia completo de instalação e configuração
- đ§ Troubleshooting - Solução de problemas comuns
- đ Claude Integration - Integração com Claude
- đ ïž Available Tools - Lista completa de ferramentas
đ License
MIT License - Ver arquivo LICENSE para detalhes.
đ€ Contributing
- Fork o projeto
- Criar feature branch (
git checkout -b feature/nova-funcionalidade) - Commit as mudanças (
git commit -am 'Adiciona nova funcionalidade') - Push to branch (
git push origin feature/nova-funcionalidade) - 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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
E2B
Using MCP to run code via e2b.