@yawlabs/ssh-mcp 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -213
- package/dist/index.js +791 -679
- package/dist/server.d.ts +44 -40
- package/dist/server.js +255 -152
- package/package.json +61 -61
package/dist/server.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare function formatDiagnostics(host: string): string;
|
|
|
24
24
|
declare function connectRaw(connectConfig: ConnectConfig): Promise<Client>;
|
|
25
25
|
declare function connectWithProxy(resolved: ResolvedConfig): Promise<Client>;
|
|
26
26
|
declare function connect(config: SSHConfig): Promise<Client>;
|
|
27
|
-
declare function exec(client: Client, command: string, timeoutMs?: number): Promise<ExecResult>;
|
|
27
|
+
declare function exec(client: Client, command: string, timeoutMs?: number, maxBytes?: number): Promise<ExecResult>;
|
|
28
28
|
declare function readFile(client: Client, remotePath: string, maxBytes?: number): Promise<string>;
|
|
29
29
|
declare function writeFile(client: Client, remotePath: string, content: string): Promise<void>;
|
|
30
30
|
declare function uploadFile(client: Client, localPath: string, remotePath: string): Promise<void>;
|
|
@@ -39,8 +39,10 @@ interface PoolOptions {
|
|
|
39
39
|
}
|
|
40
40
|
declare class ConnectionPool {
|
|
41
41
|
private entries;
|
|
42
|
+
private pending;
|
|
42
43
|
private idleTtlMs;
|
|
43
44
|
private maxPoolSize;
|
|
45
|
+
private _connectCount;
|
|
44
46
|
constructor(options?: PoolOptions);
|
|
45
47
|
acquire(config: SSHConfig): Promise<Client>;
|
|
46
48
|
release(client: Client): void;
|
|
@@ -51,10 +53,10 @@ declare class ConnectionPool {
|
|
|
51
53
|
active: number;
|
|
52
54
|
idle: number;
|
|
53
55
|
};
|
|
56
|
+
/** Total number of successful SSH connects made by this pool since construction. */
|
|
57
|
+
get connectCount(): number;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
declare function registerTools(server: McpServer, pool?: ConnectionPool): void;
|
|
57
|
-
|
|
58
60
|
interface DiagnosticResult {
|
|
59
61
|
status: "ok" | "warning" | "error";
|
|
60
62
|
message: string;
|
|
@@ -73,43 +75,6 @@ declare function checkConnectivity(host: string, port?: number): DiagnosticResul
|
|
|
73
75
|
declare function checkSshConfig(host: string): DiagnosticResult;
|
|
74
76
|
declare function diagnose(host: string, port?: number): DiagnosticReport;
|
|
75
77
|
|
|
76
|
-
interface MultiExecResult {
|
|
77
|
-
host: string;
|
|
78
|
-
stdout: string;
|
|
79
|
-
stderr: string;
|
|
80
|
-
code: number;
|
|
81
|
-
error?: string;
|
|
82
|
-
}
|
|
83
|
-
interface MultiExecHost {
|
|
84
|
-
host: string;
|
|
85
|
-
port?: number;
|
|
86
|
-
username?: string;
|
|
87
|
-
privateKeyPath?: string;
|
|
88
|
-
password?: string;
|
|
89
|
-
}
|
|
90
|
-
declare function multiExec(pool: ConnectionPool, hosts: MultiExecHost[], command: string, timeoutMs?: number): Promise<MultiExecResult[]>;
|
|
91
|
-
interface FindOptions {
|
|
92
|
-
path: string;
|
|
93
|
-
name?: string;
|
|
94
|
-
type?: "f" | "d" | "l";
|
|
95
|
-
maxdepth?: number;
|
|
96
|
-
minsize?: string;
|
|
97
|
-
maxsize?: string;
|
|
98
|
-
newer?: string;
|
|
99
|
-
}
|
|
100
|
-
declare function find(client: Client, options: FindOptions, timeoutMs?: number): Promise<string[]>;
|
|
101
|
-
declare function tail(client: Client, path: string, lines?: number, grep?: string, timeoutMs?: number): Promise<string>;
|
|
102
|
-
interface ServiceStatus {
|
|
103
|
-
name: string;
|
|
104
|
-
active: boolean;
|
|
105
|
-
status: string;
|
|
106
|
-
description?: string;
|
|
107
|
-
since?: string;
|
|
108
|
-
pid?: number;
|
|
109
|
-
raw: string;
|
|
110
|
-
}
|
|
111
|
-
declare function serviceStatus(client: Client, serviceName: string, timeoutMs?: number): Promise<ServiceStatus>;
|
|
112
|
-
|
|
113
78
|
interface KeyInfo {
|
|
114
79
|
name: string;
|
|
115
80
|
path: string;
|
|
@@ -163,6 +128,45 @@ declare function testConnection(host: string, port?: number): {
|
|
|
163
128
|
message: string;
|
|
164
129
|
};
|
|
165
130
|
|
|
131
|
+
interface MultiExecResult {
|
|
132
|
+
host: string;
|
|
133
|
+
stdout: string;
|
|
134
|
+
stderr: string;
|
|
135
|
+
code: number;
|
|
136
|
+
error?: string;
|
|
137
|
+
}
|
|
138
|
+
interface MultiExecHost {
|
|
139
|
+
host: string;
|
|
140
|
+
port?: number;
|
|
141
|
+
username?: string;
|
|
142
|
+
privateKeyPath?: string;
|
|
143
|
+
password?: string;
|
|
144
|
+
}
|
|
145
|
+
declare function multiExec(pool: ConnectionPool, hosts: MultiExecHost[], command: string, timeoutMs?: number): Promise<MultiExecResult[]>;
|
|
146
|
+
interface FindOptions {
|
|
147
|
+
path: string;
|
|
148
|
+
name?: string;
|
|
149
|
+
type?: "f" | "d" | "l";
|
|
150
|
+
maxdepth?: number;
|
|
151
|
+
minsize?: string;
|
|
152
|
+
maxsize?: string;
|
|
153
|
+
newer?: string;
|
|
154
|
+
}
|
|
155
|
+
declare function find(client: Client, options: FindOptions, timeoutMs?: number): Promise<string[]>;
|
|
156
|
+
declare function tail(client: Client, path: string, lines?: number, grep?: string, timeoutMs?: number): Promise<string>;
|
|
157
|
+
interface ServiceStatus {
|
|
158
|
+
name: string;
|
|
159
|
+
active: boolean;
|
|
160
|
+
status: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
since?: string;
|
|
163
|
+
pid?: number;
|
|
164
|
+
raw: string;
|
|
165
|
+
}
|
|
166
|
+
declare function serviceStatus(client: Client, serviceName: string, timeoutMs?: number): Promise<ServiceStatus>;
|
|
167
|
+
|
|
168
|
+
declare function registerTools(server: McpServer, pool?: ConnectionPool): void;
|
|
169
|
+
|
|
166
170
|
declare function createServer(pool?: ConnectionPool): McpServer;
|
|
167
171
|
|
|
168
172
|
export { type AgentResult, type ConfigLookupResult, ConnectionPool, type DiagnosticReport, type DiagnosticResult, type ExecResult, type FindOptions, type KeyInfo, type MultiExecHost, type MultiExecResult, type PoolOptions, type ResolvedConfig, type SSHConfig, type ServiceStatus, checkConnectivity, checkGitSsh, checkKnownHosts, checkSshAgent, checkSshConfig, checkSshKeys, configLookup, connect, connectRaw, connectWithProxy, createServer, diagnose, downloadFile, ensureAgent, exec, find, fixKnownHosts, formatDiagnostics, listDir, listSshKeys, loadKey, multiExec, readFile, readKnownHostsKeys, registerTools, resolveConfig, serviceStatus, tail, testConnection, uploadFile, writeFile };
|