@supernova123/docker-mcp-server 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tools/container.js
CHANGED
|
@@ -45,6 +45,10 @@ export function registerContainerTools(server, docker) {
|
|
|
45
45
|
return { content: [{ type: "text", text: `Container ${params.container_id} stopped.` }] };
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
|
+
// 304 means container is already stopped — treat as success
|
|
49
|
+
if (error?.statusCode === 304) {
|
|
50
|
+
return { content: [{ type: "text", text: `Container ${params.container_id} was already stopped.` }] };
|
|
51
|
+
}
|
|
48
52
|
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
49
53
|
}
|
|
50
54
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supernova123/docker-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"mcpName": "io.github.friendlygeorge/docker-mcp-server",
|
|
5
|
-
"description": "MCP server for Docker
|
|
5
|
+
"description": "MCP server for Docker — container management, health checks, auto-restart, Compose lifecycle, and log streaming for Claude, Cursor, and AI agents",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"bin": {
|
|
@@ -17,20 +17,20 @@
|
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"mcp",
|
|
20
|
+
"mcp-server",
|
|
20
21
|
"docker",
|
|
22
|
+
"docker-mcp",
|
|
21
23
|
"container",
|
|
22
24
|
"compose",
|
|
23
25
|
"health-check",
|
|
24
26
|
"devops",
|
|
25
27
|
"ai-agent",
|
|
26
28
|
"model-context-protocol",
|
|
27
|
-
"mcp-server",
|
|
28
|
-
"modelcontextprotocol",
|
|
29
29
|
"claude",
|
|
30
30
|
"cursor",
|
|
31
31
|
"chatgpt",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"claude-desktop",
|
|
33
|
+
"ai"
|
|
34
34
|
],
|
|
35
35
|
"author": "Nova",
|
|
36
36
|
"license": "MIT",
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
"typescript": "^5.7.0",
|
|
54
54
|
"vitest": "^3.1.0"
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|
package/src/tools/container.ts
CHANGED
|
@@ -74,7 +74,11 @@ export function registerContainerTools(server: McpServer, docker: Dockerode): vo
|
|
|
74
74
|
const container = docker.getContainer(params.container_id);
|
|
75
75
|
await container.stop({ t: params.timeout ?? 10 });
|
|
76
76
|
return { content: [{ type: "text", text: `Container ${params.container_id} stopped.` }] };
|
|
77
|
-
} catch (error) {
|
|
77
|
+
} catch (error: any) {
|
|
78
|
+
// 304 means container is already stopped — treat as success
|
|
79
|
+
if (error?.statusCode === 304) {
|
|
80
|
+
return { content: [{ type: "text", text: `Container ${params.container_id} was already stopped.` }] };
|
|
81
|
+
}
|
|
78
82
|
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
79
83
|
}
|
|
80
84
|
}
|