Skip to content

cwalinapj/docker-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Docker MCP Server

A Model Context Protocol (MCP) server that enables Claude to manage Docker containers, images, and more on macOS.

Features

  • 🐳 Container Management: Start, stop, restart, and remove containers
  • 📦 Image Management: List, pull, and remove Docker images
  • 📊 Monitoring: View container logs and resource statistics
  • ⚙️ Execution: Run commands inside containers
  • 🔧 Docker Compose: Manage multi-container applications
  • 🌐 Networks & Volumes: List and manage Docker networks and volumes

Installation

Prerequisites

  • Docker Desktop for Mac (running)
  • Python 3.10 or higher
  • Claude Desktop

Quick Start

  1. Clone this repository:

    git clone https://github.com/cwalinapj/docker-mcp-server.git
    cd docker-mcp-server
  2. Install dependencies:

    pip install -r requirements.txt
  3. Configure Claude Desktop:

    Edit your Claude Desktop config at: ~/Library/Application Support/Claude/claude_desktop_config.json

    Add:

    {
      "mcpServers": {
        "docker": {
          "command": "python3",
          "args": ["/Users/YOUR_USERNAME/docker-mcp-server/scripts/docker_mcp_server.py"]
        }
      }
    }

    Replace /Users/YOUR_USERNAME/ with your actual home directory path.

  4. Restart Claude Desktop

Usage

Once configured, you can ask Claude to manage Docker:

  • "Show me all running containers"
  • "Pull the latest nginx image"
  • "Start the my-app container"
  • "Show logs for container xyz"
  • "Execute 'ls -la' in the nginx container"
  • "Run an nginx container on port 8080"
  • "Stop all running containers"

Available Tools

The server provides 17 Docker operations:

Container Operations

  • docker_ps - List containers
  • docker_start - Start containers
  • docker_stop - Stop containers
  • docker_restart - Restart containers
  • docker_rm - Remove containers
  • docker_logs - View logs
  • docker_exec - Execute commands
  • docker_stats - Resource statistics
  • docker_inspect - Detailed information

Image Operations

  • docker_images - List images
  • docker_pull - Pull images
  • docker_rmi - Remove images
  • docker_run - Create and start containers

Compose Operations

  • docker_compose_up - Start services
  • docker_compose_down - Stop services

Other Operations

  • docker_network_ls - List networks
  • docker_volume_ls - List volumes

Troubleshooting

MCP server not working?

  • Verify Docker is running: docker ps
  • Check config path is correct
  • Ensure Python 3 is available: python3 --version
  • Verify mcp package: pip show mcp
  • Check Claude Desktop logs

Development

This is an MCP skill that follows Anthropic's skill creation guidelines. The server uses the mcp Python package to communicate with Claude Desktop.

License

MIT

Author

Paul Walinap (cwalinapj)

About

MCP server for Docker management on macOS with Claude

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages