Large Language Models

Docker MCP Gateway: Config File, Ports, Free Use and Not Working Fixes

Where the Docker MCP Gateway config file lives, which port and transport to pick, whether you can run it for free, and how to fix the usual failures like a disconnected MCP_DOCKER server, timeouts and Windows path errors.

Docker MCP Gateway: Config File, Ports, Free Use and Not Working Fixes
Cristian Da Conceicao

You installed Docker Desktop, enabled a few MCP servers, pointed your AI client at the gateway, and now one of three things is happening: the server shows as failed, a tool call hangs for two minutes, or you simply cannot work out which file to edit. That is the daily reality of the Docker MCP Gateway, and the fixes are usually small once you know where to look. This article is a working reference for the config file, the ports and transports, the question of whether you can run it for free, and the not working fixes that solve most reports.

💡 Quick answer: the gateway reads its settings from the ~/.docker/mcp/ folder, listens on stdio by default, and only opens a TCP port when you pass --port together with --transport streaming or sse. It is free to run on a personal machine, and most failures come from PATH problems, an old Docker Desktop build, or a mismatched transport.

What the Gateway Actually Does

The Docker MCP Gateway is a small open source program that sits between your AI client (Claude Desktop, Cursor, VS Code, a custom agent) and a set of MCP servers that run as containers. Instead of wiring ten servers into ten clients, you wire one entry into each client, and the gateway starts, stops, and routes to the containers on demand.

Server racks with cables routed overhead, a picture of many services behind one entry point

The three moving parts

PartRoleWhere you meet it
ClientThe app that wants toolsClaude Desktop, Cursor, VS Code, your own agent
GatewayRoutes requests, starts containers, applies secretsdocker mcp gateway run
MCP serversContainers that expose tools (search, GitHub, databases)Enabled from the catalog

When a client asks for a tool, the gateway checks which servers are enabled, spins up the matching container if needed, passes along any configuration and secrets, and returns the result. Because every server is isolated in a container, a badly behaved tool cannot read your whole disk the way a loose npx script can.

Why people choose it over raw configs

Without a gateway you copy the same JSON block into every client and keep every API key in plain text. With one, you manage servers in a single place and your clients only need one line. That alone explains most of its popularity.

Where the Config File Lives

This is the question behind most searches, so let's be precise. The gateway does not use a single file. It uses a small set of YAML files stored under the .docker/mcp folder inside your home directory.

A developer reading a terminal at a desk, looking for the right configuration file

The files that matter

FilePurpose
docker-mcp.yaml (in catalogs/)The default catalog: the list of servers you can choose from
registry.yamlThe servers you have enabled
config.yamlPer-server settings, such as allowed paths or API options
tools.yamlWhich tools are switched on for each server

On macOS and Linux that folder is ~/.docker/mcp/. On Windows it is %USERPROFILE%\.docker\mcp\. Catalog files sit in a catalogs subfolder. Note that the official default catalog is named docker-mcp.yaml; a file called catalog.yaml only works because you place it in the catalogs folder and point to it yourself with a flag.

Editing safely

You can change these files by hand, but the CLI is safer because it writes valid YAML:

docker mcp server ls
docker mcp server enable duckduckgo
docker mcp server disable duckduckgo
docker mcp tools ls
docker mcp config read

If a change does not show up, restart the client. If you want changes picked up without a restart of the gateway itself, start it with the --watch option, which reloads configuration when the files change.

Custom catalogs and extra files

You are not stuck with the default catalog. The gateway accepts flags to add your own:

  • --additional-catalog appends a catalog file to the defaults.
  • --catalog replaces the default catalog path.
  • --config, --registry, and --tools-config let you point at files stored somewhere else, which is handy in containers and CI.

💡 Keep your custom catalog in version control and mount it. That way a teammate gets the same server list with one pull.

Hands sorting labelled metal toolboxes, a picture of a catalog of MCP servers

Ports and Transports Explained

By default the gateway does not listen on a network port at all. It talks over stdio, which means the client launches docker mcp gateway run as a child process and exchanges messages through standard input and output. That is perfect for one client on one machine, and it needs no port.

A row of ethernet ports in a patch panel, one of them empty

The three transport modes

TransportPort neededBest for
stdio (default)NoOne local client such as Claude Desktop
streamingYesSeveral clients sharing one gateway over HTTP
sseYesOlder clients that only speak server-sent events

To share one gateway across clients, start it like this:

docker mcp gateway run --port 8080 --transport streaming

