UNPKG

mcp-ssh-tool

Version:

Model Context Protocol (MCP) SSH client server for remote automation

46 lines (45 loc) 1.71 kB
import { FileStatInfo, DirListResult } from './types.js'; /** * Reads a file from the remote system */ export declare function readFile(sessionId: string, path: string, encoding?: string): Promise<string>; /** * Writes data to a file on the remote system (atomic operation using temp file) */ export declare function writeFile(sessionId: string, path: string, data: string, mode?: number): Promise<boolean>; /** * Gets file/directory statistics */ export declare function statFile(sessionId: string, path: string): Promise<FileStatInfo>; /** * Lists directory contents with pagination */ export declare function listDirectory(sessionId: string, path: string, page?: number, limit?: number): Promise<DirListResult>; /** * Creates directories recursively (mkdir -p equivalent) */ export declare function makeDirectories(sessionId: string, path: string): Promise<boolean>; /** * Removes files or directories recursively (rm -rf equivalent) */ export declare function removeRecursive(sessionId: string, path: string): Promise<boolean>; /** * Renames/moves a file or directory */ export declare function renameFile(sessionId: string, from: string, to: string): Promise<boolean>; /** * Checks if a path exists on the remote system */ export declare function pathExists(sessionId: string, path: string): Promise<boolean>; /** * Gets the size of a file */ export declare function getFileSize(sessionId: string, path: string): Promise<number>; /** * Checks if a path is a directory */ export declare function isDirectory(sessionId: string, path: string): Promise<boolean>; /** * Checks if a path is a file */ export declare function isFile(sessionId: string, path: string): Promise<boolean>;