Docker-based MCP server not working
Describe the bug
I've tried setting up a Docker-based MCP server on both Windows Terminal and macOS (arm64) iTerm2 and neither one will launch the Docker container or connect to an already running container.
MCP server setup (using /mcp add):
- Server Type:
Local - Command:
docker - Args:
run, -i, --rm, -e API_KEY=<redacted>, ghcr.io/<redacted>/<redacted>-mcp-server:latest - Env vars: none - I'm passing them in the Args
- Tools:
*
When I start a copilot session, it will say:
● Configured MCP servers: <the name of the server I just added>
● Connected to GitHub MCP Server
I've tried a couple variations of this and also by editing the mcp.json file with no success. This same configuration works flawlessly for Copilot Coding Agent or locally in VS Code.
Maybe Docker isn't a supported server type, but I hope it is since it works for coding agent!
Affected version
0.0.228 - 0.0.330
Steps to reproduce the behavior
- Add a Docker-based MCP server via
/mcp add - Start a
copilotsession
Expected behavior
The server should start and/or connect and the tools should be available to Copilot
Additional context
No response
@jcleigh If you use the Docker MCP gateway, then the following works (.copilot / mcp-config.json) for me (though I have issues with GPT-5 model and the JIRA Atlassian MCP server):
{ "mcpServers": { "MCP_DOCKER": { "type": "local", "command": "docker", "tools": [ "*" ], "args": [ "mcp", "gateway", "run" ] } } }
Hi @jcleigh, thanks for reaching out. I tried reproducing this but I couldn't. I set up https://github.com/niik/bell-test-mcp-server as a local Docker image and could call it just fine
ubuntu@ip-172-31-47-165:~/bell-test-mcp-server$ copilot
Welcome to GitHub Copilot CLI
Version 0.0.354 · Commit 076bd172b
● Configured MCP servers: bell
> ring the bell
● I'll ring the bell for you.
✓ ring-the-bell
↪ The bell has been rung 1 times and this time it was answered by Bob.
● The bell has been rung and Bob answered it!
Here's my mcp-config.json
{
"mcpServers": {
"bell": {
"type": "local",
"command": "docker",
"tools": [
"*"
],
"args": [
"run",
"-i",
"--rm",
"bell-mcp-test-server"
]
}
}
}
I do see that you've specified rather old versions of copilot in your issue body (0.0.330 shipped over 2 months ago). Could you please upgrade to the latest version (npm i -g @github/copilot) so that we're both looking at the same thing?
Thank you for your issue! Unfortunately, we are unable to reproduce the issue you are experiencing. Please provide more information so we can help you.
Here are some tips for writing reproduction steps:
- Step by step instructions accompanied by screenshots or screencasts are the best.
- Be as specific as possible; include as much detail as you can.
- If not already provided, include:
- the version of Copilot CLI you are using.
- the operating system you are using
- any environment factors you can think of.
- any custom configuration you are using.
- a log file from the day you experienced the issue (find log
files via
~/.copilot/logs.
- If relevant and can be shared, provide the repository or code you are using.
- If relevant and can be shared, provide the session files (find session files via
~/.copilot/history-session-state).
Note: This is a public repository. Please do not include any sensitive or private information in your issue.
@niik Thanks for reminding me about this issue. I've updated to v0.0.358 and it seems to be working now.
"mcpServers": { "gateway": { "type": "local", "command": "docker", "tools": ["*"], "args": ["mcp", "gateway", "run"], "env": {} } } }
this config doesn't work in copilot cli. Failed to connect to MCP server 'gateway'