Clients then connect to http://localhost:8080. The streaming endpoint is usually served under /mcp, while the SSE mode uses /sse, though you should confirm with docker mcp gateway run --help because option names have shifted between versions and some third-party write-ups use "sse" and "streaming" loosely.

Picking a port that is free

There is no magic default port, so pick any unused one. If you see an "address already in use" error, something else owns it. Check with netstat -ano | findstr :8080 on Windows or lsof -i :8080 on macOS and Linux, then choose another number or stop the other process.

Protect the open port

Once the gateway listens on TCP, anything on that interface can call your tools. Two habits help:

  1. Bind to localhost unless you truly need remote access.
  2. Set an auth token. Export MCP_GATEWAY_AUTH_TOKEN before launching, and the gateway will require it from clients. Docker documents it as a protection for local access against DNS rebinding attacks.

A steel padlock on a gate, a reminder to protect an exposed gateway port

💡 Never expose the gateway port straight to the internet. If a remote team needs it, put it behind a VPN or a reverse proxy with real authentication.

Free Use: What It Costs

The short answer is that you can run it for zero dollars in most personal setups, with two caveats.

A tidy desk with a notebook, tea and a USB drive, a calm look at costs

What is free

  • The gateway code is open source, so you can inspect it, build it, and run it without a license fee.
  • The MCP servers in the Docker catalog are container images you pull like any other image.
  • Docker Desktop has a free tier for personal use, education, open source projects, and small businesses. Larger companies need a paid subscription, so check the current Docker terms for your headcount and revenue.

Where money can sneak in

ItemCost risk
Docker Desktop at a large companyPaid seat required
Third-party APIs behind a server (search, maps, databases)Their own pricing and rate limits
The AI client and model you connectUsually a subscription or per-token fee
Cloud hosting if you run the gateway remotelyVM and bandwidth charges

So the gateway is free, but the things it talks to may not be. If you want to test an agent workflow without paying per call, a free tier model is enough to check that your tools respond correctly.

Docker Desktop or plain Engine?

The one-click MCP Toolkit experience lives inside Docker Desktop, and its documented screens assume a recent release (4.62 or later). Because the gateway itself is open source, people also run it on Linux with only Docker Engine by supplying the catalog, registry and config files by hand. That works, but you lose the graphical toggles and the built-in secret store, so expect to do more manual setup.

Connecting a Client Correctly

Before blaming the gateway, check the connection entry. Most clients take a block like this:

{
  "mcpServers": {
    "MCP_DOCKER": {
      "command": "docker",
      "args": ["mcp", "gateway", "run"]
    }
  }
}

The shortcut

Instead of editing JSON, run docker mcp client connect claude-desktop (or cursor, vscode, and so on). The command writes the entry for you, which removes typos from the picture. Use docker mcp client ls to see what is connected.

Test in the terminal first

Run docker mcp gateway run by hand. If it starts and waits quietly, the gateway is healthy and your problem lies in how the client launches it. If it errors, fix that first, because no client can work around a broken gateway.

A colleague pair reviewing a laptop together at a standing desk

Not Working: Fixes That Help

Most "not working" reports fall into a few buckets. Work through them in order, because the first ones are the most common and the cheapest to check.

A frustrated developer leaning back from a laptop with a cluttered desk

Symptom and fix table

SymptomLikely causeFix
MCP_DOCKER shows failed or disconnectedClient cannot find or launch dockerUse the full path to the Docker binary in the client config
Works in terminal, fails in the appDesktop apps inherit a different PATH or shellRestart the app after Docker Desktop is running, or set the absolute path
docker: 'mcp' is not a docker commandOld Docker Desktop or MCP Toolkit disabledUpdate Docker Desktop and enable the MCP Toolkit in settings
No tools listedNo servers enabledRun docker mcp server enable <name> and docker mcp tools ls
Tool calls hang about 120 secondsClient timeout while a container image downloads or startsPull images first and warm the server with one test call
Address already in usePort taken by another processChange --port or stop the other process
Auth error on streamingToken mismatchSend the same MCP_GATEWAY_AUTH_TOKEN value from the client
Server enabled but secrets missingCredentials not storedSet them again in the Toolkit or with the secrets command

Fix 1: Is Docker running?

It sounds silly, but it is the top cause. The gateway talks to the Docker daemon, so if Docker Desktop is stopped or still starting, every call fails. Open Docker Desktop, wait for the engine to report running, then restart your client.

