smart-terminal-mcp 1.2.27 → 1.2.30
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/.claude/settings.local.json +2 -1
- package/CHANGELOG.md +12 -0
- package/README.md +114 -49
- package/package.json +5 -5
- package/scripts/publish.js +1 -1
- package/server-card.json +306 -0
- package/server.json +2 -2
- package/smithery.json +1 -1
- package/src/index.js +2 -2
- package/src/pty-session.js +1 -1
- package/src/tools.js +155 -91
- package/test/tools.test.js +151 -60
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.2.29] - 2026-04-03
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`terminal_extra` meta-tool**: Convenience tools (`terminal_run_paged`, `terminal_retry`, `terminal_diff`, `terminal_resize`, `terminal_send_key`, `terminal_get_history`, `terminal_write_file`) are now collected behind a single lightweight meta-tool by default, reducing tool definition token overhead by ~50%. The agent can discover schemas via `list: true` and call any extra tool through `terminal_extra`.
|
|
9
|
+
- **`SMART_TERMINAL_DISABLED_TOOLS` env var**: Customize which tools are moved behind `terminal_extra`. Set to empty string to register all 15 tools with full schemas.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Stripped redundant `.describe()` calls from tool parameter schemas where the parameter name is self-documenting (e.g. `sessionId`, `command`, `cwd`, `timeout`). Keeps only 6 essential descriptions for non-obvious parameters.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- Fixed `terminal_start` test that expected auto-detect hint when no shell was explicitly provided.
|
|
16
|
+
|
|
5
17
|
## [1.2.12] - 2026-03-08
|
|
6
18
|
|
|
7
19
|
### Added
|
package/README.md
CHANGED
|
@@ -68,6 +68,55 @@ The main benefit is **model-context efficiency**, not guaranteed savings in the
|
|
|
68
68
|
|
|
69
69
|
In practice, this lets agents inspect terminal state more selectively instead of repeatedly dumping large logs back into the conversation.
|
|
70
70
|
|
|
71
|
+
### Reducing tool definition overhead
|
|
72
|
+
|
|
73
|
+
By default, the 8 most-used tools are registered with full schemas and 7 convenience tools are collected behind a single lightweight `terminal_extra` meta-tool (~30 tokens instead of ~1,500).
|
|
74
|
+
|
|
75
|
+
**Default core tools**: `terminal_start`, `terminal_exec`, `terminal_run`, `terminal_read`, `terminal_write`, `terminal_wait`, `terminal_stop`, `terminal_list`
|
|
76
|
+
|
|
77
|
+
**Default extra tools** (behind `terminal_extra`): `terminal_run_paged`, `terminal_retry`, `terminal_diff`, `terminal_resize`, `terminal_send_key`, `terminal_get_history`, `terminal_write_file`
|
|
78
|
+
|
|
79
|
+
Extra tools are **not hidden** — the agent sees the tool names in the `terminal_extra` description and can:
|
|
80
|
+
|
|
81
|
+
- **Discover schemas**: `terminal_extra({ list: true })` → returns full parameter schemas
|
|
82
|
+
- **Call any extra tool**: `terminal_extra({ tool: "terminal_resize", args: { sessionId: "...", cols: 200, rows: 50 } })`
|
|
83
|
+
|
|
84
|
+
Use `SMART_TERMINAL_DISABLED_TOOLS` to customize which tools are extra, or set it to an empty string to register all 15 tools with full schemas:
|
|
85
|
+
|
|
86
|
+
**All tools with full schemas** (no meta-tool):
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"mcpServers": {
|
|
91
|
+
"smart-terminal": {
|
|
92
|
+
"command": "npx",
|
|
93
|
+
"args": ["-y", "smart-terminal-mcp@stable"],
|
|
94
|
+
"env": { "SMART_TERMINAL_DISABLED_TOOLS": "" }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Minimal setup** — only `terminal_exec` for simple command execution:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
"env": {
|
|
104
|
+
"SMART_TERMINAL_DISABLED_TOOLS": "terminal_run,terminal_run_paged,terminal_retry,terminal_diff,terminal_write_file,terminal_resize,terminal_send_key,terminal_get_history"
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
5 core tools + `terminal_extra` holding 10 tools on demand.
|
|
109
|
+
|
|
110
|
+
**Agent-focused setup** — `terminal_run` instead of `terminal_exec`:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
"env": {
|
|
114
|
+
"SMART_TERMINAL_DISABLED_TOOLS": "terminal_exec,terminal_diff,terminal_retry,terminal_resize,terminal_send_key,terminal_write,terminal_read,terminal_get_history"
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
7 core tools + `terminal_extra` holding 8 tools on demand.
|
|
119
|
+
|
|
71
120
|
## Installation
|
|
72
121
|
|
|
73
122
|
Recommended: run the stable release directly via `npx`:
|
|
@@ -134,6 +183,10 @@ If you want to pin an exact release instead of following the stable tag, replace
|
|
|
134
183
|
|
|
135
184
|
## Tools
|
|
136
185
|
|
|
186
|
+
By default, 8 core tools are registered with full schemas and 7 convenience tools are available on demand via `terminal_extra` (see [Reducing tool definition overhead](#reducing-tool-definition-overhead)).
|
|
187
|
+
|
|
188
|
+
### Core tools
|
|
189
|
+
|
|
137
190
|
### `terminal_start`
|
|
138
191
|
|
|
139
192
|
Start a new interactive terminal session.
|
|
@@ -182,23 +235,6 @@ Run a one-shot non-interactive command using `cmd + args` with `shell=false`. Sa
|
|
|
182
235
|
|
|
183
236
|
**Returns**: `ok`, `cmd`, `args`, `cwd`, `exitCode`, `timedOut`, `durationMs`, `stdout.raw`, `stdout.parsed`, optional `stdout.summary`, `stderr.raw`, optional `checks`, optional `hint`
|
|
184
237
|
|
|
185
|
-
### `terminal_run_paged`
|
|
186
|
-
|
|
187
|
-
Run a read-only one-shot command using `cmd + args` with `shell=false` and return a single page of stdout lines from the captured output. This pages the returned result instead of using head + tail truncation. Paged mode does not parse partial output, but it can return a concise summary for supported read-only commands when `summary: true`.
|
|
188
|
-
|
|
189
|
-
| Param | Type | Default | Description |
|
|
190
|
-
|-------|------|---------|-------------|
|
|
191
|
-
| `cmd` | string | *required* | Read-only executable to run |
|
|
192
|
-
| `args` | string[] | `[]` | Argument array passed directly to the executable |
|
|
193
|
-
| `cwd` | string | server CWD | Working directory |
|
|
194
|
-
| `timeout` | number | 30000 | Timeout in ms |
|
|
195
|
-
| `maxOutputBytes` | number | 102400 | Max combined stdout/stderr bytes to capture |
|
|
196
|
-
| `page` | number | 0 | 0-indexed page number |
|
|
197
|
-
| `pageSize` | number | 100 | Lines per page |
|
|
198
|
-
| `summary` | boolean | `false` | Return a concise summary when supported |
|
|
199
|
-
|
|
200
|
-
**Returns**: Same envelope as `terminal_run`, plus `pageInfo.page`, `pageInfo.pageSize`, `pageInfo.totalLines`, `pageInfo.hasNext`
|
|
201
|
-
|
|
202
238
|
### `terminal_write`
|
|
203
239
|
|
|
204
240
|
Write raw data to a terminal (for interactive programs). Follow with `terminal_read`.
|
|
@@ -221,20 +257,51 @@ Read buffered output with idle detection. Large outputs are truncated to head +
|
|
|
221
257
|
|
|
222
258
|
**Returns**: `output`, `timedOut`
|
|
223
259
|
|
|
224
|
-
### `
|
|
260
|
+
### `terminal_wait`
|
|
225
261
|
|
|
226
|
-
|
|
262
|
+
Wait for a specific pattern in the output stream. By default, responses return only the last `tailLines`; use `returnMode: "full"` for the full matched output or `"match-only"` to suppress output entirely. If the MCP client sends a `progressToken`, long-running waits may also emit best-effort `notifications/progress` updates.
|
|
227
263
|
|
|
228
264
|
| Param | Type | Default | Description |
|
|
229
265
|
|-------|------|---------|-------------|
|
|
230
266
|
| `sessionId` | string | *required* | Session ID |
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
267
|
+
| `pattern` | string | *required* | String or regex pattern |
|
|
268
|
+
| `timeout` | number | 30000 | Timeout in ms |
|
|
269
|
+
| `returnMode` | string | `"tail"` | Response mode: `tail`, `full`, `match-only` |
|
|
270
|
+
| `tailLines` | number | 50 | Number of tail lines to return |
|
|
234
271
|
|
|
235
|
-
**Returns**: `
|
|
272
|
+
**Returns**: `output`, `matched`, `timedOut` (`output` may be empty in `match-only` mode)
|
|
273
|
+
|
|
274
|
+
### `terminal_stop`
|
|
275
|
+
|
|
276
|
+
Stop and clean up a terminal session.
|
|
277
|
+
|
|
278
|
+
| Param | Type | Description |
|
|
279
|
+
|-------|------|-------------|
|
|
280
|
+
| `sessionId` | string | Session ID to stop |
|
|
281
|
+
|
|
282
|
+
### `terminal_list`
|
|
283
|
+
|
|
284
|
+
List all active terminal sessions.
|
|
285
|
+
|
|
286
|
+
| Param | Type | Default | Description |
|
|
287
|
+
|-------|------|---------|-------------|
|
|
288
|
+
| `verbose` | boolean | `true` | Include full metadata |
|
|
289
|
+
|
|
290
|
+
**Returns**: `sessions`, `count` (`verbose: false` returns `id`, `name`, `cwd`, `alive`, `busy` only)
|
|
291
|
+
|
|
292
|
+
### Extra tools (via `terminal_extra`)
|
|
293
|
+
|
|
294
|
+
The following tools are available by default through the `terminal_extra` meta-tool. The agent can discover their schemas via `terminal_extra({ list: true })` and call them via `terminal_extra({ tool: "<name>", args: { ... } })`.
|
|
295
|
+
|
|
296
|
+
### `terminal_extra`
|
|
297
|
+
|
|
298
|
+
Meta-tool for discovering and calling extra tools.
|
|
236
299
|
|
|
237
|
-
|
|
300
|
+
| Param | Type | Default | Description |
|
|
301
|
+
|-------|------|---------|-------------|
|
|
302
|
+
| `list` | boolean | `false` | Return full parameter schemas for all extra tools |
|
|
303
|
+
| `tool` | string | -- | Name of the extra tool to call |
|
|
304
|
+
| `args` | object | -- | Arguments to pass to the extra tool |
|
|
238
305
|
|
|
239
306
|
### `terminal_send_key`
|
|
240
307
|
|
|
@@ -247,19 +314,35 @@ Send a named special key.
|
|
|
247
314
|
|
|
248
315
|
**Supported keys**: `ctrl+c`, `ctrl+d`, `ctrl+z`, `ctrl+l`, `ctrl+a`, `ctrl+e`, `ctrl+u`, `ctrl+k`, `ctrl+w`, `tab`, `enter`, `escape`, `up`, `down`, `left`, `right`, `home`, `end`, `pageup`, `pagedown`, `backspace`, `delete`, `f1`-`f12`
|
|
249
316
|
|
|
250
|
-
### `
|
|
317
|
+
### `terminal_run_paged`
|
|
251
318
|
|
|
252
|
-
|
|
319
|
+
Run a read-only one-shot command using `cmd + args` with `shell=false` and return a single page of stdout lines from the captured output. This pages the returned result instead of using head + tail truncation. Paged mode does not parse partial output, but it can return a concise summary for supported read-only commands when `summary: true`.
|
|
253
320
|
|
|
254
321
|
| Param | Type | Default | Description |
|
|
255
322
|
|-------|------|---------|-------------|
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
323
|
+
| `cmd` | string | *required* | Read-only executable to run |
|
|
324
|
+
| `args` | string[] | `[]` | Argument array passed directly to the executable |
|
|
325
|
+
| `cwd` | string | server CWD | Working directory |
|
|
258
326
|
| `timeout` | number | 30000 | Timeout in ms |
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
327
|
+
| `maxOutputBytes` | number | 102400 | Max combined stdout/stderr bytes to capture |
|
|
328
|
+
| `page` | number | 0 | 0-indexed page number |
|
|
329
|
+
| `pageSize` | number | 100 | Lines per page |
|
|
330
|
+
| `summary` | boolean | `false` | Return a concise summary when supported |
|
|
261
331
|
|
|
262
|
-
**Returns**: `
|
|
332
|
+
**Returns**: Same envelope as `terminal_run`, plus `pageInfo.page`, `pageInfo.pageSize`, `pageInfo.totalLines`, `pageInfo.hasNext`
|
|
333
|
+
|
|
334
|
+
### `terminal_get_history`
|
|
335
|
+
|
|
336
|
+
Retrieve past terminal output without consuming it. Non-destructive — returns historical output from a rolling buffer (last ~10,000 lines). Useful for reviewing output that was already read or missed.
|
|
337
|
+
|
|
338
|
+
| Param | Type | Default | Description |
|
|
339
|
+
|-------|------|---------|-------------|
|
|
340
|
+
| `sessionId` | string | *required* | Session ID |
|
|
341
|
+
| `offset` | number | 0 | Lines to skip from the end (0 = most recent). Use for pagination. |
|
|
342
|
+
| `maxLines` | number | 200 | Max lines to return |
|
|
343
|
+
| `format` | string | `"lines"` | Response format: `lines` or `text` |
|
|
344
|
+
|
|
345
|
+
**Returns**: `lines` or `text`, plus `totalLines`, `returnedFrom`, `returnedTo`
|
|
263
346
|
|
|
264
347
|
### `terminal_retry`
|
|
265
348
|
|
|
@@ -304,14 +387,6 @@ Resize terminal dimensions.
|
|
|
304
387
|
| `cols` | number | New width |
|
|
305
388
|
| `rows` | number | New height |
|
|
306
389
|
|
|
307
|
-
### `terminal_stop`
|
|
308
|
-
|
|
309
|
-
Stop and clean up a terminal session.
|
|
310
|
-
|
|
311
|
-
| Param | Type | Description |
|
|
312
|
-
|-------|------|-------------|
|
|
313
|
-
| `sessionId` | string | Session ID to stop |
|
|
314
|
-
|
|
315
390
|
### `terminal_write_file`
|
|
316
391
|
|
|
317
392
|
Write content directly to a file on disk. Resolves paths relative to the session's CWD. Safer and more robust than piping content through `echo` — handles special characters, newlines, and large files correctly.
|
|
@@ -326,16 +401,6 @@ Write content directly to a file on disk. Resolves paths relative to the session
|
|
|
326
401
|
|
|
327
402
|
**Returns**: `success`, `path` (absolute), `size` (bytes), `append`
|
|
328
403
|
|
|
329
|
-
### `terminal_list`
|
|
330
|
-
|
|
331
|
-
List all active terminal sessions.
|
|
332
|
-
|
|
333
|
-
| Param | Type | Default | Description |
|
|
334
|
-
|-------|------|---------|-------------|
|
|
335
|
-
| `verbose` | boolean | `true` | Include full metadata |
|
|
336
|
-
|
|
337
|
-
**Returns**: `sessions`, `count` (`verbose: false` returns `id`, `name`, `cwd`, `alive`, `busy` only)
|
|
338
|
-
|
|
339
404
|
## Usage Examples
|
|
340
405
|
|
|
341
406
|
### Run a command
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smart-terminal-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.30",
|
|
4
4
|
"description": "MCP PTY server providing AI agents with real interactive terminal access",
|
|
5
5
|
"mcpName": "io.github.pungggi/smart-terminal",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"start": "node src/index.js",
|
|
17
17
|
"test": "node --test",
|
|
18
|
-
"stable": "npm dist-tag add smart-terminal-mcp@1.2.
|
|
18
|
+
"stable": "npm dist-tag add smart-terminal-mcp@1.2.29 stable",
|
|
19
19
|
"release": "node scripts/publish.js"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
31
31
|
"node-pty": "^1.1.0",
|
|
32
32
|
"zod": "^3.25.76"
|
|
33
33
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@babel/parser": "^7.29.0",
|
|
37
37
|
"@babel/traverse": "^7.29.0",
|
|
38
38
|
"@babel/types": "^7.29.0",
|
|
39
|
-
"@smithery/cli": "^4.
|
|
40
|
-
"esbuild": "^0.
|
|
39
|
+
"@smithery/cli": "^4.7.4",
|
|
40
|
+
"esbuild": "^0.28.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/scripts/publish.js
CHANGED
package/server-card.json
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
{
|
|
2
|
+
"serverInfo": {
|
|
3
|
+
"name": "smart-terminal-mcp",
|
|
4
|
+
"version": "1.2.30"
|
|
5
|
+
},
|
|
6
|
+
"tools": [
|
|
7
|
+
{
|
|
8
|
+
"name": "terminal_start",
|
|
9
|
+
"description": "Start a terminal session. Auto-detects shell if omitted.",
|
|
10
|
+
"inputSchema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"shell": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"cols": {
|
|
17
|
+
"type": "integer",
|
|
18
|
+
"minimum": 20,
|
|
19
|
+
"maximum": 500,
|
|
20
|
+
"default": 120
|
|
21
|
+
},
|
|
22
|
+
"rows": {
|
|
23
|
+
"type": "integer",
|
|
24
|
+
"minimum": 5,
|
|
25
|
+
"maximum": 200,
|
|
26
|
+
"default": 30
|
|
27
|
+
},
|
|
28
|
+
"cwd": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"name": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"env": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "terminal_exec",
|
|
47
|
+
"description": "Run a command in a session and wait for completion.",
|
|
48
|
+
"inputSchema": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"sessionId": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"command": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"timeout": {
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"minimum": 1000,
|
|
60
|
+
"maximum": 600000,
|
|
61
|
+
"default": 30000
|
|
62
|
+
},
|
|
63
|
+
"maxLines": {
|
|
64
|
+
"type": "integer",
|
|
65
|
+
"minimum": 10,
|
|
66
|
+
"maximum": 10000,
|
|
67
|
+
"default": 200
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": [
|
|
71
|
+
"sessionId",
|
|
72
|
+
"command"
|
|
73
|
+
],
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "terminal_run",
|
|
80
|
+
"description": "Run a binary directly; no shell quoting needed.",
|
|
81
|
+
"inputSchema": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"cmd": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"args": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"default": []
|
|
93
|
+
},
|
|
94
|
+
"cwd": {
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
"timeout": {
|
|
98
|
+
"type": "integer",
|
|
99
|
+
"minimum": 1000,
|
|
100
|
+
"maximum": 600000,
|
|
101
|
+
"default": 30000
|
|
102
|
+
},
|
|
103
|
+
"maxOutputBytes": {
|
|
104
|
+
"type": "integer",
|
|
105
|
+
"minimum": 1024,
|
|
106
|
+
"maximum": 1048576,
|
|
107
|
+
"default": 102400
|
|
108
|
+
},
|
|
109
|
+
"parse": {
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"default": true,
|
|
112
|
+
"description": "Parse structured output"
|
|
113
|
+
},
|
|
114
|
+
"parseOnly": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"default": false,
|
|
117
|
+
"description": "Omit raw when parsed"
|
|
118
|
+
},
|
|
119
|
+
"summary": {
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"default": false
|
|
122
|
+
},
|
|
123
|
+
"successExitCode": {
|
|
124
|
+
"anyOf": [
|
|
125
|
+
{
|
|
126
|
+
"type": "integer"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"type": "null"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"default": 0,
|
|
133
|
+
"description": "null=any"
|
|
134
|
+
},
|
|
135
|
+
"successFile": {
|
|
136
|
+
"type": "string"
|
|
137
|
+
},
|
|
138
|
+
"successFilePattern": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"description": "Regex"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"required": [
|
|
144
|
+
"cmd"
|
|
145
|
+
],
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "terminal_write",
|
|
152
|
+
"description": "Write raw data to a terminal session.",
|
|
153
|
+
"inputSchema": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"sessionId": {
|
|
157
|
+
"type": "string"
|
|
158
|
+
},
|
|
159
|
+
"data": {
|
|
160
|
+
"type": "string"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"required": [
|
|
164
|
+
"sessionId",
|
|
165
|
+
"data"
|
|
166
|
+
],
|
|
167
|
+
"additionalProperties": false,
|
|
168
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "terminal_read",
|
|
173
|
+
"description": "Read new output from a terminal session.",
|
|
174
|
+
"inputSchema": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"properties": {
|
|
177
|
+
"sessionId": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
},
|
|
180
|
+
"timeout": {
|
|
181
|
+
"type": "integer",
|
|
182
|
+
"minimum": 500,
|
|
183
|
+
"maximum": 300000,
|
|
184
|
+
"default": 30000
|
|
185
|
+
},
|
|
186
|
+
"idleTimeout": {
|
|
187
|
+
"type": "integer",
|
|
188
|
+
"minimum": 100,
|
|
189
|
+
"maximum": 10000,
|
|
190
|
+
"default": 500,
|
|
191
|
+
"description": "Must be < timeout"
|
|
192
|
+
},
|
|
193
|
+
"maxLines": {
|
|
194
|
+
"type": "integer",
|
|
195
|
+
"minimum": 10,
|
|
196
|
+
"maximum": 10000,
|
|
197
|
+
"default": 200
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"required": [
|
|
201
|
+
"sessionId"
|
|
202
|
+
],
|
|
203
|
+
"additionalProperties": false,
|
|
204
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "terminal_wait",
|
|
209
|
+
"description": "Wait for a pattern to appear in terminal output.",
|
|
210
|
+
"inputSchema": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {
|
|
213
|
+
"sessionId": {
|
|
214
|
+
"type": "string"
|
|
215
|
+
},
|
|
216
|
+
"pattern": {
|
|
217
|
+
"type": "string"
|
|
218
|
+
},
|
|
219
|
+
"timeout": {
|
|
220
|
+
"type": "integer",
|
|
221
|
+
"minimum": 1000,
|
|
222
|
+
"maximum": 600000,
|
|
223
|
+
"default": 30000
|
|
224
|
+
},
|
|
225
|
+
"returnMode": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"enum": [
|
|
228
|
+
"tail",
|
|
229
|
+
"full",
|
|
230
|
+
"match-only"
|
|
231
|
+
],
|
|
232
|
+
"default": "tail"
|
|
233
|
+
},
|
|
234
|
+
"tailLines": {
|
|
235
|
+
"type": "integer",
|
|
236
|
+
"minimum": 1,
|
|
237
|
+
"maximum": 1000,
|
|
238
|
+
"default": 50
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"required": [
|
|
242
|
+
"sessionId",
|
|
243
|
+
"pattern"
|
|
244
|
+
],
|
|
245
|
+
"additionalProperties": false,
|
|
246
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "terminal_stop",
|
|
251
|
+
"description": "Stop a terminal session.",
|
|
252
|
+
"inputSchema": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"sessionId": {
|
|
256
|
+
"type": "string"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"required": [
|
|
260
|
+
"sessionId"
|
|
261
|
+
],
|
|
262
|
+
"additionalProperties": false,
|
|
263
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "terminal_list",
|
|
268
|
+
"description": "List active terminal sessions.",
|
|
269
|
+
"inputSchema": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"properties": {
|
|
272
|
+
"verbose": {
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"default": true
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"additionalProperties": false,
|
|
278
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "terminal_extra",
|
|
283
|
+
"description": "7 more tools: terminal_run_paged, terminal_get_history, terminal_resize, terminal_send_key, terminal_retry, terminal_diff, terminal_write_file. list=true for full schemas, or pass tool + args to call.",
|
|
284
|
+
"inputSchema": {
|
|
285
|
+
"type": "object",
|
|
286
|
+
"properties": {
|
|
287
|
+
"list": {
|
|
288
|
+
"type": "boolean",
|
|
289
|
+
"default": false
|
|
290
|
+
},
|
|
291
|
+
"tool": {
|
|
292
|
+
"type": "string"
|
|
293
|
+
},
|
|
294
|
+
"args": {
|
|
295
|
+
"type": "object",
|
|
296
|
+
"additionalProperties": {}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"additionalProperties": false,
|
|
300
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"resources": [],
|
|
305
|
+
"prompts": []
|
|
306
|
+
}
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/pungggi/smart-terminal-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.30",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "smart-terminal-mcp",
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.30",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|
package/smithery.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pungggi/smart-terminal",
|
|
3
3
|
"description": "MCP PTY server providing AI agents with real interactive terminal access",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.30",
|
|
5
5
|
"repository": "https://github.com/pungggi/smart-terminal-mcp",
|
|
6
6
|
"tags": [
|
|
7
7
|
"terminal",
|
package/src/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const log = (msg) => process.stderr.write(`[smart-terminal-mcp] ${msg}\n`);
|
|
|
10
10
|
export function createSandboxServer() {
|
|
11
11
|
const server = new McpServer({
|
|
12
12
|
name: 'smart-terminal-mcp',
|
|
13
|
-
version: '1.2.
|
|
13
|
+
version: '1.2.29',
|
|
14
14
|
});
|
|
15
15
|
const manager = new SessionManager();
|
|
16
16
|
registerTools(server, manager);
|
|
@@ -22,7 +22,7 @@ async function main() {
|
|
|
22
22
|
const manager = new SessionManager();
|
|
23
23
|
const server = new McpServer({
|
|
24
24
|
name: 'smart-terminal-mcp',
|
|
25
|
-
version: '1.2.
|
|
25
|
+
version: '1.2.29',
|
|
26
26
|
});
|
|
27
27
|
registerTools(server, manager);
|
|
28
28
|
|
package/src/pty-session.js
CHANGED
|
@@ -245,7 +245,7 @@ export class PtySession {
|
|
|
245
245
|
throw new Error(`Session ${this.id} is no longer alive.`);
|
|
246
246
|
}
|
|
247
247
|
this.process.write(data);
|
|
248
|
-
if (data.includes('\x03') || data.includes('\x04')
|
|
248
|
+
if (data.includes('\x03') || data.includes('\x04')) {
|
|
249
249
|
this.busy = false;
|
|
250
250
|
this._pendingMarker = null;
|
|
251
251
|
}
|