Hi Guys!
I’m working on a custom MCP server running as a Docker container in Cursor IDE, but I’m running into an issue. Every time Cursor starts the MCP server, it creates a new container from my Docker image, and the previous containers remain running indefinitely. This leads to multiple orphaned containers piling up on my system.
Here’s my setup:
mcp.json:
{
"mcpServers": {
"fmt ": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"fmt-mcp-server"
]
}
}
}
docker ps:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c76feb7bfd26 fmt-mcp-server "python main.py" 47 seconds ago Up 47 seconds youthful_lovelace
8b6b662455ac fmt-mcp-server "python main.py" 49 seconds ago Up 49 seconds brave_yalow
0d892c19df16 fmt-mcp-server "python main.py" 49 seconds ago Up 49 seconds nifty_haslett
706f068645a1 fmt-mcp-server "python main.py" 17 minutes ago Up 17 minutes unruffled_babbage
24f061bdb4ad fmt-mcp-server "python main.py" 17 minutes ago Up 17 minutes suspicious_euclid
915280bd237e fmt-mcp-server "python main.py" 18 minutes ago Up 18 minutes bold_fermi
thanks