MSAW
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MSAWlist all hosts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MSAW 让 Codex 等 Agent 通过 MCP 同时操作多台 SSH 主机,并用本地 .msaw/shared 在不同 VPS 之间流转文件。主机库存、凭据、隔离初始化和全局权限由本地用户控制,不进入 Agent 的能力范围。
安全模型
边界 | 默认行为 |
Linux 日常身份 | 可一键创建 |
管理员身份 | root/admin 凭据仅用于隔离初始化和用户授予的全局模式 |
全局模式 | 只能通过 Web UI/CLI 开启;开启后永久有效,直到用户手动关闭 |
主机库存 | MCP 默认只读;添加和删除只能在 Web UI/CLI 完成 |
凭据存储 | Windows DPAPI、macOS Keychain、Linux Secret Service;不可用时回退 RSA-OAEP 加密文件 |
私钥口令 | 通过 |
Web UI | 默认只绑定 loopback;写操作校验 HttpOnly 会话 cookie 和同源 Origin |
远程 Web | 必须同时使用 |
文件传输 | 自动探测 rsync,支持 |
MCP 协议 | 使用官方 Python MCP SDK 处理 stdio、schema、协商和取消 |
隔离用户依赖 Linux 文件权限,不是 chroot 或容器。它会阻止 Agent 读取 /etc/shadow、修改系统文件或使用 sudo,但仍能读取系统本来允许普通用户读取的内容。
Related MCP server: ssh-mcp-server
工作方式
flowchart LR
Agent["Codex / Agent"] -->|Official MCP SDK + stdio| MCP["MSAW MCP"]
UI["Web UI / CLI"] --> Control["Local control plane"]
MCP --> Control
Control -->|OpenSSH| A["VPS A"]
Control -->|OpenSSH| B["VPS B"]
A -->|rsync / SCP| Shared[".msaw/shared"]
Shared -->|rsync / SCP| B
Vault["DPAPI / Keychain / Secret Service"] --> Control安装
需要 Python 3.10+、OpenSSH 客户端和 Git。rsync 可选。
git clone https://github.com/LusiyAvA/msaw.git
cd msaw
python -m venv .venv
.\.venv\Scripts\python -m pip install -e .
.\.venv\Scripts\msaw init
.\.venv\Scripts\msaw ensure打开 http://127.0.0.1:8765。Web UI 会实时显示主机、共享文件和操作状态。
Linux/macOS:
python3 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/msaw init
.venv/bin/msaw ensure添加与隔离主机
Web UI 支持系统 OpenSSH、保存私钥和保存密码三种认证方式。点击“保存并测试连接”后会明确显示成功或失败;首次连接 Linux 管理员账号时,可保持“初始化 msaw-agent 隔离用户”选中。
CLI 使用系统 SSH 配置:
msaw host add prod-a --host example.com --user root --auth-method system
msaw test prod-a
msaw host isolate prod-a保存私钥:
msaw host add prod-a --host example.com --user root `
--auth-method key --private-key-file .\id_ed25519命令行密码和口令可能进入 Shell 历史,保存凭据时优先使用 Web UI。
隔离初始化完成后:
日常 workspace 操作使用
msaw-agent专用 SSH key。原 root/admin 认证被保留为管理员凭据。
新身份会再次执行 SSH 连接测试,成功后才切换主机配置。
初始化失败不会切换日常身份,也不会保留无效凭据引用。
已存在的同名 Linux 用户不会被复用;请在 Web UI 或
--user中选择新的专用用户名。工作区必须位于隔离用户家目录、
/srv、/opt/msaw或/var/lib/msaw下的专用目录。初始化只修改工作区目录本身,不递归修改其中已有文件的所有权。
管理员可以是 root,也可以是支持
sudo -n的普通云主机账号。
全局权限
全局模式开关位于每台主机卡片上。普通开启永久有效,直到用户手动关闭:
msaw host mode prod-a --enable
msaw host mode prod-a --disable临时授权必须显式选择,到期后自动关闭:
msaw host mode prod-a --enable --temporary --lease-minutes 30MCP schema 不包含任何修改全局模式的字段或工具。
共同工作区
msaw pull prod-a releases/app.tar.gz --shared-path releases/app.tar.gz
msaw push prod-b releases/app.tar.gz --remote-path releases/app.tar.gz
msaw transfer prod-a prod-b releases/app.tar.gz
msaw transfer prod-a prod-b releases/app.tar.gz --keep-transfer-copytransfer 仍通过本地共享区中转。传输成功后默认删除临时副本;失败时会保留现场,显式使用 --keep-transfer-copy 可保留成功传输的副本。双方支持 rsync 时自动使用增量和断点续传,否则自动使用 SCP。
接入 Codex
config.toml 建议直接指向项目虚拟环境,避免 Codex 启动时依赖已运行的 Web 服务:
[mcp_servers.msaw]
command = "<path-to-msaw>/.venv/Scripts/python.exe"
args = ["-m", "multi_ssh_workspace.cli", "mcp"]
cwd = "<path-to-msaw>"
startup_timeout_sec = 30
tool_timeout_sec = 180
required = true
[mcp_servers.msaw.env]
MSAW_HOME = "<path-to-msaw>"
PYTHONPATH = "<path-to-msaw>/src"
PYTHONDONTWRITEBYTECODE = "1"Linux/macOS 将 command 改为 <path-to-msaw>/.venv/bin/python。
MCP 启动时会自动确认并按需启动本地控制服务。Agent 应按以下顺序工作:
hosts_list -> host_test -> host_exec / shared transferMCP 工具
默认暴露 9 个工具:
分组 | 工具 |
主机只读 |
|
多机执行 |
|
共同工作区 |
|
文件流转 |
|
结果读取 |
|
host_exec 使用统一的多目标接口:
{
"targets": ["prod-a", "prod-b"],
"command": "uname -a",
"timeout": 60,
"concurrency": 4
}单主机也使用长度为 1 的 targets,一次最多 16 台。默认每台最多返回最有价值输出流的 10 行、1500 字符,并且整个响应不超过 8000 字符和 120 行;失败主机优先于成功主机保留详情。完整细节保存在当前 MCP 会话。
只有本地用户开启库存修改后,MCP 才额外暴露 host_upsert 和 host_remove:
msaw settings inventory --allow
msaw settings inventory --deny即使启用,这两个工具也不能接收凭据、修改认证方式或开启全局模式。修改设置后需要让 MCP 客户端重新连接。
长输出与取消
普通长结果会返回首部、尾部和 output_ref。批量执行受每台和全局双层预算约束,未展示内容进入结果缓存。
{
"output_ref": "<output-ref>",
"mode": "incremental",
"max_chars": 8000
}incremental只返回此前从未交付给 Agent 的内容。full返回带明确标识的完整结果,允许重复先前内容。常规工具也可传
full_output: true直接请求全量。缓存仅存在于当前 MCP 进程,最多保留最近 32 条结果。
SSH、SCP 和 rsync 都通过异步子进程执行。MCP cancel 会立即终止同一请求下的全部进程;2 秒内未退出则强制结束。
Web 访问
本地模式:
msaw serve --host 127.0.0.1 --port 8765MSAW 拒绝直接监听非 loopback 地址。远程访问必须通过本机 HTTPS 反向代理,并从环境变量或权限受限的文件提供 Bearer Token:
$env:MSAW_BEARER_TOKEN = "<token>"
msaw serve --host 127.0.0.1 --port 8765 --allow-remote
msaw serve --host 127.0.0.1 --port 8765 --allow-remote --bearer-token-file .\.msaw\web-token反向代理必须传递 X-Forwarded-Proto: https。远程 Web UI 使用 Bearer Token 换取 Secure、SameSite、HttpOnly 会话 cookie;Token 不进入 URL 或进程 argv。不要把 8765 端口直接暴露到公网。
运行数据
.msaw/
credentials.json
hosts.json
settings.json
*.lock
known_hosts
keystore/
logs/
runtime/
shared/不要提交 .msaw/、真实主机清单、凭据、日志或共享文件。RSA keystore 只在系统凭据服务不可用时作为兼容 fallback。
开发
python scripts/codegraph.py
python -m unittest discover -s tests -p "test_*.py" -v核心模块:
src/multi_ssh_workspace/
config.py
credentials.py
execution.py
isolation.py
mcp_stdio.py
settings.py
ssh_client.py
web.py
websocket.py
workspace.pyLicense
Available Tools
9 toolshost_execADestructive
Run the same shell command concurrently on one or more configured SSH hosts. targets must contain host IDs from hosts_list. Commands stay in each workspace unless the user has granted global mode locally. Default output is return code plus the last 10 lines and 1500 characters from the most useful stream per host, within one global response budget. Use result_read for undisclosed or full output.
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| targets | Yes | Unique host IDs from hosts_list; one to sixteen targets. | |
| timeout | No | ||
| concurrency | No | ||
| full_output | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already set destructiveHint=true and non-idempotent. The description adds valuable context beyond that: concurrency behavior, the workspace-vs-global scope constraint, and precise output truncation policy (last 10 lines, 1500 chars, one global budget). No contradiction with annotations; it enriches the behavioral picture.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four sentences, each fact-dense and front-loaded with the core purpose. The additional behavioral notes are placed after the purpose, and the output-routing note is last. No wasted words, though a slightly shorter version could combine scope and output details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be detailed, and the description does describe default truncation and the escape hatch (result_read). However, it leaves timeout and concurrency semantics unexplained, and does not address error scenarios or what 'most useful stream' means. Given the tool complexity, more parameter-level detail would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 20% (targets has a description). The description reinforces that targets come from hosts_list but does not explain command, timeout, concurrency, or full_output beyond defaults. For low schema coverage, the description should compensate, but it only adds meaningful detail for one out of five parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific action 'Run the same shell command concurrently on one or more configured SSH hosts' – a clear verb-resource pair that immediately distinguishes this from siblings like hosts_list (listing hosts) and shared_read/shared_write (shared storage). The concurrency and multi-host scope add precision.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides a clear prerequisite ('targets must contain host IDs from hosts_list') and points to an alternative for full output ('Use result_read for undisclosed or full output'). It does not explicitly list when-not-to-use cases for other siblings, but the purpose is distinct enough that context is clear. Only one alternative is named, so not a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
hosts_listBRead-onlyIdempotent
List configured SSH hosts and their workspace, authentication summary, isolation, and current user-controlled global-mode state. Never returns secrets.
| Name | Required | Description | Default |
|---|---|---|---|
| full_output | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly and idempotent, but the description adds valuable behavioral context: it never returns secrets and exposes isolation and global-mode state, which help an agent understand the scope of the read. This goes beyond the annotation's simple safety hints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that efficiently conveys the core purpose. It doesn't waste words, but it omits the parameter explanation, so it's not perfectly complete.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with only one optional parameter, the description covers the main action and output content, but the missing parameter semantics leaves a gap. The output schema exists, so return format is partly covered, but the full_output flag remains ambiguous, making the description only moderately complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter full_output is completely undocumented in the description. With 0% schema description coverage, the agent has no clue what full_output=true vs false does. The description fails to add any meaning for the parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states a specific verb 'List' and resource 'SSH hosts', enumerating the included details: workspace, auth summary, isolation, and global-mode state. This clearly differentiates from siblings like host_exec or shared_list, which have distinct purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool vs alternatives. It only states what it does, leaving the agent to infer usage. No mention of when not to use it or which sibling to prefer for other tasks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
host_testADestructive
Test one configured host's SSH authentication and workspace access without exposing credentials.
| Name | Required | Description | Default |
|---|---|---|---|
| host_id | Yes | ||
| timeout | No | ||
| full_output | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds a useful behavioral guarantee around not exposing credentials and specifies that the tool checks SSH authentication and workspace access. However, it does not address the destructiveHint=true annotation or explain any side effects a 'test' may have on the remote host; this is a gap but not a direct contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It states the action, target, scope, and an important security property efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is relatively simple, but the description is too sparse for fully reliable invocation: it lacks parameter semantics, usage guidance, and any mention of side effects despite destructiveHint=true. An agent can guess the required host_id, but timeout and full_output remain ambiguous.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Parameter schema coverage is 0% and the description provides no explanation of host_id, timeout, or full_output. The parameter names are somewhat self-explanatory, but the description does not clarify what timeout bounds, what full_output returns, or how host_id relates to the configured hosts list.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Test') and a specific resource scope ('one configured host's SSH authentication and workspace access'), so an agent can distinguish it from siblings like host_exec, hosts_list, and the shared/read/write tools. It also adds a clarifying constraint ('without exposing credentials').
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this is a pre-flight or connectivity check for a configured host, but it does not explicitly say when to use it versus host_exec, hosts_list, or other siblings. There is no when-to-use, when-not-to-use, or alternative-tool guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
result_readBRead-onlyIdempotent
Read a cached tool result without rerunning it. incremental returns only content never shown to the agent; full returns a clearly marked complete copy and may repeat content.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | incremental | |
| max_chars | No | ||
| output_ref | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, so the description does not need to restate safety. It adds valuable behavioral context by explaining the incremental/full modes, including that full 'may repeat content' and is 'clearly marked,' which goes beyond the structured metadata.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences with no filler. The core purpose is front-loaded, and the mode distinction is stated efficiently without repeating schema information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Annotations and the presence of an output schema lower the burden on the description, and the mode semantics are covered. However, the tool has three parameters with zero schema descriptions, and the description only partially explains them, so an agent may not know how to obtain or populate output_ref or how max_chars affects results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for the three undocumented parameters. It explains the mode values (incremental vs. full), but it does not clarify output_ref semantics or max_chars behavior, leaving significant gaps for an agent trying to construct correct arguments.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb and resource: 'Read a cached tool result without rerunning it.' It does not explicitly distinguish this tool from sibling tools like shared_read, so it falls short of a 5, but the purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool—when a cached result exists and rerunning is undesirable—but it provides no explicit guidance on when to choose this over alternatives like shared_read, nor does it describe exclusions or prerequisites. This leaves the agent to infer the appropriate context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
9 tool updates
v0.1.0- First observed
host_exec - First observed
host_pull_to_shared - First observed
host_push_from_shared - First observed
host_test - First observed
hosts_list - First observed
result_read - First observed
shared_list - First observed
shared_read - First observed
shared_write
TDQS
Each tool targets a clearly distinct operation: file reads/writes, host listing, command execution, transfer directions, and cached result retrieval. Overlap is minimal even between similar-sounding tools like shared_read and result_read because their descriptions make the resource type explicit.
Names mostly follow a predictable <scope>_<verb> pattern: shared_read, shared_write, host_exec, result_read. The pluralized hosts_list and longer directional names like host_pull_to_shared and host_push_from_shared are minor deviations but still readable and consistent in style.
Nine tools is well-scoped for a multi-host workspace management server. Each tool covers a necessary operation without redundancy, and the set is neither too thin nor bloated.
The core workflows are covered: shared workspace read/write/list, host discovery/test/execution, bidirectional transfer, and cached result retrieval. Minor gaps exist, such as no explicit shared-delete or host-side file listing tool, but these are workaroundable via host_exec and overwrite semantics.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Run commands and read/write files on your servers over Termalin's keyless tunnels (hosted MCP).
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseAqualityAmaintenanceA server that enables secure interaction with remote SSH hosts through standardized MCP interface, providing functions like listing hosts, executing commands, and transferring files using native SSH tools.742796MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables remote SSH command execution and bidirectional file transfers through a standardized interface. It allows AI assistants to securely manage remote servers while keeping credentials isolated and applying command-level security controls.ISC
- AlicenseAqualityBmaintenanceMCP server for managing remote servers via SSH, enabling command execution, file transfer, rsync, tunnels, health checks, backups, and database operations.172,1171MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for managing remote SSH servers, enabling AI agents to execute commands, transfer files, and perform deployment operations securely.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LusiyAvA/msaw'
If you have feedback or need assistance with the MCP directory API, please join our Discord server