
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
mcp-server-docker
Advanced tools
This MCP (Model Context Protocol) server provides a secure interface for running commands inside Docker containers. It acts as a privileged sidecar that can execute arbitrary commands within specified Docker Compose service containers.
Run the MCP server directly without cloning:
npx mcp-server-docker
Or install globally:
npm install -g mcp-server-docker
mcp-server-docker
Add the following to your docker-compose.yml:
services:
mcp-docker:
build: ./mcp-server-docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "3001:3000" # Expose MCP server
environment:
- COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
- DEFAULT_SERVICE=app
- COMPOSE_FILE=docker-compose.yml
- PORT=3000
networks:
- your-network
cd mcp-server-docker
npm install
npm run build
The server accepts the following environment variables:
ALLOWED_CONTAINERS: Comma-separated list of allowed service:container pairs (e.g., "app:myapp_container,db:mydb_container")DEFAULT_SERVICE: Default service to run commands in (default: "laravel_app")COMMAND_TIMEOUT: Command timeout in milliseconds (default: 300000)The server exposes a single tool called run_command:
{
"command": "string (required) - The command to execute",
"service": "string (optional) - Docker service name"
}
{
"command": "npm test",
"service": "frontend"
}
The tool returns the command output with the following structure:
The server uses STDIO transport for MCP communication. When run with npx mcp-server-docker, it will:
# Run in development mode
npm run dev
# Build TypeScript
npm run build
# Run tests
npm test
FAQs
MCP server for executing commands in Docker containers
The npm package mcp-server-docker receives a total of 593 weekly downloads. As such, mcp-server-docker popularity was classified as not popular.
We found that mcp-server-docker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.