MCP servers with Docker
TL;DR
Docker is used to run MCP servers in containers, isolating them and simplifying deployment. Multiple servers can run in a Compose network, and a gateway can route MCP traffic to the correct container.
Containerized servers
Packaging a server as a container lets you pin its dependencies and control its network access. A server container typically exposes stdio to its spawner or an HTTP port to a network.
Networking and gateways
Compose networks let server containers reach each other. A gateway service can route MCP requests to the right container host. Docker networking changes the trust boundary: containers on the same network are mutually reachable.