synology_project_list
List all Docker Compose projects located in the Synology NAS docker directory, enabling quick overview of deployed stacks for management via SSH.
Instructions
List docker-compose projects in the Synology NAS docker directory
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:221-229 (handler)Handler for synology_project_list tool. Lists docker-compose projects by searching for docker-compose.yml files (maxdepth 2) under NAS_DOCKER_DIR via SSH, then returns the project folder names.
else if (name === "synology_project_list") { const res = await execSshCommand(`find ${shQuote(NAS_DOCKER_DIR)} -maxdepth 2 -name "docker-compose.yml" -exec dirname {} \\;`); if (res.code !== 0) { return { content: [{ type: "text", text: `Failed to search projects: ${res.stderr}` }] }; } const dirs = res.stdout.trim().split("\n").filter(Boolean); const projects = dirs.map((dir) => dir.replace(`${NAS_DOCKER_DIR}/`, "")); return { content: [{ type: "text", text: projects.length > 0 ? `Found projects:\n${projects.join("\n")}\n\nBase directory: ${NAS_DOCKER_DIR}` : `No projects found in ${NAS_DOCKER_DIR}` }] }; } - src/index.ts:147-153 (schema)Tool registration/schema for synology_project_list. No input parameters required; simply lists projects.
name: "synology_project_list", description: "List docker-compose projects in the Synology NAS docker directory", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:111-191 (registration)Tool registration in the ListToolsRequestSchema handler where synology_project_list is declared along with other tools.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "synology_docker_ps", description: "List all docker containers on the Synology NAS", inputSchema: { type: "object", properties: {}, }, }, { name: "synology_docker_logs", description: "Get logs for a specific docker container", inputSchema: { type: "object", properties: { container_name: { type: "string", description: "Name or ID of the container" }, tail: { type: "number", description: "Number of lines to show from the end of the logs", default: 100 }, }, required: ["container_name"], }, }, { name: "synology_docker_manage", description: "Manage container lifecycle (start, stop, restart)", inputSchema: { type: "object", properties: { action: { type: "string", enum: ["start", "stop", "restart", "rm"], description: "Action to perform" }, container_name: { type: "string", description: "Name or ID of the container" }, }, required: ["action", "container_name"], }, }, { name: "synology_project_list", description: "List docker-compose projects in the Synology NAS docker directory", inputSchema: { type: "object", properties: {}, }, }, { name: "synology_project_manage", description: "Manage a docker-compose project (up, down, restart)", inputSchema: { type: "object", properties: { project_name: { type: "string", description: "Name of the project folder in NAS_DOCKER_DIR" }, action: { type: "string", enum: ["up -d", "down", "restart", "pull"], description: "Docker compose action" }, }, required: ["project_name", "action"], }, }, { name: "synology_read_file", description: `Read a configuration file from the NAS (restricted to ${NAS_DOCKER_DIR})`, inputSchema: { type: "object", properties: { filepath: { type: "string", description: `Absolute path to the file on the NAS (must be within ${NAS_DOCKER_DIR})` }, }, required: ["filepath"], }, }, { name: "synology_write_file", description: `Write or update a configuration file on the NAS (restricted to ${NAS_DOCKER_DIR})`, inputSchema: { type: "object", properties: { filepath: { type: "string", description: `Absolute path to the file on the NAS (must be within ${NAS_DOCKER_DIR})` }, content: { type: "string", description: "File content to write" }, }, required: ["filepath", "content"], }, }, ], }; }); - src/index.ts:28-30 (helper)Helper used to safely quote shell arguments when building SSH commands, including the find command in synology_project_list.
function shQuote(s: string): string { return "'" + s.replace(/'/g, "'\\''") + "'"; }