返回市场
mcp-ssh服务器

mcp-ssh服务器

作者:mfangtao2 星标更新:2025-06-26

项目介绍

基于SSH2和MCP的SSH服务器

Node.js 版本 TypeScript smithery 徽章

基于SSH2和模型上下文协议(MCP)的SSH服务器,提供远程命令执行功能。

<a href="https://glama.ai/mcp/servers/@mfangtao/mcp-ssh-server"> <img width="380" height="200" src="https://gips3.baidu.com/it/u=2023551341,987655624&fm=3081&app=3081&f=PNG?w=760&h=400" alt="SSH Server MCP 服务器" /> </a>

功能

  • 通过MCP协议提供SSH远程命令执行工具
  • 支持密码和私钥认证
  • 返回命令执行结果(标准输出/错误输出/退出码)
  • 基于TypeScript开发,类型安全

安装

通过Smithery安装

要通过Smithery自动安装SSH服务器到Claude Desktop:

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

手动安装

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

# 安装依赖
npm install

# 构建项目
npm run build

使用说明

  1. 启动服务器:
npm start
  1. 通过MCP客户端调用execute_ssh_command工具:

请求示例:

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

开发

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

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

依赖

许可证

MIT

</中文翻译>