# tabby-bianbu-mcp **Tabby terminal plugin for Bianbu Cloud — Shell & File Manager over MCP** **Bianbu Cloud 的 Tabby 终端插件 — 基于 MCP 的远程 Shell 和文件管理器** [![npm version](https://img.shields.io/npm/v/tabby-bianbu-mcp?style=flat-square&color=cb3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/tabby-bianbu-mcp) [![license](https://img.shields.io/npm/l/tabby-bianbu-mcp?style=flat-square&color=blue)](LICENSE) [![node](https://img.shields.io/node/v/tabby-bianbu-mcp?style=flat-square&color=339933&logo=node.js&logoColor=white)](package.json) [![npm downloads](https://img.shields.io/npm/dm/tabby-bianbu-mcp?style=flat-square&color=orange)](https://www.npmjs.com/package/tabby-bianbu-mcp) [![GitHub stars](https://img.shields.io/github/stars/niver2002/tabby-bianbu-mcp?style=flat-square&logo=github)](https://github.com/niver2002/tabby-bianbu-mcp) --- [English](#-overview)  •  [中文](#-概述)

## Overview > A [Tabby](https://tabby.sh) plugin that brings **cloud shell** and **file manager** experiences to Bianbu Cloud virtual machines, > powered by the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/). > No SSH keys. No SFTP setup. Just MCP over HTTPS.
## 概述 > 一款 [Tabby](https://tabby.sh) 插件,为算能板卡宇宙(Bianbu Cloud) 虚拟机提供**云端 Shell** 和**文件管理器**体验, > 基于 [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) 通信。 > 无需 SSH 密钥,无需 SFTP,仅需 HTTPS + MCP。
--- ## ✨ Features / 功能特性
English 中文
**🖥 Cloud Shell** - Full terminal experience via MCP shell sessions - Persistent sessions with working directory tracking - Character-at-a-time input with prompt detection **🖥 云端 Shell** - 通过 MCP Shell 会话实现完整终端体验 - 持久会话,自动跟踪工作目录 - 逐字符输入,智能提示符检测
**📁 File Manager** - Browse, create, rename, delete files & directories - Inline text editor with save support - Drag-and-drop file upload - Keyboard shortcuts (F2, F5, Del, Ctrl+N, Ctrl+Shift+N) **📁 文件管理器** - 浏览、新建、重命名、删除文件和目录 - 内联文本编辑器,支持保存 - 拖拽上传文件 - 快捷键(F2 重命名 / F5 刷新 / Del 删除 / Ctrl+N 新文件 / Ctrl+Shift+N 新文件夹)
**⚡ High-Performance Transfers** - Parallel chunked upload & download - 32-slot request scheduler (2 interactive + 30 transfer) - Configurable chunk sizes and concurrency - Transfer queue with cancel support **⚡ 高性能传输** - 并行分块上传和下载 - 32 槽位请求调度器(2 交互 + 30 传输) - 可配置分块大小和并发数 - 传输队列,支持取消
**🔧 Remote Maintenance** - One-click push-upgrade from Tabby - Step-by-step progress bar with cancel support - Auto-rollback on failed deployments - Remote health diagnostics & version tracking - Downloadable session logs (local + remote) **🔧 远程维护** - Tabby 内一键推送升级 - 分步进度条,支持取消 - 部署失败自动回滚 - 远程健康诊断和版本追踪 - 可下载会话日志(本地 + 远端)

