2native SSH MCP server
Commit Oct 31, 2026Allows an AI client to execute remote commands and transfer files via SSH while keeping credentials local and secure.
Also known as daidaiJ/2native-ssh-mcp, 2native-ssh-mcp
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- 1.7.0
- Last commit
- Oct 31, 2026
- License
- ISC
What is 2native SSH MCP?
2native SSH allows an AI client to execute remote commands and transfer files via SSH while keeping credentials local and secure.
Summary generated from the project's README
About 2native SSH MCP server
Executing remote commands and transferring files through an AI client is what 2native SSH MCP Server enables for developers managing remote infrastructure. This Go-based implementation allows an AI agent to interact with remote hosts via the Model Context Protocol while ensuring that all SSH credentials, such as passwords or private keys, remain strictly on your local machine and are never exposed to the language model.
Users can connect to servers using various authentication methods including ssh-agent, Pageant, or interactive 2FA challenges. The server provides four specific tools: list-servers, execute-command, session, and file-transfer. It supports complex networking scenarios like connecting through jump hosts using OpenSSH ProxyJump via the via parameter.
To maintain security and manage large data, the server handles ANSI stripping, saves large command outputs to a local directory for later reading, and provides progress notifications for file transfers. It also includes an optional approval mode for destructive commands and maintains an immutable audit log using a SHA-256 hash chain to prevent tampering with command history.
What you can do with it
- 1Secure remote command executionAsk your AI agent to run shell commands on a remote server without sharing your private SSH keys with the model.
Written from the project's README. Every use case is checked against a quote from it.
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachabledaidaij/2native-ssh-mcp is public and reachablegithub.com/daidaij/2native-ssh-mcp ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)ISCspdx.org/licenses/ISC.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-10-31github.com/daidaij/2native-ssh-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHub2native-ssh-mcp
基于 SSH 的 MCP (Model Context Protocol) 服务器,Go 实现。让 AI 助手通过 MCP 协议远程执行命令、传输文件,SSH 凭据完全留在本地,不暴露给模型。
本项目参考了 classfang/ssh-mcp-server(TypeScript 版)的设计与实现,在其基础上用 Go 重写,并将文件操作整合为单个工具、支持进度通知。感谢原作者的开源贡献。
架构
AI 助手只看到四个 MCP 工具;本机进程负责 SSH,凭据不会进入模型上下文。
📖 文档
| 读者 | 文档 | 说明 |
|---|---|---|
| 🤖 AI Agent | docs/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 客户端,无人值守用环境变量兜底)、代理、算法协商(兼容老服务器)→ 认证方式
完整特性列表见 docs/FEATURES.md。
🚀 快速上手
# 构建
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)
2native SSH MCP questions
Are my SSH credentials exposed to the AI model?
No, SSH credentials stay completely local and are not exposed to the model.
How does it handle large command outputs?
Large outputs are saved to a local directory so the Agent can use Read/Grep to check the full content without re-running the command remotely.