Dockerfile to run Supergateway inside docker.
Supergateway is a kind of gateway/proxy which runs a MCP stdio-based servers over SSE (Server-Sent Events) with one command. This is useful for remote access, debugging, or connecting to SSE-based clients when your MCP server only speaks stdio.
For detail document: https://github.com/supercorp-ai/supergateway
To build the Docker image, navigate to the supergateway-dockerfile directory and run the following command:
docker build -t supergateway .This command builds an image named supergateway using the Dockerfile in the current directory.
Once the image is built, you can run a container using the following command:
docker run -i --rm -p 8000:8000 supergateway [OPTIONS]Replace [OPTIONS] with the desired command-line arguments for supergateway. Here are some examples:
-
Run with
@modelcontextprotocol/server-everything:docker run -i --rm -p 8000:8000 supergateway --stdio "npx -y @modelcontextprotocol/server-everything" -
Run with
@modelcontextprotocol/fetch:docker run -i --rm -p 8000:8000 supergateway --stdio "uvx run mcp-server-fetch" -
Run with
@modelcontextprotocol/server-filesystemand specified folders:docker run -i --rm -p 8000:8000 supergateway --stdio "npx -y @modelcontextprotocol/server-filesystem folder/path1 folder/path2" -
Run with
uvx mcp-server-git:docker run -i --rm -p 8000:8000 supergateway --stdio "uvx mcp-server-git"
The Dockerfile uses both ENTRYPOINT and CMD instructions to define how the container executes the supergateway application.
-
ENTRYPOINT: Specifies the executable that will be run when the container starts. In this case, the
ENTRYPOINTis set tosupergateway. This means that thesupergatewaycommand will always be executed when the container runs.ENTRYPOINT ["supergateway"]
-
CMD: Provides default arguments to the
ENTRYPOINTcommand. If the user doesn't provide any arguments when running the container, the arguments specified in theCMDinstruction will be used. In this case, the default command is--stdio "uvx mcp-server-git".CMD ["--stdio", "uvx mcp-server-git"]
This means that, by default, the container will run
supergateway --stdio "uvx mcp-server-git".
The ENTRYPOINT and CMD instructions work together to provide flexibility in how the supergateway application is run.
-
If you want to run
supergatewaywith the default arguments, simply run the container without any arguments:docker run -i --rm -p 8000:8000 supergateway
-
If you want to run
supergatewaywith different arguments, you can specify them when running the container. These arguments will override the default arguments specified in theCMDinstruction:docker run -i --rm -p 8000:8000 supergateway --stdio "npx -y @modelcontextprotocol/server-everything"
In this example, the --stdio "npx -y @modelcontextprotocol/server-everything" arguments override the default --stdio "uvx mcp-server-git" arguments.
Currently not run with @smithery-ai, need to pre-install package, not dynamic installation.