SSH Model Context Protocol Server - Enable SSH functionality for AI models
SSH Model Context Protocol Server - Enable SSH functionality for AI models
Valid MCP server (2 strong, 0 medium validity signals). 4 known CVEs in dependencies (0 critical, 3 high severity) Package registry verified. Imported from the Official MCP Registry.
4 files analyzed · 5 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: SSH_SECURITY_LEVEL
Environment variable: SSH_EXTRA_ALLOWED_COMMANDS
Environment variable: SSH_BASE_DIR
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-echoqili-ssh-licco": {
"env": {
"SSH_BASE_DIR": "your-ssh-base-dir-here",
"SSH_SECURITY_LEVEL": "your-ssh-security-level-here",
"SSH_EXTRA_ALLOWED_COMMANDS": "your-ssh-extra-allowed-commands-here"
},
"args": [
"ssh-licco"
],
"command": "uvx"
}
}
}From the project's GitHub README.
让 AI 帮你操作服务器! 通过自然语言对话,AI 可以帮你执行命令、管理文件、查看日志、部署应用等。
pip install ssh-licco
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 的正常使用:
fastapi 需要 starlette<0.51.0
但安装了 starlette 0.52.1
影响范围:
解决方案:
pip install starlette==0.50.0
pyopenssl 需要 cryptography<45
但安装了 cryptography 46.0.5
影响范围:
解决方案:
pip install cryptography==44.0.0
测试通过的配置:
测试场景:
ssh-licco 的核心依赖是:
mcp - MCP 协议实现asyncssh - SSH 客户端pydantic - 数据验证而 starlette 和 cryptography 是通过 mcp 间接引入的。ssh-licco 本身不直接使用这些库的 API,因此版本冲突不会影响 ssh-licco 的功能。
打开设置 → MCP → 添加新服务器:
{
"mcpServers": {
"ssh": {
"command": "ssh-licco"
}
}
}
{
"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,适合快速开发)👨💻启动后,系统会提示输入连接信息:
python -m ssh_mcp.server
重要:从 v0.2.1 开始,ssh-licco 提供多级安全策略,可根据使用场景灵活配置。
| 级别 | 名称 | 适用场景 | 安全评分 |
|---|---|---|---|
| STRICT | 严格模式 | 生产环境、公共服务器 | 最高 ⭐⭐⭐ |
| BALANCED | 平衡模式 | 开发环境、个人服务器(默认) | 高 ⭐⭐ |
| RELAXED | 宽松模式 | 测试环境、完全信任的服务器 | 中等 ⭐ |
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
{
"mcpServers": {
"ssh": {
"command": "ssh-licco",
"env": {
"SSH_SECURITY_LEVEL": "balanced",
"SSH_EXTRA_ALLOWED_COMMANDS": "git,pip,npm",
"SSH_BASE_DIR": "/home"
}
}
}
}
| 工具 | 描述 | 示例 |
|---|---|---|
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 状态 | 容器状态 |
用户:帮我查看服务器上的 Docker 容器
AI:正在执行 `docker ps` 命令...
[执行结果]
CONTAINER ID IMAGE COMMAND STATUS PORTS
abc123 nginx "nginx" Up 2 days 80:80
用户:把这个文件上传到 /var/www/html
AI:正在上传文件到 /var/www/html...
[上传成功]
本地:./index.html
远程:/var/www/html/index.html
大小:2.3 KB
用户:帮我构建 Docker 镜像
AI:正在启动后台任务执行 `docker build -t myapp .`...
[任务启动]
Task ID: a1b2c3d4
命令:docker build -t myapp .
日志:/tmp/background_task.log
使用 ssh_task_status 查看进度
用户:检查 PostgreSQL 是否正常运行
AI:正在执行 `pg_isready -h localhost -p 5432`...
[检查结果]
localhost:5432 - accepting connections
✅ PostgreSQL 运行正常
{
"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"
}
}
}
}
{
"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"
}
}
}
}
{
"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"
}
}
}
}
{
"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"
}
}
}
}
{
"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"
}
}
}
}
错误: Connection refused
解决:
systemctl status sshdufw status错误: Authentication failed
解决:
/var/log/auth.log错误: 命令 'xxx' 不在允许列表中
解决:
{
"SSH_SECURITY_LEVEL": "balanced",
"SSH_EXTRA_ALLOWED_COMMANDS": "被阻止的命令"
}
错误: 'SSHMCPServer' object has no attribute '_logger'
解决: 升级到最新版本 v0.2.3+
pip install --upgrade ssh-licco
| 文档 | 描述 | 位置 |
|---|---|---|
| 📖 配置指南 | 完整配置选项和场景 | 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 | 基础功能、后台任务 |
欢迎贡献代码、文档和建议!
MIT License - 详见 LICENSE
ssh-licco)Made with ❤️ by Echoqili
Last updated: 2026-03-14
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.