mcp-server-docker 1.0.0
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/README.md +133 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -0
- package/mcp-config.json +9 -0
- package/package.json +49 -0
package/README.md
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
# MCP Server: Docker Command Runner
|
2
|
+
|
3
|
+
This MCP (Model Context Protocol) server provides a secure interface for running commands inside Docker containers. It acts as a privileged sidecar that can execute arbitrary commands within specified Docker Compose service containers.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
|
7
|
+
- STDIO-based MCP transport for integration with Claude and other MCP clients
|
8
|
+
- Execute commands in any Docker Compose service container
|
9
|
+
- Real-time capture of stdout/stderr output
|
10
|
+
- Secure container allowlist configuration
|
11
|
+
- Configurable timeouts for long-running commands
|
12
|
+
- Clear error messages for common Docker issues
|
13
|
+
- Minimal dependencies and secure by design
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
### Via NPX (Recommended)
|
18
|
+
|
19
|
+
Run the MCP server directly without cloning:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
npx mcp-server-docker
|
23
|
+
```
|
24
|
+
|
25
|
+
Or install globally:
|
26
|
+
|
27
|
+
```bash
|
28
|
+
npm install -g mcp-server-docker
|
29
|
+
mcp-server-docker
|
30
|
+
```
|
31
|
+
|
32
|
+
### As a Docker Service
|
33
|
+
|
34
|
+
Add the following to your `docker-compose.yml`:
|
35
|
+
|
36
|
+
```yaml
|
37
|
+
services:
|
38
|
+
mcp-docker:
|
39
|
+
build: ./mcp-server-docker
|
40
|
+
volumes:
|
41
|
+
- /var/run/docker.sock:/var/run/docker.sock
|
42
|
+
ports:
|
43
|
+
- "3001:3000" # Expose MCP server
|
44
|
+
environment:
|
45
|
+
- COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
|
46
|
+
- DEFAULT_SERVICE=app
|
47
|
+
- COMPOSE_FILE=docker-compose.yml
|
48
|
+
- PORT=3000
|
49
|
+
networks:
|
50
|
+
- your-network
|
51
|
+
```
|
52
|
+
|
53
|
+
### For Local Development
|
54
|
+
|
55
|
+
```bash
|
56
|
+
cd mcp-server-docker
|
57
|
+
npm install
|
58
|
+
npm run build
|
59
|
+
```
|
60
|
+
|
61
|
+
## Configuration
|
62
|
+
|
63
|
+
The server accepts the following environment variables:
|
64
|
+
|
65
|
+
- `ALLOWED_CONTAINERS`: Comma-separated list of allowed service:container pairs (e.g., "app:myapp_container,db:mydb_container")
|
66
|
+
- `DEFAULT_SERVICE`: Default service to run commands in (default: "laravel_app")
|
67
|
+
- `COMMAND_TIMEOUT`: Command timeout in milliseconds (default: 300000)
|
68
|
+
|
69
|
+
## MCP Tool: run_command
|
70
|
+
|
71
|
+
The server exposes a single tool called `run_command`:
|
72
|
+
|
73
|
+
### Input Schema
|
74
|
+
|
75
|
+
```json
|
76
|
+
{
|
77
|
+
"command": "string (required) - The command to execute",
|
78
|
+
"service": "string (optional) - Docker service name"
|
79
|
+
}
|
80
|
+
```
|
81
|
+
|
82
|
+
### Example Usage
|
83
|
+
|
84
|
+
```json
|
85
|
+
{
|
86
|
+
"command": "npm test",
|
87
|
+
"service": "frontend"
|
88
|
+
}
|
89
|
+
```
|
90
|
+
|
91
|
+
### Response Format
|
92
|
+
|
93
|
+
The tool returns the command output with the following structure:
|
94
|
+
- Standard output (if any)
|
95
|
+
- Standard error (if any, prefixed with [stderr])
|
96
|
+
- Exit code
|
97
|
+
|
98
|
+
## Usage
|
99
|
+
|
100
|
+
The server uses STDIO transport for MCP communication. When run with `npx mcp-server-docker`, it will:
|
101
|
+
|
102
|
+
1. Parse environment variables for allowed containers
|
103
|
+
2. Start the MCP server listening on stdin/stdout
|
104
|
+
3. Log startup information to stderr
|
105
|
+
4. Wait for MCP protocol messages
|
106
|
+
|
107
|
+
## Security Notes
|
108
|
+
|
109
|
+
- This server requires access to the Docker socket - ensure Docker is running and accessible
|
110
|
+
- No command filtering is applied - relies on container isolation for security
|
111
|
+
- Commands timeout after 5 minutes by default
|
112
|
+
- Only allowed containers (configured via ALLOWED_CONTAINERS) can be accessed
|
113
|
+
|
114
|
+
## Development
|
115
|
+
|
116
|
+
```bash
|
117
|
+
# Run in development mode
|
118
|
+
npm run dev
|
119
|
+
|
120
|
+
# Build TypeScript
|
121
|
+
npm run build
|
122
|
+
|
123
|
+
# Run tests
|
124
|
+
npm test
|
125
|
+
```
|
126
|
+
|
127
|
+
## Troubleshooting
|
128
|
+
|
129
|
+
### Common Errors
|
130
|
+
|
131
|
+
1. **"Cannot connect to Docker daemon"**: Ensure Docker is running and the socket is mounted
|
132
|
+
2. **"Service not found"**: Check that the service name exists in your docker-compose.yml
|
133
|
+
3. **"Command timed out"**: Command exceeded 5-minute timeout, consider breaking it into smaller operations
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
5
|
+
import { spawn } from "child_process";
|
6
|
+
import * as dotenv from "dotenv";
|
7
|
+
dotenv.config();
|
8
|
+
// Parse allowed containers from environment variable
|
9
|
+
// Format: "service1:container1,service2:container2"
|
10
|
+
function parseAllowedContainers() {
|
11
|
+
const allowedStr = process.env.ALLOWED_CONTAINERS || "";
|
12
|
+
const containers = {};
|
13
|
+
if (allowedStr) {
|
14
|
+
const pairs = allowedStr.split(',');
|
15
|
+
for (const pair of pairs) {
|
16
|
+
const [service, container] = pair.split(':');
|
17
|
+
if (service && container) {
|
18
|
+
containers[service.trim()] = container.trim();
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
// Return default if no containers specified
|
23
|
+
if (Object.keys(containers).length === 0) {
|
24
|
+
console.error("Warning: No allowed containers specified in ALLOWED_CONTAINERS environment variable");
|
25
|
+
return {
|
26
|
+
"laravel_app": "laravel_app_dev"
|
27
|
+
};
|
28
|
+
}
|
29
|
+
return containers;
|
30
|
+
}
|
31
|
+
const ALLOWED_CONTAINERS = parseAllowedContainers();
|
32
|
+
const DEFAULT_TIMEOUT = parseInt(process.env.COMMAND_TIMEOUT || "300000");
|
33
|
+
const DEFAULT_SERVICE = process.env.DEFAULT_SERVICE || "laravel_app";
|
34
|
+
async function runDockerCommand(command, service) {
|
35
|
+
const targetService = service || DEFAULT_SERVICE;
|
36
|
+
// Check if the service is allowed
|
37
|
+
if (!ALLOWED_CONTAINERS[targetService]) {
|
38
|
+
throw new Error(`Service '${targetService}' is not allowed. Allowed services: ${Object.keys(ALLOWED_CONTAINERS).join(', ')}`);
|
39
|
+
}
|
40
|
+
const containerName = ALLOWED_CONTAINERS[targetService];
|
41
|
+
// Build docker exec command
|
42
|
+
const dockerArgs = ["exec", containerName, "sh", "-c", command];
|
43
|
+
return new Promise((resolve, reject) => {
|
44
|
+
// Use docker directly
|
45
|
+
const dockerProcess = spawn("docker", dockerArgs);
|
46
|
+
let stdout = "";
|
47
|
+
let stderr = "";
|
48
|
+
// Set timeout
|
49
|
+
const timeout = setTimeout(() => {
|
50
|
+
dockerProcess.kill();
|
51
|
+
reject(new Error(`Command timed out after ${DEFAULT_TIMEOUT}ms`));
|
52
|
+
}, DEFAULT_TIMEOUT);
|
53
|
+
dockerProcess.stdout.on("data", (data) => {
|
54
|
+
stdout += data.toString();
|
55
|
+
});
|
56
|
+
dockerProcess.stderr.on("data", (data) => {
|
57
|
+
stderr += data.toString();
|
58
|
+
});
|
59
|
+
dockerProcess.on("close", (code) => {
|
60
|
+
clearTimeout(timeout);
|
61
|
+
resolve({
|
62
|
+
stdout,
|
63
|
+
stderr,
|
64
|
+
exitCode: code || 0,
|
65
|
+
});
|
66
|
+
});
|
67
|
+
dockerProcess.on("error", (error) => {
|
68
|
+
clearTimeout(timeout);
|
69
|
+
reject(error);
|
70
|
+
});
|
71
|
+
});
|
72
|
+
}
|
73
|
+
// Create server instance
|
74
|
+
const server = new Server({
|
75
|
+
name: "mcp-server-docker",
|
76
|
+
version: "1.0.0",
|
77
|
+
}, {
|
78
|
+
capabilities: {
|
79
|
+
tools: {},
|
80
|
+
},
|
81
|
+
});
|
82
|
+
// Handler for listing available tools
|
83
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
84
|
+
return {
|
85
|
+
tools: [
|
86
|
+
{
|
87
|
+
name: "run_command",
|
88
|
+
description: "Execute a command inside a Docker container service",
|
89
|
+
inputSchema: {
|
90
|
+
type: "object",
|
91
|
+
properties: {
|
92
|
+
command: {
|
93
|
+
type: "string",
|
94
|
+
description: "The command to execute in the container",
|
95
|
+
},
|
96
|
+
service: {
|
97
|
+
type: "string",
|
98
|
+
description: `Docker Compose service name (optional, uses default: ${DEFAULT_SERVICE} if not specified)`,
|
99
|
+
},
|
100
|
+
},
|
101
|
+
required: ["command"],
|
102
|
+
},
|
103
|
+
},
|
104
|
+
],
|
105
|
+
};
|
106
|
+
});
|
107
|
+
// Handler for tool execution
|
108
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
109
|
+
if (request.params.name !== "run_command") {
|
110
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
111
|
+
}
|
112
|
+
const { command, service } = request.params.arguments;
|
113
|
+
if (!command) {
|
114
|
+
throw new Error("Command is required");
|
115
|
+
}
|
116
|
+
try {
|
117
|
+
const result = await runDockerCommand(command, service);
|
118
|
+
// Format the response
|
119
|
+
let response = "";
|
120
|
+
if (result.stdout) {
|
121
|
+
response += result.stdout;
|
122
|
+
}
|
123
|
+
if (result.stderr) {
|
124
|
+
if (response)
|
125
|
+
response += "\n\n";
|
126
|
+
response += `[stderr]\n${result.stderr}`;
|
127
|
+
}
|
128
|
+
response += `\n\nExit code: ${result.exitCode}`;
|
129
|
+
return {
|
130
|
+
content: [
|
131
|
+
{
|
132
|
+
type: "text",
|
133
|
+
text: response,
|
134
|
+
},
|
135
|
+
],
|
136
|
+
};
|
137
|
+
}
|
138
|
+
catch (error) {
|
139
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
140
|
+
// Provide helpful error messages for common issues
|
141
|
+
if (errorMessage.includes("No such service")) {
|
142
|
+
throw new Error(`Service '${service || DEFAULT_SERVICE}' not found. Available services can be listed with 'docker compose ps'.`);
|
143
|
+
}
|
144
|
+
else if (errorMessage.includes("Cannot connect to the Docker daemon")) {
|
145
|
+
throw new Error("Cannot connect to Docker daemon. Ensure Docker is running and the socket is mounted.");
|
146
|
+
}
|
147
|
+
else if (errorMessage.includes("timed out")) {
|
148
|
+
throw new Error(`Command timed out after ${DEFAULT_TIMEOUT / 1000} seconds. Consider running shorter commands or increasing the timeout.`);
|
149
|
+
}
|
150
|
+
throw new Error(`Failed to execute command: ${errorMessage}`);
|
151
|
+
}
|
152
|
+
});
|
153
|
+
// Start the server using stdio transport
|
154
|
+
async function main() {
|
155
|
+
const transport = new StdioServerTransport();
|
156
|
+
await server.connect(transport);
|
157
|
+
console.error("MCP Server Docker started");
|
158
|
+
console.error(`Default service: ${DEFAULT_SERVICE}`);
|
159
|
+
console.error(`Allowed containers: ${Object.keys(ALLOWED_CONTAINERS).join(', ')}`);
|
160
|
+
}
|
161
|
+
main().catch((error) => {
|
162
|
+
console.error("Failed to start server:", error);
|
163
|
+
process.exit(1);
|
164
|
+
});
|
165
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE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AC,QAAQ,CAAC,qCAAqC,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;QACJ,CAAC;aAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CACb,2BAA2B,eAAe,GAAG,IAAI,wEAAwE,CAC1H,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,8BAA8B,YAAY,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,yCAAyC;AACzC,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC3C,OAAO,CAAC,KAAK,CAAC,oBAAoB,eAAe,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,KAAK,CAAC,uBAAuB,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/mcp-config.json
ADDED
package/package.json
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
{
|
2
|
+
"name": "mcp-server-docker",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "MCP server for executing commands in Docker containers",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"type": "module",
|
7
|
+
"bin": {
|
8
|
+
"mcp-server-docker": "dist/index.js"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"build": "tsc",
|
12
|
+
"dev": "tsx src/index.ts",
|
13
|
+
"start": "node dist/index.js",
|
14
|
+
"test": "jest",
|
15
|
+
"prepublishOnly": "npm run build"
|
16
|
+
},
|
17
|
+
"files": [
|
18
|
+
"dist/**/*",
|
19
|
+
"mcp-config.json",
|
20
|
+
"README.md",
|
21
|
+
"LICENSE"
|
22
|
+
],
|
23
|
+
"keywords": ["mcp", "docker", "model-context-protocol", "cli", "container"],
|
24
|
+
"author": "adamdude828",
|
25
|
+
"homepage": "https://github.com/adamdude828/mcp-server-docker#readme",
|
26
|
+
"repository": {
|
27
|
+
"type": "git",
|
28
|
+
"url": "git+https://github.com/adamdude828/mcp-server-docker.git"
|
29
|
+
},
|
30
|
+
"bugs": {
|
31
|
+
"url": "https://github.com/adamdude828/mcp-server-docker/issues"
|
32
|
+
},
|
33
|
+
"license": "MIT",
|
34
|
+
"dependencies": {
|
35
|
+
"@modelcontextprotocol/sdk": "^0.6.0",
|
36
|
+
"dotenv": "^16.4.5",
|
37
|
+
"express": "^4.18.2",
|
38
|
+
"uuid": "^9.0.1"
|
39
|
+
},
|
40
|
+
"devDependencies": {
|
41
|
+
"@types/node": "^20.11.0",
|
42
|
+
"@types/express": "^4.17.21",
|
43
|
+
"@types/uuid": "^9.0.7",
|
44
|
+
"tsx": "^4.7.0",
|
45
|
+
"typescript": "^5.3.3",
|
46
|
+
"jest": "^29.7.0",
|
47
|
+
"@types/jest": "^29.5.11"
|
48
|
+
}
|
49
|
+
}
|