2native SSH MCP Server

io.github.daidaiJPublished by GitHub account daidaiJv1.7.0Updated Oct 27, 2026

SSH-based MCP server for remote command execution and file transfer. Credentials stay local.

Overview

AI-generated overview

Local SSH MCP server that lets an AI assistant run remote commands, manage sessions and transfer files while credentials stay on the machine.

What you can do
  • List configured SSH servers and pick a target host
  • Run remote commands, including long-running background tasks that survive disconnects and can be reattached
  • Manage persistent sessions with lazy connect, keepalive and timeout-based process cleanup
  • Transfer files over SFTP with atomic writes, resume, recursion, sha256 checks and progress notices
  • Large command output is written to local files so the assistant can read or grep it instead of re-running remotely
When to use it
Useful when an assistant needs to operate remote Linux or Unix hosts over SSH — running commands, inspecting output and moving files — without handing SSH credentials to the model. Also fits jump-host setups where internal machines are reached through a bastion.
Requirements
Runs as a local desktop process (stdio, or an optional HTTP daemon) from a platform-specific bundle; no Node.js or Python runtime is needed. Needs a config file or environment variables holding SSH connection details and credentials, plus network access to the target hosts. Supports password, private key, ssh-agent, Pageant and keyboard-interactive 2FA.
Before you install
The assistant can execute arbitrary commands and write or delete files on remote hosts; enable the optional destructive-command approval mode and command/path allow- and blocklists. Approval prompts fail open when the client does not support elicitation. Credentials live in the local config file or environment variables, so protect their permissions. Audit logs are written locally and can be verified for tampering.

Installation

In SourceWeft

  1. Open 2native SSH MCP Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

English

2native-ssh-mcp

[CI] [Release] [Go] [License] [SLSA] [MCP Registry]

[2native-ssh-mcp — Native Go SSH MCP, credentials stay local]

基于 SSH 的 MCP (Model Context Protocol) 服务器,Go 实现。让 AI 助手通过 MCP 协议远程执行命令、传输文件,SSH 凭据完全留在本地,不暴露给模型。

本项目参考了 classfang/ssh-mcp-server(TypeScript 版)的设计与实现,在其基础上用 Go 重写,并将文件操作整合为单个工具、支持进度通知。感谢原作者的开源贡献。

架构

[架构:AI Agent 经 MCP 调用本机 2native-ssh-mcp,再经 SSH 到达远端主机]

AI 助手只看到四个 MCP 工具;本机进程负责 SSH,凭据不会进入模型上下文。

📖 文档

读者文档说明
🤖 AI Agentdocs/AGENT_GUIDE.md省 token 版:工具参数、配置、安全模式、部署命令速查
👤 人类用户docs/HUMAN_GUIDE.md易读版:安全配置、快速开始、工具说明、参数速查、发布流程
🔍 特性详情docs/FEATURES.md完整特性列表与已知限制(英文版 .en.md)
🛠 开发与发布docs/DEVELOPMENT.md项目结构、构建测试、Release 与 MCP Registry 发布流程
🔐 安全SECURITY.md威胁模型、审批闸门、审计落盘策略与分级加固建议

各文档均为中文默认,同名 .en.md 为英文版。

✨ 核心特性

  • 四个工具:list-servers / execute-command / session / file-transfer;后台长任务是 execute-command 的 background: true 特殊模式,不是第五个工具
  • 远程执行:懒连接 + keepalive、超时按远端 PID 杀进程组、默认不分配 PTY、后台任务断连存活可重附着
  • 输出处理:ANSI 剥离、大输出落盘到本地(.ssh-mcp-out/),Agent 用 Read/Grep 查全文,不远程重跑
  • 文件传输:原子落盘、去重、断点续传、目录递归、sha256 校验、进度通知
  • 破坏性命令审批(可选):approvalMode: "ask-destructive" 经 MCP elicitation 弹窗确认,内置分类器 + 用户扩展/豁免,灰色地带用户自定;客户端不支持时 fail-open
  • 防篡改审计日志:每条命令追加进 SHA-256 哈希链(JSONL),事后篡改可定位到行(audit-verify);落盘策略批量/写穿可调 → 审计日志
  • 跳板机隧道:via(OpenSSH ProxyJump)经跳板 direct-tcpip 连内网,各跳独立认证、不转发 agent,exec/shell/SFTP 行为与直连一致 → 跳板机
  • 安全:命令白/黑名单、路径白名单、凭据隔离、配置权限检查
  • 双传输:stdio / streamable HTTP daemon(引用计数、健康检查、Windows 一键自启)
  • 认证兼容:密码/私钥/ssh-agent/Pageant/键盘交互 2FA(挑战弹窗到 MCP 客户端,无人值守用环境变量兜底)、代理、算法协商(兼容老服务器)→ 认证方式

[凭据隔离:SSH 密钥与密码留在本机进程,不会到达模型]

完整特性列表见 docs/FEATURES.md。

🚀 快速上手

bash
# 构建go build -o 2native-ssh-mcp.exe .
# stdio 模式(MCP 客户端拉起,凭据放 config.json 或环境变量)2native-ssh-mcp.exe --config-file config.json
# HTTP 常驻服务2native-ssh-mcp.exe start --config-file config.json --http-addr 127.0.0.1:8338

详细配置与部署步骤见上方两份指南。

License

ISC License(与上游一致,保留上游版权声明,见 LICENSE)

Source: README.md at commit bb0adb9

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.7.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts