docker-mcp
Version:
A Model Context Protocol (MCP) server that enables AI agents to interact with Docker containers locally or remotely via SSH. Provides comprehensive Docker management capabilities including container operations, logs, monitoring, and cleanup.
31 lines • 1.15 kB
JavaScript
import { z } from "zod";
export function registerDockerContainerStop(server, dockerService) {
server.registerTool("docker_container_stop", {
title: "Stop Docker Container",
description: "Stop a running container",
inputSchema: {
containerId: z.string().describe("Container ID or name"),
timeout: z.number().optional().describe("Timeout in seconds (default: 10)")
}
}, async ({ containerId, timeout }) => {
try {
await dockerService.stopContainer(containerId, timeout);
return {
content: [{
type: "text",
text: `Successfully stopped container ${containerId}`
}]
};
}
catch (error) {
return {
content: [{
type: "text",
text: `Error stopping container ${containerId}: ${error instanceof Error ? error.message : String(error)}`
}],
isError: true
};
}
});
}
//# sourceMappingURL=docker_container_stop.js.map