list_directory
Lists contents of remote directories via SSH to view files and folders on servers. Specify server name and optional path to browse remote file systems.
Instructions
列出远程目录内容 参数:
server_name: 服务器名称
path: 目录路径,默认为根目录
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_name | Yes | ||
| path | No | / |
Implementation Reference
- main.py:454-462 (handler)The handler function for the 'list_directory' tool. It executes the 'ls -la' command on the remote server using the 'execute' tool to list directory contents.@mcp.tool() def list_directory(server_name: str, path: str = "/") -> Dict[str, Any]: """ 列出远程目录内容 参数: - server_name: 服务器名称 - path: 目录路径,默认为根目录 """ return execute(server_name, f"ls -la {path}")