Join our Discord Server
Docker MCP Gateway

Using Docker MCP Gateway with Docker Compose

Estimated reading: 2 minutes 1222 views

This minimalist Docker Compose example demonstrates a lightweight deployment of the MCP Gateway that operates independently of the MCP Toolkit UI and runs on any Docker-compatible environment, including systems without Docker Desktop. 

services:
  gateway:
    image: docker/mcp-gateway
    command:
      - --servers=duckduckgo
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "8811:8811"

The configuration specifies enabled MCP servers directly through the –servers command-line parameter, requires no secret management setup, and automatically pulls server definitions from Docker’s hosted MCP Catalog at http://desktop.docker.com/mcp/catalog/v2/catalog.yaml, making it ideal for quick testing, development environments, or production deployments where simplicity and portability are priorities.

Start the service

docker compose up 

This Docker Compose configuration defines a single service called gateway that runs the Docker MCP Gateway using the official docker/mcp-gateway image. 

The gateway is configured to enable the DuckDuckGo MCP server through the –servers=duckduckgo command argument, which tells the gateway which MCP servers to load and make available to connecting clients. 

The crucial /var/run/docker.sock:/var/run/docker.sock volume mount gives the gateway container access to the host’s Docker daemon, allowing it to manage and spawn additional containers for the MCP servers it hosts. 

Finally, the port mapping “8811:8811” exposes the gateway’s default stdio protocol port (8811) to the host machine, enabling MCP clients like Claude Desktop, Cursor, or VS Code to connect to the gateway and access the DuckDuckGo search capabilities through a standardized MCP interface – essentially creating a containerized proxy that bridges AI applications with external tools and services.

Leave a Reply

Share this Doc

Using Docker MCP Gateway with Docker Compose

Or copy link

CONTENTS
Join our Discord Server