Add system_df and system_prune tools (Gruppe 3)

system_df:
  Assembles disk-usage report from SYNO.Docker.Image/list and
  SYNO.Docker.Container/list. Reports image count/size/reclaimable
  (images not referenced by any container), container running/stopped.
  Gracefully degrades when one API is unavailable.

system_prune:
  Without confirmed=True: lists dangling/unused images and stopped
  containers with sizes (dry-run preview).
  With confirmed=True: calls SYNO.Docker.Utils/prune and reports
  reclaimed space from the response (SpaceReclaimed field).

10 unit tests: stats counts, reclaimable detection, preview content,
confirmed execution, missing-response-field graceful handling, API error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 18:36:49 +02:00
parent a8da306ce5
commit 6bdd2bcb6a
3 changed files with 510 additions and 2 deletions
+4 -2
View File
@@ -26,15 +26,17 @@ def create_server(config: AppConfig, client: DsmClient) -> FastMCP:
"""
mcp = FastMCP("mcp-synology-container")
from mcp_synology_container.modules.projects import register_projects
from mcp_synology_container.modules.containers import register_containers
from mcp_synology_container.modules.compose import register_compose
from mcp_synology_container.modules.containers import register_containers
from mcp_synology_container.modules.images import register_images
from mcp_synology_container.modules.projects import register_projects
from mcp_synology_container.modules.system import register_system
register_projects(mcp, config, client)
register_containers(mcp, config, client)
register_compose(mcp, config, client)
register_images(mcp, config, client)
register_system(mcp, config, client)
logger.info("MCP server configured with all tool modules")
return mcp