Ssh

com.pulsemcp由 pulsemcp.com 发布v0.1.5更新于 Oct 24, 2026

MCP server for SSH remote server management with SSH agent authentication support.

概览

AI 生成的概览

让助手通过 SSH 在远程服务器上执行 shell 命令、用 SFTP 传输文件并浏览目录。

可以做什么
连接到配置好的 SSH 主机,提供执行 shell 命令、通过 SFTP 上传和下载文件、列出远程目录以及查看连接信息的工具。认证可使用 SSH agent 套接字或私钥文件,agent 优先。工具分为 readonly、write 和 admin 三组,可限制启用的组。启动时会做健康检查,验证连通性并给出常见错误提示。
适用场景
适合助手需要操作远程 Linux 或 Unix 服务器的场景,例如查看日志、运行构建或部署、传输文件。也适合用户平时就用 SSH 连接该主机、希望助手做同样事情的工作流。
运行要求
通过 npx 或全局 npm 安装在本机运行,需要 Node.js。必须提供 SSH_HOST 和 SSH_USERNAME;可选配置包括 SSH_PORT、SSH_AUTH_SOCK、SSH_PRIVATE_KEY_PATH、SSH_PASSPHRASE、各类超时、ENABLED_TOOLGROUPS 以及健康检查选项。需要能访问 SSH 主机的网络。仅支持桌面端。
安装前请注意
admin 组包含 ssh_execute,可在远程主机执行任意 shell 命令;write 组可上传文件;若不希望如此,可用 ENABLED_TOOLGROUPS 限制为 readonly。SSH_PASSPHRASE 属于机密,需谨慎处理;使用 agent 认证可避免暴露密钥。ssh://config 资源会暴露连接信息,便于调试。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Ssh,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

SSH MCP Server

An MCP (Model Context Protocol) server for SSH remote server management with SSH agent authentication support.

This server solves a common problem with SSH MCP servers: support for passphrase-protected SSH keys. By using SSH agent authentication, you can securely connect to remote servers without exposing your key passphrase.

Highlights

  • SSH Agent Authentication - Seamlessly works with passphrase-protected SSH keys via SSH agent
  • Private Key File Support - Alternative authentication via direct private key file
  • Startup Health Check - Verifies SSH connectivity on startup with clear error messages
  • Command Execution - Run shell commands on remote servers
  • File Transfer - Upload and download files via SFTP
  • Directory Listing - Browse remote file systems
  • Tool Groups - Control which tools are available (readonly, write, admin)

Authentication Priority

The server supports multiple authentication methods and will use them in this order:

  1. SSH Agent (recommended) - If SSH_AUTH_SOCK is set or auto-detected
  2. Private Key File - If SSH_PRIVATE_KEY_PATH is set

Both methods can be configured simultaneously. If SSH agent authentication is available, it takes priority. The private key file method is used as a fallback or when the agent is not available.

Capabilities

Tools

ToolGroupDescription
ssh_connection_inforeadonly, write, adminGet configured SSH connection information
ssh_list_directoryreadonly, write, adminList directory contents on remote server
ssh_downloadreadonly, write, adminDownload file from remote server via SFTP
ssh_uploadwrite, adminUpload file to remote server via SFTP
ssh_executeadminExecute shell command on remote server

Resources

ResourceDescription
ssh://configSSH connection configuration and status (for debugging)

Tool Groups

Control which tools are available via the ENABLED_TOOLGROUPS environment variable:

GroupDescription
readonlySafe operations (connection info, list, download)
writeFile modifications (upload)
adminFull access including command execution

Examples:

  • ENABLED_TOOLGROUPS="readonly" - Only allow browsing and downloads
  • ENABLED_TOOLGROUPS="readonly,write" - Allow file transfers but no command execution
  • Not set - All tools enabled (default)

Startup Health Check

The server performs an SSH connection health check on startup to verify that the configured credentials and host are valid. This provides immediate feedback if there are configuration issues, rather than discovering them during workflow.

Benefits:

  • Faster feedback: Configuration errors surface at startup rather than mid-workflow
  • Clearer error messages: Startup failures include hints for common issues
  • Improved user experience: Eliminates ambiguity about server operational status

Configuration:

  • SKIP_HEALTH_CHECKS=true - Skip the health check (useful for lazy connection scenarios)
  • HEALTH_CHECK_TIMEOUT=10000 - Customize the health check timeout (default: 10 seconds)

