什么是 SSH Remote Command Executor?
通过标准化 MCP 接口执行远程 SSH 命令并测试连通性,可用环境变量或远程 UI 安全管理会话。
README
SSH MCP Server
A Model Context Protocol (MCP) server that enables SSH connectivity and remote command execution. This server can run locally to access private networks or via Smithery for public servers.
Features
- ssh_test_connection: Tests connectivity to the configured host and returns hostname
- ssh_run: Executes commands remotely and returns stdout, stderr, and exit code
Installation Methods
Method 1: From Source (For Development)
Best for developers who want to modify the code or contribute to the project.
- Clone and build:
git clone https://github.com/lgariv/ssh-mcp
cd ssh-mcp
npm install
npm run build
- Add to your MCP client config:
{
"mcpServers": {
"ssh-mcp": {
"command": "node",
"args": ["path/to/ssh-mcp/dist/index.js"],
"env": {
"SSH_HOST": "192.168.1.100",
"SSH_PORT": "22",
"SSH_USERNAME": "ubuntu",
"SSH_PASSWORD": "your-password"
}
}
}
}
Method 2: Via NPM Package (Recommended for Local Networks)
Best for accessing servers on your local network (LAN) or private IPs. Runs on your machine.
Add to your MCP client config:
{
"mcpServers": {
"ssh-mcp": {
"command": "npx",
"args": ["-y", "@lgariv/ssh-mcp@latest"],
"env": {
"SSH_HOST": "10.0.0.116",
"SSH_PORT": "22",
"SSH_USERNAME": "admin",
"SSH_PASSWORD": "your-password"
}
}
}
}
Benefits:
- No installation required
- Always uses the latest version
- Can access local network resources (192.168.x.x, 10.x.x.x, etc.)
- Credentials stay on your machine
Method 3: Via Smithery (For Public Servers Only)
Best for accessing publicly accessible SSH servers. Runs on Smithery's infrastructure.
⚠️ Important: This method only works with publicly accessible servers. It cannot access private IPs or LAN resources.
Add to your MCP client config:
{
"mcpServers": {
"ssh-mcp": {
"type": "http",
"url": "https://server.smithery.ai/lgariv/ssh-mcp/mcp",
"config": {
"sshHost": "public.example.com",
"sshPort": 22,
"sshUsername": "ubuntu",
"sshPassword": "your-password"
}
}
}
}
Configuration
All methods require these environment variables or config parameters:
| Parameter | Description | Default |
|---|---|---|
SSH_HOST / sshHost | Target SSH server IP/hostname | Required |
SSH_PORT / sshPort | SSH port number | 22 |
SSH_USERNAME / sshUsername | SSH username | Required |
SSH_PASSWORD / sshPassword | SSH password | Required |
Use Cases by Method
| Use Case | Recommended Method |
|---|---|
| Local home lab servers | Method 2 (NPM) |
| Raspberry Pi on LAN | Method 2 (NPM) |
| Local VMs or containers | Method 2 (NPM) |
| Development and testing | Method 1 (Source) |
| Cloud VPS with public IP | Method 3 (Smithery) |
| Public web servers | Method 3 (Smithery) |
Security Notes
- Methods 1 & 2: Credentials are stored locally in your MCP configuration
- Method 3: Credentials are sent to Smithery's servers (use only with public servers)
- Always use strong passwords and consider SSH keys for production use
- Ensure your MCP configuration file has appropriate permissions
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run built version
npm start
License
ISC
Author
lgariv
常见问题
SSH Remote Command Executor 是什么?
通过标准化 MCP 接口执行远程 SSH 命令并测试连通性,可用环境变量或远程 UI 安全管理会话。
相关 Skills
环境密钥管理
by alirezarezvani
统一梳理dev/staging/prod的.env和密钥流程,自动生成.env.example、校验必填变量、扫描Git历史泄漏,并联动Vault、AWS SSM、1Password、Doppler完成轮换。
✎ 统一管理环境变量、密钥与配置,减少泄露和部署混乱,安全治理与团队协作一起做好,DevOps 场景很省心。
可观测性设计
by alirezarezvani
面向生产系统规划可落地的可观测性体系,串起指标、日志、链路追踪与 SLI/SLO、错误预算、告警和仪表盘设计,适合搭建监控平台与优化故障响应。
✎ 把监控、日志、链路追踪串起来,帮助团队从设计阶段构建可观测性,排障更快、系统演进更稳。
AWS架构师
by alirezarezvani
面向初创团队规划 AWS 架构,覆盖 Serverless、ECS、Aurora 等方案,可生成 CloudFormation 模板,兼顾成本优化、CI/CD 搭建与迁移上云。
✎ 特别适合创业团队,用无服务器模式和 IaC 模板快速搭好 AWS 架构,连成本优化、CI/CD 与迁移路径都能一并规划。
相关 MCP Server
kubefwd
编辑精选by txn2
kubefwd 是让 AI 帮你批量转发 Kubernetes 服务到本地的开发神器。
✎ 微服务开发者最头疼的本地调试问题,它一键搞定——自动分配 IP 避免端口冲突,还能用自然语言查询状态。但依赖 AI 工作流,纯命令行爱好者可能觉得不够直接。
Cloudflare
编辑精选by Cloudflare
Cloudflare MCP Server 是让你用自然语言管理 Workers、KV 和 R2 等云资源的工具。
✎ 这个工具解决了开发者频繁切换控制台和文档的痛点,特别适合那些在 Cloudflare 上部署无服务器应用、需要快速调试或管理配置的团队。不过,由于它依赖多个子服务器,初次设置可能有点繁琐,建议先从 Workers Bindings 这类核心功能入手。
Terraform
编辑精选by hashicorp
Terraform MCP Server 是让 AI 助手直接操作 Terraform Registry 和 HCP Terraform 的桥梁。
✎ 如果你经常在 Terraform 里翻文档找模块配置,这个服务器能省不少时间——直接问 Claude 就能生成准确的代码片段。最适合管理多云基础设施的团队,但注意它目前只适合本地使用,别在生产环境里暴露 HTTP 端点。