TOOL REFERENCE
每个工具,都有据可查。
33 个统一接口。以下参数直接取自实际 MCP schema,和代码保持一致。
显示 33 个工具
没有匹配的工具。试试「文件」「终端」或工具名。
连接与命令
服务器列表
#ssh_server_listList all available SSH server configurations
无需参数。
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
}连接诊断
#ssh_server_diagnoseDiagnose one SSH connection without exposing credentials: backend, local dependencies, known_hosts, connection and SFTP probes.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
}
}热加载 SSH 配置
#ssh_config_reloadReload the original startup configuration (OpenSSH or JSON), retaining CLI overrides and restrictions. Unchanged ssh2 connections stay open; changed/removed connections and native OpenSSH connections close. Detached terminals retain their original configuration; stop them before changing that configuration. No new connections are opened.
无需参数。
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
}执行命令
#ssh_execExecute a command, a multiline script via stdin, or ordered steps on a connected server. Supports noninteractive sudo, remote-file environment injection and bounded head/tail output. Use ssh_upload for existing local files. Returns structuredContent with exitCode, signal, timedOut, steps and output log metadata, plus legacy text. On actions-only connections use action (fixed administrator-defined executable and arguments); other execution/file/session/forwarding channels are disabled. Unrestricted execution has the SSH account's privileges; regex filters and path checks are not a sandbox. A non-zero exit code is returned as the command's output followed by '[exit code] N' (not as a tool error).
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
resourceKey | string | 可选 |
action | string | 可选 |
env | object | 可选 |
envFromRemoteFiles | object | 可选 |
command | string | 可选 |
script | string | 可选 |
steps | array | 可选 |
stopOnError | boolean | 可选 |
failFast | boolean | 可选 |
interpreter | bash | sh | python3 | 可选 |
sudo | boolean | 可选 |
maxBytes | integer | 65536 |
cwd | string | 可选 |
connectionName | string | 可选 |
timeoutMs | integer | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resourceKey": {
"description": "Cooperative remote account lock; requires flock. Same key serializes participating exec/jobs across MCP processes. Nonblocking conflict exits 75. Unavailable with actions-only or command filters.",
"type": "string",
"pattern": "^[A-Za-z0-9_.:-]{1,100}$"
},
"action": {
"description": "Administrator-defined action name on an actions-only connection. Mutually exclusive with command/script/steps and execution overrides. See ssh_server_list for available actions.",
"type": "string",
"minLength": 1
},
"env": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string"
}
},
"envFromRemoteFiles": {
"description": "Environment variable to absolute remote text-file path. Values are read only remotely; trailing newlines are removed. Requires exec transport. Do not print secrets or enable shell tracing.",
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string",
"format": "starts_with",
"pattern": "^\\/.*"
}
},
"command": {
"description": "Command to execute. Provide exactly one of command, script or steps.",
"type": "string",
"minLength": 1
},
"script": {
"description": "Script sent verbatim to bash, sh or python3 stdin. Requires exec transport. For shell scripts use failFast; Python exits on uncaught exceptions automatically.",
"type": "string",
"minLength": 1
},
"steps": {
"description": "Ordered shell steps sharing cwd and variables. Each step reports its number and exit code. Requires exec transport.",
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"stopOnError": {
"description": "Stop steps on the first error (default: true). If false, continue and return the first failed step's status. Explicit exit/exec can end the shell.",
"type": "boolean"
},
"failFast": {
"description": "Shell script only: enable errexit, plus pipefail for bash (default: false). Omit for python3; normal shell errexit exceptions apply.",
"type": "boolean"
},
"interpreter": {
"description": "Script interpreter (default: bash). python3 runs unbuffered from stdin and must be installed remotely. steps supports only bash/sh.",
"type": "string",
"enum": [
"bash",
"sh",
"python3"
]
},
"sudo": {
"description": "Run through sudo -n -- sh -c. Requires passwordless permission to run the wrapper shell. env/sudo/remote-file injection are unavailable on connections with command filters.",
"type": "boolean"
},
"maxBytes": {
"default": 65536,
"description": "Output payload budget in bytes (default: 65536); status and truncation notices are outside this budget. Keeps a UTF-8-safe head/tail and attempts to save full captured output locally. The connection's maxOutputBytes is a separate hard capture limit.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"cwd": {
"description": "Working directory for command execution",
"type": "string"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"timeoutMs": {
"description": "Command execution timeout in milliseconds (optional; overrides the connection's commandTimeoutMs or shellCommandTimeoutMs, which defaults to 30000ms)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
}
}结构化返回 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connectionName": {
"type": [
"string",
"null"
]
},
"failureStage": {
"anyOf": [
{
"type": "string",
"enum": [
"validation",
"preparation",
"connection",
"channel_open",
"execution"
]
},
{
"type": "null"
}
]
},
"transportDiagnostics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "openssh"
},
"kind": {
"type": "string",
"const": "shared_connection_closed"
},
"message": {
"type": "string"
}
},
"required": [
"source",
"kind",
"message"
],
"additionalProperties": false
}
},
"output": {
"type": "string"
},
"started": {
"type": "boolean"
},
"completed": {
"type": "boolean"
},
"exitCode": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"signal": {
"type": [
"string",
"null"
]
},
"timedOut": {
"type": "boolean"
},
"truncated": {
"type": "boolean"
},
"captureLimitExceeded": {
"type": "boolean"
},
"fullOutputPath": {
"type": [
"string",
"null"
]
},
"outputStorageError": {
"type": [
"string",
"null"
]
},
"steps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"status": {
"type": "string",
"enum": [
"not_started",
"running",
"succeeded",
"failed",
"skipped",
"unknown"
]
},
"exitCode": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"index",
"status",
"exitCode"
],
"additionalProperties": false
}
},
"error": {
"anyOf": [
{
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retriable": {
"type": "boolean"
}
},
"required": [
"code",
"message",
"retriable"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"connectionName",
"failureStage",
"transportDiagnostics",
"output",
"started",
"completed",
"exitCode",
"signal",
"timedOut",
"truncated",
"captureLimitExceeded",
"fullOutputPath",
"outputStorageError",
"steps",
"error"
],
"additionalProperties": false
}多机聚合执行
#ssh_exec_manyRun the same command/script/steps/action on 1–16 explicitly named connections with bounded concurrency. Returns ordered per-host structured results, separate exit codes and full log paths. No fallback target and no automatic retries or rollback. Use concurrency=1 for serial runs; all targets are attempted. Text is a compact summary; full output is in structuredContent.results.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
resourceKey | string | 可选 |
action | string | 可选 |
env | object | 可选 |
envFromRemoteFiles | object | 可选 |
command | string | 可选 |
script | string | 可选 |
steps | array | 可选 |
stopOnError | boolean | 可选 |
failFast | boolean | 可选 |
interpreter | bash | sh | python3 | 可选 |
sudo | boolean | 可选 |
maxBytes | integer | 65536 |
cwd | string | 可选 |
timeoutMs | integer | 可选 |
targets | array | 必填 |
concurrency | integer | 4 |
perTargetTimeoutMs | integer | 10000 |
maxTotalBytes | integer | 65536 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resourceKey": {
"description": "Cooperative remote account lock; requires flock. Same key serializes participating exec/jobs across MCP processes. Nonblocking conflict exits 75. Unavailable with actions-only or command filters.",
"type": "string",
"pattern": "^[A-Za-z0-9_.:-]{1,100}$"
},
"action": {
"description": "Administrator-defined action name on an actions-only connection. Mutually exclusive with command/script/steps and execution overrides. See ssh_server_list for available actions.",
"type": "string",
"minLength": 1
},
"env": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string"
}
},
"envFromRemoteFiles": {
"description": "Environment variable to absolute remote text-file path. Values are read only remotely; trailing newlines are removed. Requires exec transport. Do not print secrets or enable shell tracing.",
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string",
"format": "starts_with",
"pattern": "^\\/.*"
}
},
"command": {
"description": "Command to execute. Provide exactly one of command, script or steps.",
"type": "string",
"minLength": 1
},
"script": {
"description": "Script sent verbatim to bash, sh or python3 stdin. Requires exec transport. For shell scripts use failFast; Python exits on uncaught exceptions automatically.",
"type": "string",
"minLength": 1
},
"steps": {
"description": "Ordered shell steps sharing cwd and variables. Each step reports its number and exit code. Requires exec transport.",
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"stopOnError": {
"description": "Stop steps on the first error (default: true). If false, continue and return the first failed step's status. Explicit exit/exec can end the shell.",
"type": "boolean"
},
"failFast": {
"description": "Shell script only: enable errexit, plus pipefail for bash (default: false). Omit for python3; normal shell errexit exceptions apply.",
"type": "boolean"
},
"interpreter": {
"description": "Script interpreter (default: bash). python3 runs unbuffered from stdin and must be installed remotely. steps supports only bash/sh.",
"type": "string",
"enum": [
"bash",
"sh",
"python3"
]
},
"sudo": {
"description": "Run through sudo -n -- sh -c. Requires passwordless permission to run the wrapper shell. env/sudo/remote-file injection are unavailable on connections with command filters.",
"type": "boolean"
},
"maxBytes": {
"default": 65536,
"description": "Output payload budget in bytes (default: 65536); status and truncation notices are outside this budget. Keeps a UTF-8-safe head/tail and attempts to save full captured output locally. The connection's maxOutputBytes is a separate hard capture limit.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"cwd": {
"description": "Working directory for command execution",
"type": "string"
},
"timeoutMs": {
"description": "Command execution timeout in milliseconds (optional; overrides the connection's commandTimeoutMs or shellCommandTimeoutMs, which defaults to 30000ms)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"targets": {
"minItems": 1,
"maxItems": 16,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"concurrency": {
"default": 4,
"description": "Maximum active targets; use 1 for serial execution. Every target runs even if another fails.",
"type": "integer",
"minimum": 1,
"maximum": 8
},
"perTargetTimeoutMs": {
"default": 10000,
"description": "Independent timeout for each target; a timed-out target releases its concurrency slot while other targets continue.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 86400000
},
"maxTotalBytes": {
"default": 65536,
"description": "Aggregate output payload budget, divided equally between targets. Per-target maxBytes also applies. Metadata and notices are additional.",
"type": "integer",
"minimum": 16,
"maximum": 1048576
}
},
"required": [
"targets"
]
}结构化返回 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"connectionName": {
"type": [
"string",
"null"
]
},
"failureStage": {
"anyOf": [
{
"type": "string",
"enum": [
"validation",
"preparation",
"connection",
"channel_open",
"execution"
]
},
{
"type": "null"
}
]
},
"transportDiagnostics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "openssh"
},
"kind": {
"type": "string",
"const": "shared_connection_closed"
},
"message": {
"type": "string"
}
},
"required": [
"source",
"kind",
"message"
],
"additionalProperties": false
}
},
"output": {
"type": "string"
},
"started": {
"type": "boolean"
},
"completed": {
"type": "boolean"
},
"exitCode": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"signal": {
"type": [
"string",
"null"
]
},
"timedOut": {
"type": "boolean"
},
"truncated": {
"type": "boolean"
},
"captureLimitExceeded": {
"type": "boolean"
},
"fullOutputPath": {
"type": [
"string",
"null"
]
},
"outputStorageError": {
"type": [
"string",
"null"
]
},
"steps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"status": {
"type": "string",
"enum": [
"not_started",
"running",
"succeeded",
"failed",
"skipped",
"unknown"
]
},
"exitCode": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"index",
"status",
"exitCode"
],
"additionalProperties": false
}
},
"error": {
"anyOf": [
{
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retriable": {
"type": "boolean"
}
},
"required": [
"code",
"message",
"retriable"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"connectionName",
"failureStage",
"transportDiagnostics",
"output",
"started",
"completed",
"exitCode",
"signal",
"timedOut",
"truncated",
"captureLimitExceeded",
"fullOutputPath",
"outputStorageError",
"steps",
"error"
],
"additionalProperties": false
}
},
"succeeded": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"failed": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"results",
"succeeded",
"failed"
],
"additionalProperties": false
}文件与搜索
上传文件与目录
#ssh_uploadUpload a file, or a whole directory (recursively; symlinks skipped, max 2000 files), to connected server
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
localPath | string | 必填 |
remotePath | string | 必填 |
timeoutMs | integer | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"localPath": {
"type": "string",
"description": "Local path"
},
"remotePath": {
"type": "string",
"description": "Remote path (POSIX absolute like /home/user/file.txt, or Windows drive-absolute like C:/Users/file.txt)"
},
"timeoutMs": {
"description": "SFTP operation timeout. Large files automatically extend the configured timeout by size; this value is the minimum.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 604800000
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"localPath",
"remotePath"
]
}下载文件与目录
#ssh_downloadDownload a file, or a whole remote directory (recursively; symlinks skipped, max 2000 files), from connected server
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
localPath | string | 必填 |
timeoutMs | integer | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"description": "Remote path (POSIX absolute like /home/user/file.txt, or Windows drive-absolute like C:/Users/file.txt)"
},
"localPath": {
"type": "string",
"description": "Local path"
},
"timeoutMs": {
"description": "SFTP operation timeout. Large files automatically extend the configured timeout by size; this value is the minimum.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 604800000
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"remotePath",
"localPath"
]
}跨主机文件传输
#ssh_file_transferCopy one regular file between two SSH connections through a bounded, backpressured SFTP relay. No local file or file-content tool output. resumable retains partials; retry with transferId verifies the full prefix before appending. Only one writer may own a transferId. Verify destination SHA-256 before atomic publication. Default refuses overwrite; requires OpenSSH hardlink extension (or posix-rename with overwrite=true). A client timeout does not prove publication failed: inspect the destination before retrying.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sourceConnectionName | string | 必填 |
sourcePath | string | 必填 |
destinationConnectionName | string | 必填 |
destinationPath | string | 必填 |
resumable | boolean | false |
transferId | string | 可选 |
overwrite | boolean | false |
maxBytes | integer | 268435456 |
timeoutMs | integer | 60000 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sourceConnectionName": {
"type": "string",
"minLength": 1
},
"sourcePath": {
"type": "string",
"minLength": 1
},
"destinationConnectionName": {
"type": "string",
"minLength": 1
},
"destinationPath": {
"type": "string",
"minLength": 1
},
"resumable": {
"default": false,
"description": "Retain partial temporary file on failure for verified retry",
"type": "boolean"
},
"transferId": {
"description": "Retry an interrupted transfer with the same endpoints/paths; verifies the complete existing prefix before append. Requires exclusive ownership of the partial file.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"overwrite": {
"default": false,
"type": "boolean"
},
"maxBytes": {
"default": 268435456,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1073741824
},
"timeoutMs": {
"default": 60000,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 240000
}
},
"required": [
"sourceConnectionName",
"sourcePath",
"destinationConnectionName",
"destinationPath"
]
}读取文件
#ssh_file_readRead UTF-8 text over SFTP. Select bytes for byte pagination, or lines for numbered lines (up to 4 MiB).
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
connectionName | string | 可选 |
format | bytes | lines | "bytes" |
offsetBytes | integer | 可选 |
maxBytes | integer | 可选 |
startLine | integer | 可选 |
lineCount | integer | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"format": {
"default": "bytes",
"type": "string",
"enum": [
"bytes",
"lines"
]
},
"offsetBytes": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxBytes": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 4194304
},
"startLine": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"lineCount": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 2000
}
},
"required": [
"remotePath"
]
}写入文件
#ssh_file_writeWrite UTF-8 text using mode=create (exclusive, default), overwrite, or append. Parent directory must exist. For an existing local file, use ssh_upload(localPath, remotePath) without reading its contents into the conversation.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
connectionName | string | 可选 |
content | string | 必填 |
mode | create | overwrite | append | "create" |
permissions | integer | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"content": {
"type": "string",
"maxLength": 4194304
},
"mode": {
"default": "create",
"type": "string",
"enum": [
"create",
"overwrite",
"append"
]
},
"permissions": {
"type": "integer",
"minimum": 0,
"maximum": 511
}
},
"required": [
"remotePath",
"content"
]
}精确编辑
#ssh_file_editPreview or apply unique exact text replacements. dryRun returns a bounded unified diff and beforeSha256; expectedSha256 rejects stale previews. backup creates an exclusive private sibling copy before atomic replacement. writeMode=inPlace preserves the existing inode for single-file bind mounts, requires expectedSha256 and always saves a backup; writes are non-atomic and interrupted writes may be partial. Stop competing writers first. Default is atomic.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
edits | array | 必填 |
writeMode | atomic | inPlace | "atomic" |
dryRun | boolean | false |
backup | boolean | false |
expectedSha256 | string | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"edits": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"oldText": {
"type": "string",
"minLength": 1
},
"newText": {
"type": "string"
}
},
"required": [
"oldText",
"newText"
]
}
},
"writeMode": {
"default": "atomic",
"type": "string",
"enum": [
"atomic",
"inPlace"
]
},
"dryRun": {
"default": false,
"type": "boolean"
},
"backup": {
"default": false,
"type": "boolean"
},
"expectedSha256": {
"type": "string",
"pattern": "^[a-fA-F0-9]{64}$"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"remotePath",
"edits"
]
}浏览目录
#ssh_directory_listList a remote directory via SFTP without downloading file contents. Does not traverse subdirectories.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
connectionName | string | 可选 |
includeHidden | boolean | false |
maxResults | integer | 200 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"includeHidden": {
"default": false,
"type": "boolean"
},
"maxResults": {
"default": 200,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 2000
}
},
"required": [
"remotePath"
]
}搜索内容
#ssh_file_grepSearch UTF-8 files using literal text or bounded JavaScript regular expressions, context lines, file lists and counts.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
pattern | string | 必填 |
maxResults | integer | 100 |
exclude | array | 可选 |
includeHidden | boolean | false |
ignoreCase | boolean | false |
connectionName | string | 可选 |
regex | boolean | false |
outputMode | content | files | count | "content" |
contextBefore | integer | 0 |
contextAfter | integer | 0 |
filePattern | string | 可选 |
maxFileBytes | integer | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"pattern": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"maxResults": {
"default": 100,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
},
"exclude": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1000
}
},
"includeHidden": {
"default": false,
"type": "boolean"
},
"ignoreCase": {
"default": false,
"type": "boolean"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"regex": {
"default": false,
"type": "boolean"
},
"outputMode": {
"default": "content",
"type": "string",
"enum": [
"content",
"files",
"count"
]
},
"contextBefore": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 100
},
"contextAfter": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 100
},
"filePattern": {
"type": "string",
"maxLength": 1000
},
"maxFileBytes": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 67108864
}
},
"required": [
"remotePath",
"pattern"
]
}查找路径
#ssh_file_globFind paths with glob stars, globstars, character classes and brace alternatives.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
remotePath | string | 必填 |
pattern | string | 必填 |
maxResults | integer | 100 |
exclude | array | 可选 |
includeHidden | boolean | false |
ignoreCase | boolean | false |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"pattern": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"maxResults": {
"default": 100,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
},
"exclude": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1000
}
},
"includeHidden": {
"default": false,
"type": "boolean"
},
"ignoreCase": {
"default": false,
"type": "boolean"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"remotePath",
"pattern"
]
}同步目录
#ssh_syncSynchronize using SFTP or rsync. Rsync supports block-level delta transfer, deletion, compression and metadata. Preview by default; rsync is required locally and remotely for the rsync engine.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
engine | sftp | rsync | "rsync" |
deleteExtra | boolean | false |
compress | boolean | true |
preservePermissions | boolean | true |
timeoutMs | integer | 可选 |
extraArgs | array | 可选 |
localPath | string | 必填 |
remotePath | string | 必填 |
direction | upload | download | 必填 |
dryRun | boolean | true |
exclude | array | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"engine": {
"default": "rsync",
"type": "string",
"enum": [
"sftp",
"rsync"
]
},
"deleteExtra": {
"default": false,
"type": "boolean"
},
"compress": {
"default": true,
"type": "boolean"
},
"preservePermissions": {
"default": true,
"type": "boolean"
},
"timeoutMs": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"extraArgs": {
"description": "Allowed rsync options: --checksum, --size-only, --ignore-existing, --existing, --update, --prune-empty-dirs, --numeric-ids, --times, --perms, --links, --hard-links, --verbose, --progress, --bwlimit=N",
"type": "array",
"items": {
"type": "string"
}
},
"localPath": {
"type": "string",
"minLength": 1
},
"remotePath": {
"type": "string",
"minLength": 1,
"description": "Absolute remote path"
},
"direction": {
"type": "string",
"enum": [
"upload",
"download"
]
},
"dryRun": {
"default": true,
"type": "boolean"
},
"exclude": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1000
}
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"localPath",
"remotePath",
"direction"
]
}持久终端
创建或复用终端
#ssh_session_ensureOpen a persistent interactive SSH terminal, retained by a detached worker across MCP restarts; stop explicitly to end it. Requires unrestricted command access.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
connectionName | string | 可选 |
shell | string | 可选 |
observerMode | transcript | tmux | "transcript" |
autoClose | boolean | false |
cols | integer | 120 |
rows | integer | 30 |
cwd | string | 可选 |
env | object | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"shell": {
"type": "string",
"minLength": 1
},
"observerMode": {
"default": "transcript",
"type": "string",
"enum": [
"transcript",
"tmux"
]
},
"autoClose": {
"default": false,
"type": "boolean"
},
"cols": {
"default": 120,
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"rows": {
"default": 30,
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"cwd": {
"type": "string",
"minLength": 1
},
"env": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"sessionName"
]
}列出终端
#ssh_session_listList persistent terminals and output cursors.
无需参数。
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
}读取完整日志
#ssh_session_logRead the complete persisted terminal transcript using byte offsets, including after stop.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
offsetBytes | integer | 0 |
maxBytes | integer | 65536 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"offsetBytes": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxBytes": {
"default": 65536,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1048576
}
},
"required": [
"sessionName"
]
}读取终端输出
#ssh_session_readRead terminal output since a character offset. Reports truncation when the bounded transcript has rolled over.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
offsetChars | integer | 0 |
maxChars | integer | 65536 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"offsetChars": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxChars": {
"default": 65536,
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 65536
}
},
"required": [
"sessionName"
]
}调整终端尺寸
#ssh_session_resizeResize a running remote terminal on either backend. The worker must have been started with a version supporting resize. Dimensions on ensure only apply when creating a new terminal.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
cols | integer | 必填 |
rows | integer | 必填 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"cols": {
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"rows": {
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"required": [
"sessionName",
"cols",
"rows"
]
}创建终端
#ssh_session_startOpen a persistent interactive SSH terminal, retained by a detached worker across MCP restarts; stop explicitly to end it. Requires unrestricted command access.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
connectionName | string | 可选 |
shell | string | 可选 |
observerMode | transcript | tmux | "transcript" |
autoClose | boolean | false |
cols | integer | 120 |
rows | integer | 30 |
cwd | string | 可选 |
env | object | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
},
"shell": {
"type": "string",
"minLength": 1
},
"observerMode": {
"default": "transcript",
"type": "string",
"enum": [
"transcript",
"tmux"
]
},
"autoClose": {
"default": false,
"type": "boolean"
},
"cols": {
"default": 120,
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"rows": {
"default": 30,
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"cwd": {
"type": "string",
"minLength": 1
},
"env": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"sessionName"
]
}停止终端
#ssh_session_stopStop a persistent terminal worker; retain its transcript for later reading.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
}
},
"required": [
"sessionName"
]
}发送终端输入
#ssh_session_writeWrite input to a persistent terminal. Include a newline to submit a command; use \u0003 for Ctrl-C.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
sessionName | string | 必填 |
input | string | 必填 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"input": {
"type": "string",
"maxLength": 65536
}
},
"required": [
"sessionName",
"input"
]
}日志维护
清理会话日志
#ssh_session_log_cleanupPreview/remove logs: scope=sessions handles stopped durable sessions, scope=exec handles UUID exec-output logs, and scope=services handles stopped shared-service startup logs. Exec logs are automatically retained for 7 days/512 MiB; service logs are automatically retained for 30 days/64 MiB. Dry-run is enabled by default; active workers and the current service log are skipped.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
scope | sessions | exec | services | "sessions" |
maxAgeDays | number | 可选 |
maxTotalBytes | integer | 可选 |
dryRun | boolean | true |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"scope": {
"default": "sessions",
"description": "sessions preserves existing cleanup; exec handles command output; services handles shared-service startup logs",
"type": "string",
"enum": [
"sessions",
"exec",
"services"
]
},
"maxAgeDays": {
"description": "Retention age: exec defaults to 7 days; sessions and services default to 30 days",
"type": "number",
"minimum": 0,
"maximum": 36500
},
"maxTotalBytes": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"dryRun": {
"default": true,
"type": "boolean"
}
}
}后台任务
停止任务
#ssh_job_killStop a running background job (SIGTERM, then SIGKILL after 5s), including its child processes.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
jobId | string | 必填 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"jobId": {
"type": "string",
"description": "Job id returned by ssh_job_start"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"jobId"
]
}列出任务
#ssh_job_listList recent background jobs on the server with their state. Finished jobs are pruned after 7 days.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
limit | integer | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"limit": {
"description": "Max jobs to list (default 20)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
}
}启动后台任务
#ssh_job_startStart a long-running command in the background on the server and return a job id immediately. Use ssh_job_status to read its output and exit code, ssh_job_kill to stop it. Prefer this over ssh_exec for builds, deploys or anything that may exceed the command timeout.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
resourceKey | string | 可选 |
env | object | 可选 |
command | string | 可选 |
script | string | 可选 |
interpreter | bash | sh | python3 | 可选 |
failFast | boolean | 可选 |
cwd | string | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resourceKey": {
"description": "Remote flock key shared with ssh_exec; contention produces job exit 75, not a retry. Requires flock.",
"type": "string",
"pattern": "^[A-Za-z0-9_.:-]{1,100}$"
},
"env": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"additionalProperties": {
"type": "string"
}
},
"command": {
"description": "Command to run in the background; choose command or script",
"type": "string",
"minLength": 1
},
"script": {
"description": "Multiline source saved verbatim in a private remote job file; never executed through a caller-built quoting layer",
"type": "string",
"minLength": 1
},
"interpreter": {
"type": "string",
"enum": [
"bash",
"sh",
"python3"
]
},
"failFast": {
"description": "Shell scripts only; enable errexit and bash pipefail",
"type": "boolean"
},
"cwd": {
"description": "Working directory for the command",
"type": "string"
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
}
}结构化返回 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connectionName": {
"type": "string"
},
"jobId": {
"type": "string"
},
"state": {
"type": "string"
},
"exitCode": {
"type": [
"number",
"null"
]
},
"pid": {
"type": [
"number",
"null"
]
},
"elapsedSeconds": {
"type": [
"number",
"null"
]
},
"offsetBytes": {
"type": [
"number",
"null"
]
},
"nextOffsetBytes": {
"type": [
"number",
"null"
]
},
"totalBytes": {
"type": [
"number",
"null"
]
},
"output": {
"type": "string"
},
"message": {
"type": "string"
},
"remoteLogPath": {
"type": "string"
},
"remoteLogPathBase": {
"type": "string"
},
"nextAction": {
"type": "string"
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retriable": {
"type": "boolean"
}
},
"required": [
"code",
"message",
"retriable"
],
"additionalProperties": false
}
},
"additionalProperties": false
}查看任务状态
#ssh_job_statusShow state (running/exited/killed/lost), exit code, elapsed time and output of a background job. Without offset it returns the last part of the output; with offset it returns output from that byte, and the reply names the next offset so repeated polling only reads what is new.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
jobId | string | 必填 |
offsetBytes | integer | 可选 |
tailBytes | integer | 可选 |
maxBytes | integer | 可选 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"jobId": {
"type": "string",
"description": "Job id returned by ssh_job_start"
},
"offsetBytes": {
"description": "Byte offset to read output from (optional)",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"tailBytes": {
"description": "Without offset: how many trailing bytes of output to show (default 8192)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"maxBytes": {
"description": "Max bytes of output to return in one call (default 65536)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"jobId"
]
}结构化返回 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connectionName": {
"type": "string"
},
"jobId": {
"type": "string"
},
"state": {
"type": "string"
},
"exitCode": {
"type": [
"number",
"null"
]
},
"pid": {
"type": [
"number",
"null"
]
},
"elapsedSeconds": {
"type": [
"number",
"null"
]
},
"offsetBytes": {
"type": [
"number",
"null"
]
},
"nextOffsetBytes": {
"type": [
"number",
"null"
]
},
"totalBytes": {
"type": [
"number",
"null"
]
},
"output": {
"type": "string"
},
"message": {
"type": "string"
},
"remoteLogPath": {
"type": "string"
},
"remoteLogPathBase": {
"type": "string"
},
"nextAction": {
"type": "string"
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retriable": {
"type": "boolean"
}
},
"required": [
"code",
"message",
"retriable"
],
"additionalProperties": false
}
},
"additionalProperties": false
}端口转发
列出转发
#ssh_forward_listList active port forwards.
无需参数。
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
}反向端口转发
#ssh_forward_reverseForward a TCP port on the SSH server (loopback by default) to a local destination. remotePort=0 chooses a free port.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
bindHost | string | "127.0.0.1" |
localHost | string | "127.0.0.1" |
localPort | integer | 必填 |
remotePort | integer | 0 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"bindHost": {
"default": "127.0.0.1",
"type": "string",
"minLength": 1
},
"localHost": {
"default": "127.0.0.1",
"type": "string"
},
"localPort": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"remotePort": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"localPort"
]
}本地端口转发
#ssh_forward_startForward a local TCP port (loopback by default) to a destination reachable from the SSH server. localPort=0 chooses a free port.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
bindHost | string | "127.0.0.1" |
remoteHost | string | 必填 |
remotePort | integer | 必填 |
localPort | integer | 0 |
connectionName | string | 可选 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"bindHost": {
"default": "127.0.0.1",
"type": "string",
"minLength": 1
},
"remoteHost": {
"type": "string",
"minLength": 1
},
"remotePort": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"localPort": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"connectionName": {
"description": "Configured connection name. Required when multiple connections exist; may be omitted only for a single connection",
"type": "string",
"minLength": 1
}
},
"required": [
"remoteHost",
"remotePort"
]
}停止转发
#ssh_forward_stopStop a port forward and its active sockets.
| 参数 | 类型 | 默认值 / 必填 |
|---|---|---|
forwardId | string | 必填 |
查看完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"forwardId": {
"type": "string"
}
},
"required": [
"forwardId"
]
}