Error hints provided for:

  • Authentication failures (SSH key not loaded, wrong key)
  • Connection timeouts (host unreachable)
  • Connection refused (SSH server not running)
  • DNS resolution errors (invalid hostname)

Quick Start

Installation

bash
npx ssh-agent-mcp-server

Or install globally:

bash
npm install -g ssh-agent-mcp-server

Configuration

Environment Variables
VariableRequiredDescriptionDefault
SSH_HOSTYesHostname or IP address of the SSH server-
SSH_USERNAMEYesUsername for SSH authentication-
SSH_PORTNoSSH port number22
SSH_AUTH_SOCKNoPath to SSH agent socketAuto-detected
SSH_PRIVATE_KEY_PATHNoPath to private key file-
SSH_PASSPHRASENoPassphrase for encrypted private key-
SSH_TIMEOUTNoConnection timeout in milliseconds30000
SSH_COMMAND_TIMEOUTNoDefault command activity timeout in milliseconds60000
ENABLED_TOOLGROUPSNoComma-separated tool groupsAll enabled
SKIP_HEALTH_CHECKSNoSkip SSH connection health check on startupfalse
HEALTH_CHECK_TIMEOUTNoHealth check timeout in milliseconds10000

Claude Desktop Configuration

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{  "mcpServers": {    "ssh": {      "command": "npx",      "args": ["-y", "ssh-agent-mcp-server"],      "env": {        "SSH_HOST": "192.168.1.100",        "SSH_USERNAME": "deploy",        "SSH_AUTH_SOCK": "${SSH_AUTH_SOCK}"      }    }  }}

Restart Claude Desktop and you should be ready to go!

SSH Agent Authentication (Recommended)

SSH agent authentication is the recommended method for passphrase-protected keys:

  1. Ensure your SSH agent is running with your key loaded:

    bash
    # Check if agent is runningssh-add -l
    # If not, add your keyssh-add ~/.ssh/id_ed25519
  2. Pass the SSH_AUTH_SOCK environment variable to the MCP server

The server will automatically use the agent for authentication, and your passphrase-protected key stays secure in the agent.

How It Works

  1. Your passphrase-protected key is loaded into the SSH agent via ssh-add
  2. The agent exposes a Unix socket at $SSH_AUTH_SOCK
  3. This MCP server connects to that socket via the ssh2 library
  4. The agent signs authentication challenges using your decrypted key
  5. Your private key never leaves the agent - the MCP server never sees it

This is more secure than:

  • Storing your passphrase in environment variables
  • Using unprotected private keys
  • Manually entering passphrases

Tool Details

ssh_execute

Execute a command on the remote server.

Parameters:

  • command (required): Shell command to execute
  • cwd (optional): Working directory
  • timeout (optional): Activity timeout in milliseconds (default: 60000 or SSH_COMMAND_TIMEOUT)

Activity-based Timeout:

The timeout is activity-based rather than absolute. It resets whenever stdout or stderr output is received from the command. This allows long-running commands that produce periodic output (like builds, deployments, or claude -p commands) to complete successfully, while still timing out commands that hang with no activity.

For commands with delayed initial output (10-30+ seconds before any output), you can:

  1. Increase the default timeout via SSH_COMMAND_TIMEOUT environment variable
  2. Pass a higher timeout parameter for specific commands

Example:

json
{  "command": "ls -la /var/log",  "cwd": "/home/user"}

Example with extended timeout for long-running commands:

json
{  "command": "npm run build",  "timeout": 300000}

Returns: JSON with stdout, stderr, and exit code

ssh_upload

Upload a file to the remote server via SFTP.

Parameters:

  • localPath (required): Absolute path to local file
  • remotePath (required): Destination path on server

ssh_download

Download a file from the remote server via SFTP.

Parameters:

  • remotePath (required): Path on remote server
  • localPath (required): Local destination path

ssh_list_directory

List directory contents on the remote server.

Parameters:

  • path (required): Directory path to list

Returns: JSON array with filename, type, size, permissions, modified time

ssh_connection_info

Get information about the configured SSH connection.

Returns: JSON with host, port, username, and authentication details

Development

bash
# Install dependenciesnpm run install-all
# Buildnpm run build
# Run in development modenpm run dev
# Run testsnpm testnpm run test:integration

License

MIT

来源:experimental/ssh/README.md,提交 0ed34de

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.5最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分