Fix 2: Update Docker Desktop

The docker mcp command ships with Docker Desktop's MCP Toolkit. An older build may lack it or show different menus. Update to a current release, open settings, and make sure the MCP Toolkit feature is switched on. Then run docker mcp version to confirm the plugin answers.

Fix 3: Use the absolute path on Windows

A public issue on the gateway repository describes the gateway failing to connect to Claude Desktop on Windows, tested on Docker Desktop 4.62, with the server shown as failed or disconnected. It involved two separate problems, one of them tied to the Microsoft Store edition of the client, which runs in a more restricted environment and may not see the same PATH.

A Windows laptop on a light desk with a USB hub attached

Practical steps that tend to help:

  1. Replace "command": "docker" with the full path to docker.exe, for example one inside C:\Program Files\Docker\Docker\resources\bin\.
  2. If you use the Store version of the client, try the standalone installer version to rule out sandbox limits.
  3. Fully quit the client from the system tray, not only the window, then reopen it.
  4. Check the exact wording of the failure in the client's MCP log, since it names the command it tried to run.

Fix 4: Stop the timeouts

If tools time out after roughly two minutes even though the gateway reports as connected, the first call is often slow because the container image has to be pulled or the server needs time to start. Run the server once from the terminal, let the image finish downloading, and try again. Heavy servers such as browsers need the most warm-up time.

Fix 5: Check secrets and permissions

Servers for GitHub, Notion and similar services need credentials, and a server can look enabled while the token is missing. A report on the Docker forums describes one integration failing while the others worked fine, which usually points to that one server's settings rather than the gateway. Open the server's configuration, re-enter the credential, and confirm that file paths in config.yaml are inside folders Docker is allowed to share.

Fix 6: Read the logs

When the cause is unclear, run the gateway with verbose output:

docker mcp gateway run --verbose

Container logs from docker ps and docker logs <container> show what a failing server printed before it died. Look for the first error, not the last, since later lines are often fallout.

💡 Fast triage: terminal works and app fails means a launch or PATH issue. Terminal fails means Docker, plugin or config issue. Tools list but calls fail means the individual server or its secrets.

Use an LLM to Read the Logs

Gateway errors are often long and noisy, and a language model is good at spotting the one line that matters. Paste the log, your config files with secrets removed, and your OS version, then ask for the most likely cause and a single next step.

An over-the-shoulder view of terminal output being reviewed

Models worth trying

PicassoIA hosts several chat models you can use for this kind of debugging, each suited to a different job:

ModelGood for
Claude Sonnet 5Careful reading of long logs and YAML
GPT 5.6 SolMulti-step coding and shell troubleshooting
Gemini 3.5 FlashFast answers when you iterate quickly
Kimi K2.6Agent and code workflows
Granite 4.1 8BLight, free-style chat and code questions

A prompt that works

Try something like this:

Here is the output of docker mcp gateway run, my OS, and my client config.
The MCP_DOCKER server shows as failed. List the three most likely causes
in order and give one command to test each.

Asking for ordered causes and a test command keeps the answer short and checkable. Always strip tokens and personal paths before pasting anything.

A Reliable Setup Checklist

Once things work, lock the setup in so it stays that way.

  1. Update Docker Desktop and confirm docker mcp version responds.
  2. Enable only the servers you actually use, since each one adds start-up cost.
  3. Store secrets in the Toolkit instead of in your client config.
  4. Pick the transport: stdio for a single local client, streaming for shared use.
  5. Set a token and bind to localhost if you open a port.
  6. Version control your custom catalog and config files.
  7. Test with docker mcp tools ls after every change.

For a team

Run one shared gateway in a container with the config folder mounted, start it with --watch, and publish a single streaming endpoint behind authentication. Everyone then connects to the same endpoint and gets identical tools. Changes to the mounted files reach everybody without anyone reinstalling anything.

Put an LLM to Work Today

You now have the config file locations, the port and transport rules, the cost picture, and a fix list for the failures people hit most. The next time a gateway error appears, copy the log into a chat model and let it point at the likely cause. You can try Claude Sonnet 5, Gemini 3.5 Flash or any other chat model on PicassoIA, and when you want visuals for your own docs or demos, the platform also offers image and video models. Browse the full lineup at picassoia.com/en/all-models, and experiment with a few prompts of your own.

Share this article

Choose your language

FreeCreate AI Images and VideosFree, No Credit CardFree Generations to StartSeedance 2.5 Lite IncludedStart Free Now