list_directory
List contents of a remote directory on a specified server using MCP SSH Tools Server. Provide server name and optional path to access and manage files efficiently via SSH.
Instructions
列出远程目录内容 参数:
server_name: 服务器名称
path: 目录路径,默认为根目录
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | / | |
| server_name | Yes |
Implementation Reference
- main.py:454-462 (handler)The main handler function for the 'list_directory' tool. It is decorated with @mcp.tool(), which likely handles both implementation and registration in the MCP framework. The function executes 'ls -la' on the remote server path using a helper 'execute' function.@mcp.tool() def list_directory(server_name: str, path: str = "/") -> Dict[str, Any]: """ 列出远程目录内容 参数: - server_name: 服务器名称 - path: 目录路径,默认为根目录 """ return execute(server_name, f"ls -la {path}")