1. Conduid
  2. AI
  3. io.github.Echoqili/ssh-licco
MCP server · AI

io.github.Echoqili/ssh-licco

SSH Model Context Protocol Server - Connect to SSH servers and execute commands via AI assistants.

Unclaimed ai
37Low

Scored 7 months ago · breakdown

About io.github.Echoqili/ssh-licco

io.github.Echoqili/ssh-licco is an MCP server published by Echoqili in the AI category: sSH Model Context Protocol Server - Connect to SSH servers and execute commands via AI assistants.

The repository has 4 stars and 0 forks, with the last commit 13 days ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

uvx
uvx ssh-licco
pip
pip install ssh-licco

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about io.github.Echoqili/ssh-licco

Powered by Claude · Grounded in docs

I know everything about io.github.Echoqili/ssh-licco. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

🚀 SSH LICCO

PyPI version Python 3.10-3.13 MCP Registry

让 AI 帮你操作服务器! 通过自然语言对话,AI 可以帮你执行命令、管理文件、查看日志、部署应用等。


📚 文档导航

快速开始

核心功能

高级主题

开发资源


✨ 特性亮点

  • 🎯 自然语言控制 - 用对话方式操作服务器
  • 🔐 多种认证方式 - 密码、密钥、Agent 转发
  • 🔗 长连接支持 - 自动保活(30 秒心跳),避免账户锁定
  • ⏱️ 可配置超时 - Banner 超时 (60s)、会话超时 (2 小时)
  • 📦 异步高性能 - 基于 AsyncSSH 的异步架构
  • 🛡️ 完善的异常处理 - 统一的错误处理机制
  • 📊 会话管理 - 支持多个并发 SSH 会话
  • 📁 SFTP 文件传输 - 上传、下载、目录管理
  • 🔑 密钥管理 - 生成和管理 SSH 密钥对
  • 📝 审计日志 - 完整的操作审计记录
  • 🚀 连接池 - 高性能连接复用
  • 📊 批量执行 - 多主机并行命令执行
  • 🐳 Docker 支持 - Docker 构建和状态监控
  • 📋 后台任务 - 异步任务执行和状态跟踪

📦 快速安装

方式一:pip 安装(推荐)

pip install ssh-licco

方式二:MCP 安装

mcp install io.github.Echoqili/ssh-licco

方式三:从源码安装

git clone https://github.com/Echoqili/ssh-licco.git
cd ssh-licco
pip install -e .

Python 版本要求: Python 3.10, 3.11, 3.12, 3.13


⚠️ 依赖版本兼容性

已知依赖冲突

以下依赖版本冲突已在测试环境中验证,不影响 ssh-licco 的正常使用:

1. starlette 版本冲突

fastapi 需要 starlette<0.51.0
但安装了 starlette 0.52.1

影响范围:

  • ✅ ssh-licco: 无影响,正常工作
  • ⚠️ fastapi: 可能存在兼容性问题(如果同时使用 fastapi)

解决方案:

  • 如果只使用 ssh-licco,可以忽略此警告
  • 如果同时使用 fastapi,建议:
    pip install starlette==0.50.0
    

2. cryptography 版本冲突

pyopenssl 需要 cryptography<45
但安装了 cryptography 46.0.5

影响范围:

  • ✅ ssh-licco: 无影响,正常工作
  • ⚠️ pyopenssl: 可能存在兼容性问题(如果同时使用 pyopenssl)

解决方案:

  • 如果只使用 ssh-licco,可以忽略此警告
  • 如果同时使用 pyopenssl,建议:
    pip install cryptography==44.0.0
    

测试环境

测试通过的配置:

  • ✅ starlette 0.52.1 + ssh-licco 0.4.1
  • ✅ cryptography 46.0.5 + ssh-licco 0.4.1
  • ✅ mcp 1.26.0 + ssh-licco 0.4.1

测试场景:

  • ✅ SSH 连接和执行命令
  • ✅ 文件上传和下载
  • ✅ 后台任务执行
  • ✅ Docker 构建和监控
  • ✅ 多语言后台命令自动检测

为什么允许这些冲突?

ssh-licco 的核心依赖是:

  • mcp - MCP 协议实现
  • asyncssh - SSH 客户端
  • pydantic - 数据验证

而 starlette 和 cryptography 是通过 mcp 间接引入的。ssh-licco 本身不直接使用这些库的 API,因此版本冲突不会影响 ssh-licco 的功能。


🚀 快速开始

1️⃣ 配置 MCP 服务器

在 Trae / Cursor / Claude Desktop 中使用

打开设置 → MCP → 添加新服务器:

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco"
    }
  }
}

2️⃣ 配置 SSH 连接(可选但推荐)

方式 A:环境变量配置(推荐)

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_HOST": "192.168.1.100",
        "SSH_USER": "root",
        "SSH_PASSWORD": "your_password",
        "SSH_PORT": "22",
        "SSH_TIMEOUT": "60",
        "SSH_KEEPALIVE_INTERVAL": "30",
        "SSH_SESSION_TIMEOUT": "7200",
        "SSH_CLIENT_TYPE": "common"
      }
    }
  }
}

环境变量说明:

  • SSH_HOST: SSH 服务器地址
  • SSH_USER: 用户名
  • SSH_PASSWORD: 密码
  • SSH_PORT: 端口(默认 22)
  • SSH_TIMEOUT: 连接超时(秒)
  • SSH_KEEPALIVE_INTERVAL: 保活间隔(秒)
  • SSH_SESSION_TIMEOUT: 会话超时(秒)
  • SSH_CLIENT_TYPE: SSH 客户端类型(可选,默认 common)
    • common - paramiko(稳定可靠,推荐)⭐
    • performance - asyncssh(高性能,适合高并发)🚀
    • development - fabric(简化 API,适合快速开发)👨‍💻

方式 B:交互式配置

启动后,系统会提示输入连接信息:

python -m ssh_mcp.server

🔐 安全配置

重要:从 v0.2.1 开始,ssh-licco 提供多级安全策略,可根据使用场景灵活配置。

多级安全策略

级别 名称 适用场景 安全评分
STRICT 严格模式 生产环境、公共服务器 最高 ⭐⭐⭐
BALANCED 平衡模式 开发环境、个人服务器(默认) 高 ⭐⭐
RELAXED 宽松模式 测试环境、完全信任的服务器 中等 ⭐

快速配置

方式 1:环境变量(推荐)

Windows PowerShell:

$env:SSH_SECURITY_LEVEL = "balanced"
$env:SSH_EXTRA_ALLOWED_COMMANDS = "git,pip,npm"
python -m ssh_mcp.server

Linux/Mac:

export SSH_SECURITY_LEVEL="balanced"
export SSH_EXTRA_ALLOWED_COMMANDS="git,pip,npm"
python -m ssh_mcp.server

方式 2:MCP 配置文件

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_SECURITY_LEVEL": "balanced",
        "SSH_EXTRA_ALLOWED_COMMANDS": "git,pip,npm",
        "SSH_BASE_DIR": "/home"
      }
    }
  }
}

📖 详细文档


🛠️ 可用工具

SSH 连接管理

工具 描述 示例
ssh_connect 建立 SSH 连接 连接服务器
ssh_disconnect 断开 SSH 连接 释放连接资源
ssh_list_sessions 查看活动会话 管理多个连接

命令执行

工具 描述 示例
ssh_execute 执行 SSH 命令 ls -la, docker ps
ssh_background_task 后台任务执行 Docker 构建、长时间运行任务
ssh_task_status 查看后台任务状态 检查任务进度

文件管理

工具 描述 示例
ssh_upload_file 上传文件 部署代码
ssh_download_file 下载文件 获取日志
ssh_list_directory 列出目录内容 查看文件结构

系统管理

工具 描述 示例
ssh_get_info 获取系统信息 CPU、内存、磁盘
ssh_check_service 检查服务状态 PostgreSQL、Nginx
ssh_docker_build Docker 构建 构建镜像
ssh_docker_status Docker 状态 容器状态

📖 详细文档


💡 使用示例

示例 1:执行命令

用户:帮我查看服务器上的 Docker 容器
AI:正在执行 `docker ps` 命令...

[执行结果]
CONTAINER ID   IMAGE     COMMAND   STATUS    PORTS
abc123         nginx     "nginx"   Up 2 days 80:80

示例 2:文件上传

用户:把这个文件上传到 /var/www/html
AI:正在上传文件到 /var/www/html...

[上传成功]
本地:./index.html
远程:/var/www/html/index.html
大小:2.3 KB

示例 3:后台任务

用户:帮我构建 Docker 镜像
AI:正在启动后台任务执行 `docker build -t myapp .`...

[任务启动]
Task ID: a1b2c3d4
命令:docker build -t myapp .
日志:/tmp/background_task.log

使用 ssh_task_status 查看进度

示例 4:数据库检查

用户:检查 PostgreSQL 是否正常运行
AI:正在执行 `pg_isready -h localhost -p 5432`...

[检查结果]
localhost:5432 - accepting connections
✅ PostgreSQL 运行正常

📖 更多示例


📋 完整配置示例