--- ## 📦 Installation / 安装
Step / 步骤English中文
1. Install Tabby Download from [tabby.sh](https://tabby.sh) — available for Windows, macOS, Linux. 从 [tabby.sh](https://tabby.sh) 下载安装 — 支持 Windows、macOS、Linux。
2. Install Plugin Open Tabby → **Settings** → **Plugins** → search `tabby-bianbu-mcp` → **Install**. Or via npm: ```bash npm install tabby-bianbu-mcp ``` 打开 Tabby → **设置** → **插件** → 搜索 `tabby-bianbu-mcp` → **安装**。 或通过 npm: ```bash npm install tabby-bianbu-mcp ```

--- ## 🖥 First-time Server Setup / 首次服务端部署 > The plugin connects to a **remote MCP server** running on your Bianbu Cloud VM. You need to deploy it once before the plugin can work. > > 插件通过连接运行在算能云主机上的 **MCP 服务** 来工作。首次使用前需要在远端部署一次。
English中文
**Option A: One-command install (recommended)** SSH into your Bianbu Cloud VM and run: ```bash wget https://github.com/niver2002/tabby-bianbu-mcp/releases/latest/download/bianbu_agent_proxy.sh chmod +x bianbu_agent_proxy.sh sudo ./bianbu_agent_proxy.sh bootstrap ``` This will: 1. Create a `bianbu` system user 2. Install Node.js (if not present) 3. Deploy the MCP server to `/opt/bianbu-mcp-server/` 4. Register and start a systemd service 5. Listen on `http://0.0.0.0:11434/mcp` **方式 A:一键安装(推荐)** SSH 登录算能云主机,执行: ```bash wget https://github.com/niver2002/tabby-bianbu-mcp/releases/latest/download/bianbu_agent_proxy.sh chmod +x bianbu_agent_proxy.sh sudo ./bianbu_agent_proxy.sh bootstrap ``` 这会: 1. 创建 `bianbu` 系统用户 2. 安装 Node.js(如果没有) 3. 部署 MCP 服务到 `/opt/bianbu-mcp-server/` 4. 注册并启动 systemd 服务 5. 监听 `http://0.0.0.0:11434/mcp`
**Option B: Upload via SCP/SFTP** If `wget` is unavailable on the VM, copy the script from your local machine: ```bash # On your local machine: scp bianbu_agent_proxy.sh user@your-vm-ip:/tmp/ # Then SSH into the VM: ssh user@your-vm-ip cd /tmp chmod +x bianbu_agent_proxy.sh sudo ./bianbu_agent_proxy.sh bootstrap ``` **方式 B:通过 SCP/SFTP 上传** 如果云主机上没有 `wget`,可以从本机上传: ```bash # 在本地机器上: scp bianbu_agent_proxy.sh user@你的主机IP:/tmp/ # 然后 SSH 登录云主机: ssh user@你的主机IP cd /tmp chmod +x bianbu_agent_proxy.sh sudo ./bianbu_agent_proxy.sh bootstrap ```
**Verify it's running:** ```bash curl http://127.0.0.1:11434/health ``` You should see a JSON response with `"ok": true`. **验证是否运行:** ```bash curl http://127.0.0.1:11434/health ``` 应看到包含 `"ok": true` 的 JSON 响应。
### Environment Variables / 环境变量
VariableDefaultDescription / 说明
PORT11434Server listen port / 监听端口
RUN_USERbianbuSystem user for the service / 服务运行用户
FILE_ROOT/home/bianbuFile manager root / 文件管理器根目录
ENABLE_PASSWORDLESS_SUDOfalseAllow as_root=true without password / 免密 sudo 提权
TLS_CERT_FILE(empty)HTTPS cert path / HTTPS 证书路径
TLS_KEY_FILE(empty)HTTPS key path / HTTPS 私钥路径
MCP_TRANSPORT_MODEstatelessMCP transport: stateless or sse
Example with custom settings / 自定义配置示例: ```bash PORT=8080 FILE_ROOT=/data ENABLE_PASSWORDLESS_SUDO=true sudo -E ./bianbu_agent_proxy.sh bootstrap ```
--- ## 🚀 Quick Start / 快速上手 ### 1. Get API Key / 获取 API 密钥
**English**: Log in to [Bianbu Cloud](https://cloud.bianbu.org) console, click your avatar (top-right) → **API Key** in the sidebar. Copy the full key. **中文**: 登录 [算能板卡宇宙](https://cloud.bianbu.org) 控制台,点击右上角头像 → 左侧菜单 **API Key**,复制完整密钥。

控制台首页 — 点击右上角头像进入个人设置 / Console home — click avatar to enter profile settings


侧栏点击 "API Key",复制星号处的完整密钥 / Click "API Key" in sidebar, copy the full key

### 2. Get MCP URL / 获取 MCP 地址
**English**: On the console home page, click **"开始远程"** (Start Remote) on your instance card. In the popup, find the domain like `xxx.gdriscv.com`. Your MCP URL is: `https:///mcp` In the plugin settings, you only need to paste the domain part (without `https://` or `/mcp`). **中文**: 在控制台首页,点击实例卡片上的 **"开始远程"**。在弹窗中找到类似 `xxx.gdriscv.com` 的域名。你的 MCP 地址是: `https://<该域名>/mcp` 在插件设置中,只需粘贴域名部分(不含 `https://` 和 `/mcp`)。

点击"本地连接",在 connect 行找到域名 / Click "本地连接", find the domain in the connect line

### 3. Configure Plugin / 配置插件 Open **Settings → Bianbu MCP** in Tabby and fill in: 在 Tabby 中打开 **设置 → Bianbu MCP**,填写: | Field / 字段 | Description / 说明 | Example / 示例 | |:---|:---|:---| | **Domain** | Paste domain only (no `https://`, no `/mcp`) / 只粘贴域名 | `xxx.gdriscv.com` | | **API Key** | Full key from step 1 / 第 1 步复制的完整密钥 | `your-api-key` | | **Name** | Display name / 显示名称 | `bianbu` | ### 4. Connect / 连接 Click **"Test connection"** to verify. Then use: 点击 **"Test connection"** 验证。然后使用: - **"Open Shell"** — for terminal access / 打开终端 - **"Open Files"** — for file management / 打开文件管理器 ### 5. MCP Snippet / MCP 配置片段 Copy the auto-generated JSON config for other MCP clients: 复制自动生成的 JSON 配置,用于其他 MCP 客户端(如 Claude Desktop): ```json { "mcpServers": { "bianbu": { "type": "http", "url": "https://your-domain.example.com/mcp", "headers": { "X-API-KEY": "your-api-key" } } } } ```
--- ## ⚙️ Settings Reference / 配置参考
Click to expand full settings table / 点击展开完整配置表
| Key / 键 | Default / 默认值 | Description (EN) | 说明 (中文) | |:---|:---|:---|:---| | `name` | `bianbu` | Profile display name | 配置显示名称 | | `domain` | *(empty)* | MCP domain (without `https://` or `/mcp`) | MCP 域名(不含 `https://` 和 `/mcp`) | | `apiKey` | *(empty)* | `X-API-KEY` header value | API 密钥 | | `interactiveConcurrency` | `2` | Interactive request slots | 交互请求并发槽位数 | | `transferConcurrency` | `30` | Transfer request slots | 传输请求并发槽位数 | | `maxConcurrentFiles` | `3` | Max parallel file transfers | 最大并行文件传输数 | | `workerCadenceMs` | `0` | Dispatch cycle interval (ms); adaptive throttling auto-adjusts | 调度周期间隔 (毫秒);自适应节流自动调整 | | `maxRetries` | `2` | Max retry attempts | 最大重试次数 | | `retryBaseMs` | `1000` | Base delay between retries (ms) | 重试基础间隔 (毫秒) | | `uploadChunkBytes` | `65536` | Upload chunk size (bytes) | 上传分块大小 (字节) | | `downloadChunkBytes` | `262144` | Download chunk size (bytes) | 下载分块大小 (字节) | | `notes` | *(empty)* | User notes | 用户备注 | | `installerRemotePath` | `/tmp/bianbu_agent_proxy.sh` | Remote installer path | 远端安装脚本路径 | | `maintenanceAsRoot` | `true` | Run maintenance as root | 以 root 执行维护 | | `reconnectPollMs` | `2000` | Health poll interval during upgrade | 升级时健康检测间隔 | | `upgradeHealthTimeoutMs` | `120000` | Max wait time for upgrade (ms) | 升级最大等待时间 |

--- ## 🔄 Remote Maintenance / 远程维护
### English The plugin bundles `bianbu_agent_proxy.sh` — a self-contained MCP server installer with **blue/green deployment** and **automatic rollback**. **Push Upgrade** — updates the remote server to the version bundled with your plugin (blue/green, safe). **What happens when you click:** 1. Upload bundled installer → remote host (chunked, with progress bar) 2. Launch detached `up` process 3. Installer stages the new release in a temporary directory, validates with `node`, then swaps atomically 4. Plugin polls remote health until expected version appears 5. On failure: previous installation is auto-restored **Progress UI** (v0.9.0+): - Step-by-step progress bar: Upload → Launch → Wait → Verify - Elapsed time counter - Cancel button to abort at any stage - Error display shows which step failed **After maintenance**, download session logs from the Settings page for debugging. > **If the service is completely broken** (e.g. Node.js removed, server won't start at all), Push Upgrade can't help — SSH into the VM and run `sudo ./bianbu_agent_proxy.sh bootstrap` to reinstall from scratch. ### 中文 插件内置了 `bianbu_agent_proxy.sh` — 一个自包含的 MCP 服务器安装脚本,支持**蓝绿部署**和**自动回滚**。 **Push Upgrade(推送升级)** — 将远端服务器更新到插件内置的版本(蓝绿部署,安全)。 **点击按钮后的流程:** 1. 分块上传内置安装脚本到远端主机(带进度条) 2. 后台启动 `up` 进程 3. 安装脚本在临时目录准备新版本,用 `node` 验证后原子切换 4. 插件持续轮询远端健康状态,直到出现预期版本号 5. 如果失败:自动还原之前的安装 **进度 UI**(v0.9.0+): - 分步进度条:上传 → 启动 → 等待 → 验证 - 已用时间计时器 - 取消按钮,随时中止 - 错误提示明确显示哪个步骤失败 **维护完成后**,可在设置页下载会话日志用于排查问题。 > **如果服务彻底坏了**(如 Node.js 被删、服务完全无法启动),Push Upgrade 无法修复 — 请 SSH 登录主机执行 `sudo ./bianbu_agent_proxy.sh bootstrap` 重新安装。

--- ## ❓ Troubleshooting / 常见问题
Problem / 问题Solution / 解决方案
connect ECONNREFUSED when opening Shell/Files MCP server is not running. SSH into the VM and run sudo ./bianbu_agent_proxy.sh bootstrap (first time) or sudo systemctl restart bianbu-mcp-server (existing install).

MCP 服务未运行。SSH 登录主机,首次执行 sudo ./bianbu_agent_proxy.sh bootstrap,已安装则执行 sudo systemctl restart bianbu-mcp-server。
Push Upgrade fails at [upload] step Usually a network timeout. Check your API key and domain. If E2BIG error, update to plugin v0.8.5+.

通常是网络超时。检查 API 密钥和域名。如报 E2BIG,请升级插件到 v0.8.5+。
Push Upgrade fails at [wait] step with timeout The installer is slow or Node.js is not installed. SSH into VM and check:
cat /tmp/bianbu_agent_proxy.sh.log
systemctl status bianbu-mcp-server

安装脚本执行慢或 Node.js 未安装。SSH 登录查看日志:
cat /tmp/bianbu_agent_proxy.sh.log
Shell works but no PTY (no colors, no vim) Remote server < v1.5.0 doesn't support PTY. Use Push Upgrade to update.

远端服务器 < v1.5.0 不支持 PTY。使用 Push Upgrade 更新。
Health check shows unknown versions Remote server is very old. Use Push Upgrade to update, or SSH in and run sudo ./bianbu_agent_proxy.sh bootstrap.

远端服务器版本过旧。使用 Push Upgrade 更新,或 SSH 登录执行 sudo ./bianbu_agent_proxy.sh bootstrap。

--- ## 🏗 Architecture / 架构 ``` ┌───────────────────────────────────────────────────────┐ │ Tabby Terminal │ │ ┌──────────────┐ ┌──────────────┐ ┌─────────────┐ │ │ │ Shell Tab │ │ Files Tab │ │ Settings Tab│ │ │ └──────┬───────┘ └──────┬───────┘ └──────┬──────┘ │ │ │ │ │ │ │ ┌──────┴─────────────────┴──────────────────┴──────┐ │ │ │ BianbuMcpService │ │ │ │ ┌─────────────────┐ ┌────────────────────────┐ │ │ │ │ │ Interactive Lane│ │ Transfer Lane │ │ │ │ │ │ (2 slots) │ │ (30 slots) │ │ │ │ │ └────────┬────────┘ └───────────┬────────────┘ │ │ │ │ └───────────┬───────────┘ │ │ │ │ │ │ │ │ │ JSON-RPC / HTTP(S) │ │ │ └───────────────────────┼──────────────────────────┘ │ └──────────────────────────┼─────────────────────────────┘ │ ┌──────▼──────┐ │ X-API-KEY │ │ Gateway │ └──────┬──────┘ │ ┌──────────▼──────────┐ │ bianbu-mcp-server │ │ (Express + MCP) │ │ │ │ 20 MCP Tools: │ │ health, shell, │ │ files, chunked │ │ transfers ... │ └─────────────────────┘ ```
--- ## 🛠 Development / 开发 ```bash # Clone / 克隆 git clone https://github.com/niver2002/tabby-bianbu-mcp.git cd tabby-bianbu-mcp # Install dependencies / 安装依赖 npm install # Build (sync assets → types → webpack) npm run build # Watch mode / 监视模式 npm run watch # Run tests / 运行测试 npm test # Full release verification / 完整发布验证 npm run verify ```
--- ## ⚠️ Security Considerations / 安全注意事项
English 中文
- **Always use HTTPS** — API key is sent in `X-API-KEY` header; HTTP transmits it in plaintext - **`as_root=true`** bypasses `FILE_ROOT` restrictions and uses `sudo -n` - The **MCP snippet** in settings shows the real API key — don't share it publicly - `pug@2.x` has known prototype pollution CVEs; this is a **build-time-only** dependency - **始终使用 HTTPS** — API 密钥通过 `X-API-KEY` 头传输,HTTP 会明文传输 - **`as_root=true`** 会绕过 `FILE_ROOT` 限制,使用 `sudo -n` 执行 - 设置页的 **MCP 配置片段**会显示真实 API 密钥 — 不要公开分享 - `pug@2.x` 有已知的原型链污染漏洞,但这只是**构建时依赖**,不影响运行时

--- ## 📋 Changelog / 变更日志 See [CHANGELOG.md](CHANGELOG.md) for the full release history. 完整版本历史请查看 [CHANGELOG.md](CHANGELOG.md)。
--- ## 📄 License / 许可证 [MIT](LICENSE) © [niver2002](https://github.com/niver2002) ---
**Made with** ❤️ **for the Bianbu Cloud community** **为算能板卡宇宙社区倾心打造**
[Report Bug / 反馈问题](https://github.com/niver2002/tabby-bianbu-mcp/issues)  •  [npm Package](https://www.npmjs.com/package/tabby-bianbu-mcp)  •  [Tabby Terminal](https://tabby.sh)