Skip to main content
Glama
mfangtao

SSH MCP Server

by mfangtao
README.md
# SSH MCP Server

[![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen)](https://nodejs.org/)
[![TypeScript](https://img.shields.io/badge/typescript-%3E%3D5.0.0-blue)](https://www.typescriptlang.org/)
[![smithery badge](https://smithery.ai/badge/@mfangtao/mcp-ssh-server)](https://smithery.ai/server/@mfangtao/mcp-ssh-server)

一个基于SSH2和Model Context Protocol (MCP)的SSH服务器,提供远程命令执行功能。

<a href="https://glama.ai/mcp/servers/@mfangtao/mcp-ssh-server">
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@mfangtao/mcp-ssh-server/badge" alt="SSH Server MCP server" />
</a>

## 功能特性

- 通过MCP协议提供SSH远程命令执行工具
- 支持密码和私钥认证
- 返回命令执行结果(stdout/stderr/exit code)
- 基于TypeScript开发,类型安全

## 安装

### Installing via Smithery

To install SSH Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@mfangtao/mcp-ssh-server):

```bash
npx -y @smithery/cli install @mfangtao/mcp-ssh-server --client claude
```

### Manual Installation
```bash
# 克隆仓库
git clone https://github.com/your-repo/ssh-server.git
cd ssh-server

# 安装依赖
npm install

# 构建项目
npm run build
```

## 使用方法

1. 启动服务器:
```bash
npm start
```

2. 通过MCP客户端调用`execute_ssh_command`工具:

请求示例:
```json
{
  "connection": {
    "host": "example.com",
    "port": 22,
    "username": "user",
    "password": "password"  // 或使用 privateKey
  },
  "command": "ls -la"
}
```

## 开发

```bash
# 开发模式
npm run build -- --watch

# 运行测试
# (需要添加测试脚本)
```

## 依赖

- [ssh2](https://github.com/mscdex/ssh2): SSH2客户端/服务器库
- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk): MCP SDK

## 许可证

MIT

TDQS

B3/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly distinct as it is the sole operation available.

Naming Consistency5/5

The single tool name follows a clear verb_noun pattern (execute_ssh_command), and with only one tool, consistency is inherently perfect as there are no other names to compare against.

Tool Count2/5

One tool is too few for a server named 'SSH MCP Server', which implies broader SSH functionality. A single command execution tool feels thin and incomplete for managing SSH connections, lacking operations like file transfer, session management, or configuration.

Completeness2/5

The tool surface is severely incomplete for SSH operations. It only covers command execution, missing essential functions such as scp for file transfer, key management, or connection setup, which are core to SSH workflows and expected from the server's name.

Maintenance

ActivityInactive
ResponsivenessNo issues