场景 1:Web 开发者

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_SECURITY_LEVEL": "balanced",
        "SSH_EXTRA_ALLOWED_COMMANDS": "git,npm,docker,composer,pm2",
        "SSH_BASE_DIR": "/var/www",
        "SSH_HOST": "192.168.1.100",
        "SSH_USER": "deploy",
        "SSH_PASSWORD": "your-password"
      }
    }
  }
}

场景 2:Python 开发者

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_SECURITY_LEVEL": "balanced",
        "SSH_EXTRA_ALLOWED_COMMANDS": "pip,poetry,python3,pytest,black",
        "SSH_HOST": "192.168.1.100",
        "SSH_USER": "developer",
        "SSH_PASSWORD": "your-password"
      }
    }
  }
}

场景 3:数据库管理员

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_SECURITY_LEVEL": "balanced",
        "SSH_EXTRA_ALLOWED_COMMANDS": "psql,mysql,mongosh,pg_isready",
        "SSH_HOST": "192.168.1.100",
        "SSH_USER": "dbadmin",
        "SSH_PASSWORD": "your-password"
      }
    }
  }
}

场景 4:系统管理员

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_SECURITY_LEVEL": "relaxed",
        "SSH_EXTRA_ALLOWED_COMMANDS": "sudo,apt,yum,systemctl,journalctl,docker,kubectl",
        "SSH_HOST": "192.168.1.100",
        "SSH_USER": "root",
        "SSH_PASSWORD": "your-password"
      }
    }
  }
}

场景 5:生产环境(最高安全)

{
  "mcpServers": {
    "ssh": {
      "command": "ssh-licco",
      "env": {
        "SSH_SECURITY_LEVEL": "strict",
        "SSH_HOST": "192.168.1.100",
        "SSH_USER": "app-user",
        "SSH_PASSWORD": "your-password",
        "SSH_BASE_DIR": "/home/app-user"
      }
    }
  }
}

📖 更多配置


🔧 故障排查

常见问题

1. 连接失败

错误: Connection refused

解决:

  • 检查 SSH 服务是否运行:systemctl status sshd
  • 检查防火墙设置:ufw status
  • 确认端口正确:默认 22

2. 认证失败

错误: Authentication failed

解决:

  • 检查用户名和密码
  • 尝试使用密钥认证
  • 查看 SSH 日志:/var/log/auth.log

3. 命令被阻止

错误: 命令 'xxx' 不在允许列表中

解决:

{
  "SSH_SECURITY_LEVEL": "balanced",
  "SSH_EXTRA_ALLOWED_COMMANDS": "被阻止的命令"
}

4. 后台任务失败

错误: 'SSHMCPServer' object has no attribute '_logger'

解决: 升级到最新版本 v0.2.3+

pip install --upgrade ssh-licco

📖 详细文档


🎓 学习资源

Skills 文档

配置文档

API 文档


🔗 相关链接

项目资源

文档索引

文档 描述 位置
📖 配置指南 完整配置选项和场景 MCP_CONFIG_GUIDE.md
🔐 安全指南 安全配置详解 SECURITY_CONFIG_GUIDE.md
📊 API 参考 完整 API 文档 docs/API_REFERENCE.md
🎓 Skills 开发、运维、安装指南 docs/skills/
📦 发布指南 版本发布流程 docs/skills/RELEASE_SKILL.md

📊 版本历史

版本 日期 主要变更
v0.2.3 2026-03-14 修复 _logger 初始化 bug
v0.2.2 2026-03-14 安全配置增强(有 bug)
v0.2.1 2026-03-13 多级安全策略、环境变量配置
v0.2.0 2026-03-12 安全验证模块、命令白名单
v0.1.7 2026-03-11 基础功能、后台任务

🤝 贡献指南

欢迎贡献代码、文档和建议!

开发流程

  1. Fork 项目
  2. 创建特性分支
  3. 提交变更
  4. 推送到分支
  5. 创建 Pull Request

开发资源


📄 许可证

MIT License - 详见 LICENSE


💬 获取帮助

遇到问题?

  1. 查看文档: MCP_CONFIG_GUIDE.md
  2. 故障排除: docs/skills/ssh-mcp-troubleshoot/SKILL.md
  3. 提交 Issue: GitHub Issues

社区支持

  • GitHub Discussions
  • MCP Community
  • Stack Overflow (tag: ssh-licco)

Made with ❤️ by Echoqili

Last updated: 2026-03-14

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About io.github.Echoqili/ssh-licco

How do I install io.github.Echoqili/ssh-licco?

Run uvx ssh-licco, then add the server to your MCP client's configuration.

Is io.github.Echoqili/ssh-licco safe to use with an AI agent?

Its trust score is 37 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is io.github.Echoqili/ssh-licco still maintained?

Yes — the last commit was 13 days ago. The repository has 4 stars and 0 forks.