docker-mcp

docker-mcp

0

The Docker MCP Server is designed to facilitate interactions with Docker containers and images using the Model Context Protocol. It utilizes the Python Docker SDK and supports various operations including listing, running, and stopping Docker entities. The server offers configuration through environment variables for secure and flexible deployment.

Docker MCP Server

This project is a Model Context Protocol (MCP) server designed to provide interfaces for interacting with Docker containers and images. It supports communication via the stream HTTP transport method and leverages the Python Docker SDK for conducting Docker operations.

Features

  • List Docker containers and images
  • Run, stop, and remove containers
  • View container logs
  • Pull Docker images
  • Inspect container details
  • Access Docker information as resources

Prerequisites

  • Docker
  • Docker Compose (optional, for easier deployment)
  • uv (for local development)

Configuration

Set environment variables for configuration:

  • MCP_PORT: Enables SSE transport and specifies the listening port.
  • MCP_AUTH_TOKEN: A secret token for authentication with SSE transport.

Available Tools

  • docker_ps: List running containers
  • docker_images: List available Docker images
  • docker_inspect: Get detailed information about a container
  • docker_run: Run a Docker container
  • docker_stop: Stop a running container
  • docker_rm: Remove a container
  • docker_logs: Fetch container logs
  • docker_pull: Pull a Docker image

Available Resources

  • docker://containers: Information about all containers
  • docker://images: Information about all images
  • docker://container/{container_id}: Detailed information about a specific container

TODO

  • Add functionality to query documentation for a specific Docker image

License

MIT