Docker MCP Gateway Agent Rules

A Docker CLI plugin that connects AI clients to containerized MCP servers.

Overview

Docker MCP Gateway's CLAUDE.md introduces a Go CLI plugin, its gateway, and the container lifecycle. It defines three kinds of configuration and the Docker and cache state needed for integration tests.

Documents

└── 

Techniques in this file

01 / Architecture as narrative

Start with the actors in the connection flow

The architecture starts with an AI client, the gateway, and its containerized servers. It then maps routing, client management, server lifecycle, catalogs, and secrets to their implementation directories.

Source excerpt starting at line 12.
- **AI Client** connects to the **MCP Gateway** - **MCP Gateway** (this CLI) manages multiple **MCP Servers** running in Docker containers

02 / Architecture as narrative

Distinguish configuration by responsibility

The same configuration directory holds catalogs, runtime settings, and the enabled-server registry. Naming their separate responsibilities helps prevent an edit to one kind of configuration from being mistaken for another.

Source excerpt starting at line 130.
- Server definitions are loaded from catalog files- Runtime configuration is managed through config.yaml- Server enablement tracked in registry.yaml

03 / Architecture as narrative

State the lifecycle obligations of managed containers

The guide describes validation before use, naming conventions, health checks, logging, and shutdown cleanup. That sequence provides context for changes affecting how a server is started or stopped.

Source excerpt starting at line 135.
MCP servers run as Docker containers with proper lifecycle management:- Images are pulled and validated before use  - Containers have consistent naming patterns- Health checks and logging are built-in- Proper cleanup on shutdown

04 / Verification by change type

Make integration-test prerequisites explicit

The testing section says that integration tests need a Docker daemon and long-lived tests run real containers. It also disables Go test caching when exercising those scenarios.

Source excerpt starting at line 142.
- Integration tests require Docker daemon- Long-lived tests run actual container scenarios- Mock configurations in testdata directories- Use `go test -count=1` to disable test caching

Ideas for your repo

  1. Explain the actors and connection flow before listing directories.
  2. Separate files by the configuration responsibility each owns.
  3. Document startup and shutdown obligations for managed resources.
  4. State external-service and cache requirements beside integration-test commands.
Sponsored byModem

Give your agents the whole story.

These instructions explain how to work in Docker MCP Gateway. Modem shows your agents what customers said, who is affected, and what changed.

See how Modem works