I'm having trouble getting the gemini-cli to recognize the MCP servers listed in the Docker catalog. I've run the command to check the status and it shows that the MCP servers are either ready or disconnected, but I can't seem to access the tools available in the disconnected ones. It works fine on Cursor. Has anyone figured out how to fix this issue?
2 Answers
I tried adding the suggested configuration but it's still not working—running gemini-cli within WSL (Ubuntu 22.04). Here’s how my `~/.gemini/settings.json` looks:
```json
{
"selectedAuthType": "oauth-personal",
"theme": "Ayu",
"mcpServers": {
"desktop-commander": {
"command":"cmd",
"args":[
"/c",
"npx",
"-y",
"@smithery/cli@latest",
"run",
"@wonderwhy-er/desktop-commander",
"--key",
"c2dab..."
]
},
"MCP_DOCKER": {
"command":"docker",
"args":[
"mcp",
"gateway",
"run"
],
"env": {
"LOCALAPPDATA":"/mnt/c/users/pedro/AppData/Local",
"ProgramFiles":"/mnt/c/Program Files"
}
}
}
}
```
Can anyone help with what might be going wrong here?
To connect the gemini-cli with the MCP Toolkit, you’ll need to update your `~/.gemini/settings.json` file. The exact settings depend on which version of the MCP Toolkit you’re using.
If you're using the recent version included in Docker Desktop (version 4.42 or later), your configuration should look like this:
```json
{
"mcpServers": {
"docker-mcp": {
"command": "docker",
"args": [
"mcp",
"gateway",
"run"
]
}
}
}
```
For the older MCP Toolkit running as an extension (which is being phased out), you’ll need:
```json
{
"mcpServers": {
"docker-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"alpine/socat",
"STDIO",
"TCP:host.docker.internal:8811"
]
}
}
}
```
Keep in mind, the Gemini CLI might not always update the tool list automatically, so after modifying the MCP settings, a restart of the gemini-cli is usually necessary to see the new changes.

Related Questions
XML Signature Verifier
Voltage Divider Calculator
SSL Certificate Decoder
SQL Formatter
Online Font Playground to Test Google or Custom Fonts
File Hash Generator Online – Get Instant MD5 and SHA-256 Hashes