@xcud/remote-commander
Version:
MCP server for remote file operations via REST API
48 lines (47 loc) • 1.13 kB
TypeScript
import { ChildProcess } from 'child_process';
import { FilteredStdioServerTransport } from './custom-stdio.js';
declare global {
var mcpTransport: FilteredStdioServerTransport | undefined;
}
export interface ProcessInfo {
pid: number;
command: string;
cpu: string;
memory: string;
}
export interface TerminalSession {
pid: number;
process: ChildProcess;
lastOutput: string;
isBlocked: boolean;
startTime: Date;
}
export interface CommandExecutionResult {
pid: number;
output: string;
isBlocked: boolean;
}
export interface ActiveSession {
pid: number;
isBlocked: boolean;
runtime: number;
}
export interface CompletedSession {
pid: number;
output: string;
exitCode: number | null;
startTime: Date;
endTime: Date;
}
export interface ServerResponseContent {
type: string;
text?: string;
data?: string;
mimeType?: string;
}
export interface ServerResult {
content: ServerResponseContent[];
isError?: boolean;
_meta?: Record<string, unknown>;
}
export type ToolHandler<T = unknown> = (args: T) => Promise<ServerResult>;