Skip to content

Docker MCP Gateway

Testcontainers module for Docker MCP Gateway.

DockerMcpGatewayContainer's usage examples

You can start a Docker MCP Gateway container instance from any Java application by using:

DockerMcpGatewayContainer gateway = new DockerMcpGatewayContainer("docker/agents_gateway:v2")
    .withServer("curl", "curl")
    .withServer("brave", "brave_local_search", "brave_web_search")
    .withServer("github-official", Collections.singletonList("add_issue_comment"))
    .withSecret("brave.api_key", "test_key")
    .withSecrets(Collections.singletonMap("github.personal_access_token", "test_token"))

Adding this module to your project dependencies

Docker MCP Gateway support is part of the core Testcontainers library.

Add the following dependency to your pom.xml/build.gradle file:

testImplementation "org.testcontainers:testcontainers:1.21.1"
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>testcontainers</artifactId>
    <version>1.21.1</version>
    <scope>test</scope>
</dependency>