@c0dingbear/termius-mcp

中文文档
0.6.2发布于 2026/11/07MITCommonJS近 30 天下载 2136

MCP server that connects agents to your Termius machines: token-authorized SSH tunnels with a native GUI approval dialog, persistent shell/exec, background tasks, and SFTP file transfer. Includes termius-mcp setup to auto-detect and configure agents.

原始使用文档
文档目录4 节
  1. Install & configure
  2. Manual MCP client config
  3. Add your agent
  4. License

@c0dingbear/termius-mcp

An MCP server that lets agents connect to the machines saved in your Termius vault — safely.

  • Native GUI approval: every connection pops a dialog on your computer (Allow / Allow-for-session / Deny), via @c0dingbear/access-prompt. "Allow for this session" mints a consentToken so the agent can reconnect to that machine without re-prompting until the computer restarts.
  • Token-authorized SSH tunnels (forward / reverse), through jump-host chains.
  • Exec: one-shot (termius_tunnel_exec, with automatic PTY fallback) and a persistent interactive shell (termius_session_exec).
  • Background tasks: start / check / kill long-running commands.
  • SFTP: termius_sftp_write (plain-text only), read, upload, download, list — so agents stop smuggling files through base64 echoes.
  • Resilient: keepalive on connections, and dropped tunnels are marked dead with a clear message telling the agent to reconnect (instead of a bare "Not connected").

Host discovery/decryption comes from @c0dingbear/termius-vault.

Install & configure

npm install -g @c0dingbear/termius-mcp
termius-mcp setup        # detect your agents and add the MCP config

termius-mcp setup finds installed agents — opencode, Claude Code, Claude Desktop, Cursor, Pi, Codex, Windsurf, Cline, Zed, Continue, Antigravity, Amazon Q, Kilo Code, VS Code — and offers to add the server to each (merges into the existing config, backs it up first, and is idempotent). Flags: --yes (non-interactive), --print (just show the manual snippet).

On a global install the installer also runs this automatically if it's interactive; it auto-skips after 10 seconds and never edits a config without an explicit "yes". Non-interactive/CI installs just print a hint. So the two things you need are always: the package installed && your agent configured (the setup step does the second).

Running the server directly (what the agent launches):

termius-mcp              # speaks MCP over stdio

Manual MCP client config

{
  "mcp": {
    "termius": {
      "type": "local",
      "command": ["termius-mcp"],
      "environment": { "DISPLAY": ":0" }
    }
  }
}

DISPLAY (Linux) must point at your desktop session so the approval dialog can appear. Requires the Termius desktop app installed and logged in.

Add your agent

Don't see your agent / harness in the list? Adding one is a small, self-contained change — edit setup.js and open a PR.

Each agent is one entry in the agents() list: a detected check (does its config file / CLI exist?) and an apply() that merges the server into its config (back up first, and no-op if it's already there). Most agents use the common mcpServers JSON shape, so you can copy an existing block like Cursor's:

// My Agent — ~/.myagent/mcp.json, mcpServers shape
{
  const file = path.join(os.homedir(), ".myagent", "mcp.json");
  list.push({
    id: "myagent", label: "My Agent", target: file,
    detected: fs.existsSync(file) || hasCommand("myagent"),
    apply() {
      const cfg = readJsonSafe(file) || {};
      cfg.mcpServers = cfg.mcpServers || {};
      if (cfg.mcpServers.termius) return { status: "exists", detail: file };
      cfg.mcpServers.termius = genericEntry();   // { command: "termius-mcp", env?: { DISPLAY } }
      writeJson(file, cfg);
      return { status: "added", detail: file };
    }
  });
}

For a different schema (TOML like Codex, a context_servers/servers key, or a YAML block file), see the Codex, Zed, VS Code and Continue entries for patterns.

License

MIT

版本与发布记录

@c0dingbear/termius-mcp 共发布 11 个版本,首次发布于 2026/10/23;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.6.2latest2026/11/071 天前
0.6.12026/11/071 天前
0.6.02026/11/071 天前
0.5.02026/11/071 天前
0.4.02026/11/071 天前
0.3.22026/10/309 天前

关于 @c0dingbear/termius-mcp 的常见问题

@c0dingbear/termius-mcp 是什么?

MCP server that connects agents to your Termius machines: token-authorized SSH tunnels with a native GUI approval dialog, persistent shell/exec, background tasks, and SFTP file transfer. Includes termius-mcp setup to auto-detect and configure agents.

如何安装 @c0dingbear/termius-mcp?

在项目目录运行 npm install @c0dingbear/termius-mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 termius-mcp,可以用 npx termius-mcp 直接运行。

@c0dingbear/termius-mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/c0dingbear__termius-mcp 是否存在。

@c0dingbear/termius-mcp 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@c0dingbear/termius-mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@c0dingbear/termius-mcp 可以商用吗?

@c0dingbear/termius-mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@c0dingbear/termius-mcp 的下载量有多少?

根据 npm 官方下载统计,@c0dingbear/termius-mcp 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,136 次,日均约 71 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@c0dingbear/termius-mcp 还在维护吗?

最新版本 0.6.2 发布于 2026/11/07(1 天前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/10/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。