ssh-agent-workspace 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +173 -32
  2. 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
 
@@ -72,41 +71,202 @@ Your agent gets a **real interactive terminal** — not one-off exec commands. I
72
71
 
73
72
  ### Install
74
73
 
74
+ npx auto-downloads and runs the latest version. Or install globally:
75
+
75
76
  ```bash
76
77
  npm install -g ssh-agent-workspace
77
78
  ```
78
79
 
79
- Or from source:
80
+ From source:
80
81
 
81
82
  ```bash
82
- git clone https://github.com/ShiroNexo/dynamic-ssh-mcp.git
83
- cd dynamic-ssh-mcp
83
+ git clone https://github.com/ShiroNexo/ssh-agent-workspace.git
84
+ cd ssh-agent-workspace
84
85
  npm install && npm run build
85
86
  ```
86
87
 
87
- ### Configure MCP Client
88
+ ### Setup Your SSH Config
89
+
90
+ Hosts must be defined in `~/.ssh/config`:
91
+
92
+ ```
93
+ Host prod
94
+ HostName 10.0.0.5
95
+ User deploy
96
+ IdentityFile ~/.ssh/id_ed25519
97
+
98
+ Host staging
99
+ HostName 10.0.0.10
100
+ User deploy
101
+ IdentityFile ~/.ssh/id_ed25519
102
+
103
+ Host internal
104
+ HostName 172.16.0.50
105
+ User admin
106
+ ProxyJump bastion
107
+
108
+ Host bastion
109
+ HostName jump.example.com
110
+ User jumpuser
111
+ ```
112
+
113
+ ### Try It
114
+
115
+ ```
116
+ > connect host=prod
117
+ → { session_id: "sess_abc", tmux_session: "mcp_prod_x1y2z3" }
118
+ ```
119
+
120
+ Your agent now has a persistent workspace on `prod`.
121
+
122
+ ---
123
+
124
+ ### Add to Your MCP Client
125
+
126
+ Pick your client:
127
+
128
+ #### OpenCode
129
+
130
+ Add to `~/.config/opencode/opencode.json`:
131
+
132
+ ```json
133
+ {
134
+ "$schema": "https://opencode.ai/config.json",
135
+ "mcp": {
136
+ "workspace": {
137
+ "type": "local",
138
+ "command": ["npx", "-y", "ssh-agent-workspace"]
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ Or via CLI:
145
+
146
+ ```bash
147
+ opencode mcp add workspace -- npx -y ssh-agent-workspace
148
+ ```
149
+
150
+ #### Claude Code
151
+
152
+ ```bash
153
+ claude mcp add workspace -- npx -y ssh-agent-workspace
154
+ ```
155
+
156
+ Or add to `~/.config/claude-code/claude_code_config.json` or project `.mcp.json`:
88
157
 
89
158
  ```json
90
159
  {
91
160
  "mcpServers": {
92
161
  "workspace": {
93
- "command": "node",
94
- "args": ["/path/to/dist/index.js"],
95
- "env": {
96
- "MCP_SSH_RESTORE_SESSIONS": "true"
97
- }
162
+ "command": "npx",
163
+ "args": ["-y", "ssh-agent-workspace"],
164
+ "autoApprove": [
165
+ "mcp__workspace__connect",
166
+ "mcp__workspace__exec",
167
+ "mcp__workspace__send_input",
168
+ "mcp__workspace__read_output",
169
+ "mcp__workspace__list_hosts",
170
+ "mcp__workspace__list_sessions",
171
+ "mcp__workspace__sftp_upload",
172
+ "mcp__workspace__sftp_download",
173
+ "mcp__workspace__sftp_list"
174
+ ]
98
175
  }
99
176
  }
100
177
  }
101
178
  ```
102
179
 
103
- ### First session
180
+ **Tip:** The `autoApprove` block lets the agent use those tools without asking permission each time. Add or remove tools based on your comfort level.
181
+
182
+ #### Cursor
104
183
 
184
+ Go to `Cursor Settings` → `MCP` → `New MCP Server`. Use this config:
185
+
186
+ ```json
187
+ {
188
+ "mcpServers": {
189
+ "workspace": {
190
+ "command": "npx",
191
+ "args": ["-y", "ssh-agent-workspace"]
192
+ }
193
+ }
194
+ }
105
195
  ```
106
- > connect host=prod
107
- { session_id: "sess_abc", tmux_session: "mcp_prod_x1y2z3" }
196
+
197
+ #### Codex (OpenAI)
198
+
199
+ ```bash
200
+ codex mcp add workspace -- npx -y ssh-agent-workspace
201
+ ```
202
+
203
+ Or add to `~/.codex/config.toml`:
204
+
205
+ ```toml
206
+ [mcp_servers.workspace]
207
+ command = "npx"
208
+ args = ["-y", "ssh-agent-workspace"]
209
+ ```
210
+
211
+ #### Windsurf
212
+
213
+ Add to `~/.codeium/windsurf/mcp_config.json`:
214
+
215
+ ```json
216
+ {
217
+ "mcpServers": {
218
+ "workspace": {
219
+ "command": "npx",
220
+ "args": ["-y", "ssh-agent-workspace"]
221
+ }
222
+ }
223
+ }
224
+ ```
225
+
226
+ #### Copilot / VS Code
227
+
228
+ ```json
229
+ {
230
+ "mcpServers": {
231
+ "workspace": {
232
+ "command": "npx",
233
+ "args": ["-y", "ssh-agent-workspace"]
234
+ }
235
+ }
236
+ }
237
+ ```
238
+
239
+ #### Gemini CLI
240
+
241
+ ```bash
242
+ gemini mcp add workspace npx -y ssh-agent-workspace
243
+ ```
244
+
245
+ #### Cline
246
+
247
+ ```json
248
+ {
249
+ "mcpServers": {
250
+ "workspace": {
251
+ "command": "npx",
252
+ "args": ["-y", "ssh-agent-workspace"]
253
+ }
254
+ }
255
+ }
256
+ ```
257
+
258
+ #### Qoder
259
+
260
+ ```bash
261
+ qodercli mcp add workspace -- npx -y ssh-agent-workspace
108
262
  ```
109
263
 
264
+ #### Using npx
265
+
266
+ All examples above use `npx` which auto-downloads the latest version. No global install needed.
267
+
268
+ If you installed globally (`npm install -g ssh-agent-workspace`), replace `"npx"` / `"-y"` / `"ssh-agent-workspace"` with `"ssh-agent-workspace"` as the command directly.
269
+
110
270
  Your agent now has a persistent workspace on `prod`. Running `cd /var/www` once means the agent stays there for every subsequent command.
111
271
 
112
272
  ---
@@ -263,25 +423,6 @@ No restart needed. Changes apply immediately.
263
423
  | `MCP_SSH_DENYLIST_COMMANDS` | `(none)` | Global command blocklist |
264
424
  | `MCP_SSH_RESTORE_SESSIONS` | `true` | Auto-restore workspaces on startup |
265
425
 
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
426
  ---
286
427
 
287
428
  ## Project Structure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssh-agent-workspace",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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",