agentleFS
DockerKnown publisherdocker/mcp-gateway/CLAUDE.md

mcp-gateway

CLAUDE.md1.6k starsChanged 11 months agoMITView on GitHub

This is the Docker MCP Gateway - a CLI plugin that enables easy and secure running of Model Context Protocol (MCP) servers through Docker containers. The plugin acts as a gateway between AI clients and containerized MCP servers, providing isolation, security, and management capabilities. The codebase follows a gateway pattern where: - AI Client connects to the MCP Gateway - MCP Gateway (this CLI) manages multiple MCP Servers running in Docker containers Key architectural components: - Gateway: Core routing and…

Trending

Less talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 4 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 1 mentionJun 2026: 2 mentionsJul 2026: 0 mentionsAug 2026: 2 mentionsSep 2026: 1 mentionOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the docker/mcp-gateway repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about docker/mcp-gateway

The biggest 5 of 19 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 19

Talked about on GitHub, Hacker News and Bluesky (19 times).

On GitHub · 17

12 more on GitHub

On Hacker News · 1

On Bluesky · 1

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Call interception and logging

    line 107
  2. Very specific:

    Use go test -count=1 to disable test caching

    line 145

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Overview

This is the Docker MCP Gateway - a CLI plugin that enables easy and secure running of Model Context Protocol (MCP) servers through Docker containers. The plugin acts as a gateway between AI clients and containerized MCP servers, providing isolation, security, and management capabilities.

Architecture

The codebase follows a gateway pattern where:

  • AI Client connects to the MCP Gateway
  • MCP Gateway (this CLI) manages multiple MCP Servers running in Docker containers

Key architectural components:

  • Gateway: Core routing and protocol translation (cmd/docker-mcp/internal/gateway/)
  • Client Management: Handles connections to AI clients (cmd/docker-mcp/client/)
  • Server Management: Manages MCP server lifecycle (cmd/docker-mcp/server/)
  • Catalog System: Manages available MCP servers (cmd/docker-mcp/catalog/)
  • Security: Secrets management and OAuth flows (cmd/docker-mcp/secret-management/, cmd/docker-mcp/oauth/)

Development Commands

Building

# Build the CLI plugin locally
make docker-mcp

# Cross-compile for all platforms
make docker-mcp-cross

Testing

# Run all tests
make test

# Run integration tests specifically
make integration

# Run long-lived integration tests
go test -count=1 ./... -run 'TestLongLived'

# Run specific tests by pattern
go test -count=1 ./... -run 'TestIntegration'

# Run a single test file
go test ./cmd/docker-mcp/server/server_test.go

# Run tests with coverage
go test -cover ./...

Code Quality

# Format code
make format

# Run linter
make lint

# Run linter for specific platform
make lint-linux
make lint-darwin

# Run Go vet (static analysis)
go vet ./...

# Run Go mod tidy to clean dependencies
go mod tidy

Project Structure

  • cmd/docker-mcp/ - Main CLI application entry point
  • cmd/docker-mcp/internal/gateway/ - Core gateway implementation with client pooling, proxy management, and transport handling
  • cmd/docker-mcp/internal/docker/ - Docker integration for container management
  • cmd/docker-mcp/internal/mcp/ - MCP protocol implementations (stdio, SSE)
  • cmd/docker-mcp/internal/desktop/ - Docker Desktop integration and authentication
  • cmd/docker-mcp/catalog/ - Server catalog management commands
  • cmd/docker-mcp/client/ - Client configuration and connection management
  • cmd/docker-mcp/server/ - Server lifecycle management commands
  • cmd/docker-mcp/tools/ - Tool execution and management
  • examples/ - Usage examples and compose configurations
  • docs/ - Technical documentation

Key Configuration Files

The CLI uses these configuration files (typically in ~/.docker/mcp/):

  • docker-mcp.yaml - Server catalog definitions
  • registry.yaml - Registry of enabled servers
  • config.yaml - Gateway configuration and options

Important Patterns

Transport Modes

The gateway supports multiple transport modes:

  • stdio - Standard input/output (default)
  • streaming - HTTP streaming for multiple clients
  • sse - Server-sent events

Security Features

  • Container isolation for MCP servers
  • Secrets management via Docker Desktop
  • OAuth flow handling
  • API key and credential protection
  • Call interception and logging

Client Integration

The system integrates with various AI clients:

  • VS Code / Cursor
  • Claude Desktop
  • Continue Dev
  • Custom MCP clients

Configuration files for different clients are automatically managed in cmd/docker-mcp/client/testdata/.

CLI Plugin Development

This is a Docker CLI plugin written in Go 1.24+. Key development patterns:

Plugin Installation

The plugin is installed as docker-mcp and becomes available as docker mcp <command>. The Makefile handles building and installing to the correct Docker CLI plugins directory (~/.docker/cli-plugins/).

Command Structure

Commands follow the Cobra CLI pattern with the main command tree defined in cmd/docker-mcp/commands/. Each major command area (catalog, server, client, etc.) has its own file.

Configuration Management

The CLI uses YAML configuration files stored in ~/.docker/mcp/:

  • Server definitions are loaded from catalog files
  • Runtime configuration is managed through config.yaml
  • Server enablement tracked in registry.yaml

Container Lifecycle

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

Testing Patterns

  • 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.