ssh-agent-workspace 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,6 @@ Your agent gets a **real interactive terminal** — not one-off exec commands. I
|
|
|
64
64
|
| **Prompt detection** | Deterministic custom PS1 | Blind sleep + guess |
|
|
65
65
|
| **Per-host security** | runtime `host_security` tool | Env vars only, restart required |
|
|
66
66
|
| **Tool management** | runtime `tools_config` (persistent) | None or env vars |
|
|
67
|
-
| **Token efficiency** | ~2,800 tokens (25 tools) | ~43,500 tokens (37 tools) |
|
|
68
67
|
|
|
69
68
|
---
|
|
70
69
|
|
|
@@ -79,34 +78,128 @@ npm install -g ssh-agent-workspace
|
|
|
79
78
|
Or from source:
|
|
80
79
|
|
|
81
80
|
```bash
|
|
82
|
-
git clone https://github.com/ShiroNexo/
|
|
83
|
-
cd
|
|
81
|
+
git clone https://github.com/ShiroNexo/ssh-agent-workspace.git
|
|
82
|
+
cd ssh-agent-workspace
|
|
84
83
|
npm install && npm run build
|
|
85
84
|
```
|
|
86
85
|
|
|
87
|
-
###
|
|
86
|
+
### Setup Your SSH Config
|
|
87
|
+
|
|
88
|
+
Hosts must be defined in `~/.ssh/config`:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Host prod
|
|
92
|
+
HostName 10.0.0.5
|
|
93
|
+
User deploy
|
|
94
|
+
IdentityFile ~/.ssh/id_ed25519
|
|
95
|
+
|
|
96
|
+
Host staging
|
|
97
|
+
HostName 10.0.0.10
|
|
98
|
+
User deploy
|
|
99
|
+
IdentityFile ~/.ssh/id_ed25519
|
|
100
|
+
|
|
101
|
+
Host internal
|
|
102
|
+
HostName 172.16.0.50
|
|
103
|
+
User admin
|
|
104
|
+
ProxyJump bastion
|
|
105
|
+
|
|
106
|
+
Host bastion
|
|
107
|
+
HostName jump.example.com
|
|
108
|
+
User jumpuser
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Try It
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
> connect host=prod
|
|
115
|
+
→ { session_id: "sess_abc", tmux_session: "mcp_prod_x1y2z3" }
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Your agent now has a persistent workspace on `prod`.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### Add to Your MCP Client
|
|
123
|
+
|
|
124
|
+
#### OpenCode
|
|
125
|
+
|
|
126
|
+
Add to `opencode.json`:
|
|
88
127
|
|
|
89
128
|
```json
|
|
90
129
|
{
|
|
91
130
|
"mcpServers": {
|
|
92
131
|
"workspace": {
|
|
93
132
|
"command": "node",
|
|
94
|
-
"args": ["/path/to/dist/index.js"]
|
|
95
|
-
"env": {
|
|
96
|
-
"MCP_SSH_RESTORE_SESSIONS": "true"
|
|
97
|
-
}
|
|
133
|
+
"args": ["/path/to/ssh-agent-workspace/dist/index.js"]
|
|
98
134
|
}
|
|
99
135
|
}
|
|
100
136
|
}
|
|
101
137
|
```
|
|
102
138
|
|
|
103
|
-
|
|
139
|
+
Or via CLI:
|
|
104
140
|
|
|
141
|
+
```bash
|
|
142
|
+
opencode mcp add workspace -- node /path/to/ssh-agent-workspace/dist/index.js
|
|
105
143
|
```
|
|
106
|
-
|
|
107
|
-
|
|
144
|
+
|
|
145
|
+
#### Claude Code
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
claude mcp add workspace -- node /path/to/ssh-agent-workspace/dist/index.js
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Or add to Claude Code config (`~/.config/claude-code/claude_code_config.json` or project `.mcp.json`):
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"mcpServers": {
|
|
156
|
+
"workspace": {
|
|
157
|
+
"command": "node",
|
|
158
|
+
"args": ["/path/to/ssh-agent-workspace/dist/index.js"],
|
|
159
|
+
"autoApprove": [
|
|
160
|
+
"mcp__workspace__connect",
|
|
161
|
+
"mcp__workspace__exec",
|
|
162
|
+
"mcp__workspace__send_input",
|
|
163
|
+
"mcp__workspace__read_output",
|
|
164
|
+
"mcp__workspace__list_hosts",
|
|
165
|
+
"mcp__workspace__list_sessions",
|
|
166
|
+
"mcp__workspace__sftp_upload",
|
|
167
|
+
"mcp__workspace__sftp_download",
|
|
168
|
+
"mcp__workspace__sftp_list"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Tip:** The `autoApprove` block lets the agent use those tools without asking you for permission each time. Add or remove tools based on your comfort level.
|
|
176
|
+
|
|
177
|
+
#### Cursor / Windsurf / Generic MCP
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"mcpServers": {
|
|
182
|
+
"workspace": {
|
|
183
|
+
"command": "node",
|
|
184
|
+
"args": ["/path/to/ssh-agent-workspace/dist/index.js"]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### If Using npx (no global install)
|
|
191
|
+
|
|
192
|
+
Replace `"command": "node"` and `"args"` with:
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"command": "npx",
|
|
197
|
+
"args": ["-y", "ssh-agent-workspace"]
|
|
198
|
+
}
|
|
108
199
|
```
|
|
109
200
|
|
|
201
|
+
npx will download and run the latest version automatically.
|
|
202
|
+
|
|
110
203
|
Your agent now has a persistent workspace on `prod`. Running `cd /var/www` once means the agent stays there for every subsequent command.
|
|
111
204
|
|
|
112
205
|
---
|
|
@@ -263,25 +356,6 @@ No restart needed. Changes apply immediately.
|
|
|
263
356
|
| `MCP_SSH_DENYLIST_COMMANDS` | `(none)` | Global command blocklist |
|
|
264
357
|
| `MCP_SSH_RESTORE_SESSIONS` | `true` | Auto-restore workspaces on startup |
|
|
265
358
|
|
|
266
|
-
### SSH Config
|
|
267
|
-
|
|
268
|
-
Hosts must be defined in `~/.ssh/config`:
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
Host prod
|
|
272
|
-
HostName 10.0.0.5
|
|
273
|
-
User deploy
|
|
274
|
-
IdentityFile ~/.ssh/id_ed25519
|
|
275
|
-
|
|
276
|
-
Host internal
|
|
277
|
-
HostName 172.16.0.50
|
|
278
|
-
User admin
|
|
279
|
-
ProxyJump bastion
|
|
280
|
-
|
|
281
|
-
Host bastion
|
|
282
|
-
HostName jump.example.com
|
|
283
|
-
User jumpuser
|
|
284
|
-
```
|
|
285
359
|
---
|
|
286
360
|
|
|
287
361
|
## Project Structure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ssh-agent-workspace",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Persistent SSH workspaces for AI agents. Stateful tmux-backed sessions that survive reconnects, restarts, and network drops — with runtime security and tool configuration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|