powershell-terminal-mcp 0.1.0__tar.gz

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 (58) hide show
  1. powershell_terminal_mcp-0.1.0/LICENSE +21 -0
  2. powershell_terminal_mcp-0.1.0/MANIFEST.in +17 -0
  3. powershell_terminal_mcp-0.1.0/PKG-INFO +459 -0
  4. powershell_terminal_mcp-0.1.0/README.md +425 -0
  5. powershell_terminal_mcp-0.1.0/claude_desktop_config_example.json +11 -0
  6. powershell_terminal_mcp-0.1.0/config/config.yaml +245 -0
  7. powershell_terminal_mcp-0.1.0/config.yaml +217 -0
  8. powershell_terminal_mcp-0.1.0/powershell_terminal_mcp.egg-info/PKG-INFO +459 -0
  9. powershell_terminal_mcp-0.1.0/powershell_terminal_mcp.egg-info/SOURCES.txt +56 -0
  10. powershell_terminal_mcp-0.1.0/powershell_terminal_mcp.egg-info/dependency_links.txt +1 -0
  11. powershell_terminal_mcp-0.1.0/powershell_terminal_mcp.egg-info/entry_points.txt +2 -0
  12. powershell_terminal_mcp-0.1.0/powershell_terminal_mcp.egg-info/requires.txt +10 -0
  13. powershell_terminal_mcp-0.1.0/powershell_terminal_mcp.egg-info/top_level.txt +2 -0
  14. powershell_terminal_mcp-0.1.0/pyproject.toml +72 -0
  15. powershell_terminal_mcp-0.1.0/requirements.txt +16 -0
  16. powershell_terminal_mcp-0.1.0/server.json +36 -0
  17. powershell_terminal_mcp-0.1.0/setup.cfg +4 -0
  18. powershell_terminal_mcp-0.1.0/src/__init__.py +38 -0
  19. powershell_terminal_mcp-0.1.0/src/__main__.py +28 -0
  20. powershell_terminal_mcp-0.1.0/src/completion_token.py +99 -0
  21. powershell_terminal_mcp-0.1.0/src/config/__init__.py +27 -0
  22. powershell_terminal_mcp-0.1.0/src/config/config_dataclasses.py +225 -0
  23. powershell_terminal_mcp-0.1.0/src/config/config_init.py +33 -0
  24. powershell_terminal_mcp-0.1.0/src/config/config_loader.py +222 -0
  25. powershell_terminal_mcp-0.1.0/src/db.py +175 -0
  26. powershell_terminal_mcp-0.1.0/src/mcp_server.py +298 -0
  27. powershell_terminal_mcp-0.1.0/src/output/__init__.py +24 -0
  28. powershell_terminal_mcp-0.1.0/src/output/output_buffer.py +16 -0
  29. powershell_terminal_mcp-0.1.0/src/output/output_buffer_base.py +106 -0
  30. powershell_terminal_mcp-0.1.0/src/output/output_filter.py +165 -0
  31. powershell_terminal_mcp-0.1.0/src/output/output_filter_commands.py +156 -0
  32. powershell_terminal_mcp-0.1.0/src/output/output_filter_decision.py +113 -0
  33. powershell_terminal_mcp-0.1.0/src/pwsh/__init__.py +7 -0
  34. powershell_terminal_mcp-0.1.0/src/pwsh/output_clean.py +38 -0
  35. powershell_terminal_mcp-0.1.0/src/pwsh/pwsh_io.py +23 -0
  36. powershell_terminal_mcp-0.1.0/src/pwsh/pwsh_launch.py +188 -0
  37. powershell_terminal_mcp-0.1.0/src/pwsh/pwsh_reader.py +47 -0
  38. powershell_terminal_mcp-0.1.0/src/pwsh/pwsh_session.py +200 -0
  39. powershell_terminal_mcp-0.1.0/src/pwsh/session_output.py +109 -0
  40. powershell_terminal_mcp-0.1.0/src/shared_state.py +252 -0
  41. powershell_terminal_mcp-0.1.0/src/static/fragments/head.html +4 -0
  42. powershell_terminal_mcp-0.1.0/src/static/fragments/terminal_container.html +1 -0
  43. powershell_terminal_mcp-0.1.0/src/static/fragments/transfer_panel.html +7 -0
  44. powershell_terminal_mcp-0.1.0/src/static/terminal.css +284 -0
  45. powershell_terminal_mcp-0.1.0/src/static/terminal.js +378 -0
  46. powershell_terminal_mcp-0.1.0/src/static/transfer-panel.js +130 -0
  47. powershell_terminal_mcp-0.1.0/src/static/vendor/xterm-addon-fit.js +2 -0
  48. powershell_terminal_mcp-0.1.0/src/static/vendor/xterm.css +209 -0
  49. powershell_terminal_mcp-0.1.0/src/static/vendor/xterm.js +2 -0
  50. powershell_terminal_mcp-0.1.0/src/utils/__init__.py +24 -0
  51. powershell_terminal_mcp-0.1.0/src/utils/utils.py +22 -0
  52. powershell_terminal_mcp-0.1.0/src/utils/utils_format.py +21 -0
  53. powershell_terminal_mcp-0.1.0/src/utils/utils_output.py +174 -0
  54. powershell_terminal_mcp-0.1.0/src/utils/utils_text.py +61 -0
  55. powershell_terminal_mcp-0.1.0/src/web/__init__.py +11 -0
  56. powershell_terminal_mcp-0.1.0/src/web/web_terminal.py +160 -0
  57. powershell_terminal_mcp-0.1.0/src/web/web_terminal_ui.py +52 -0
  58. powershell_terminal_mcp-0.1.0/src/web/web_terminal_websocket.py +216 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2025 Tim (TiM00R)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,17 @@
1
+ include README.md
2
+ include LICENSE
3
+ include requirements.txt
4
+ include config.yaml
5
+ include hosts.yaml.example
6
+ include server.json
7
+ include claude_desktop_config_example.json
8
+
9
+ graft src
10
+ graft standalone
11
+ prune src/__pycache__
12
+ prune standalone/__pycache__
13
+
14
+ global-exclude __pycache__
15
+ global-exclude *.py[co]
16
+ global-exclude .DS_Store
17
+ global-exclude .git*
@@ -0,0 +1,459 @@
1
+ Metadata-Version: 2.4
2
+ Name: powershell-terminal-mcp
3
+ Version: 0.1.0
4
+ Summary: Shared AI + user PowerShell session on Windows — execute commands, run scripts, automate your PC
5
+ Author-email: Tim <tim00r@github.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/TiM00R/powershell-terminal-mcp
8
+ Project-URL: Repository, https://github.com/TiM00R/powershell-terminal-mcp
9
+ Keywords: mcp,model-context-protocol,powershell,windows,conpty,terminal,local-terminal,automation,claude,ai
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Classifier: Topic :: Terminals
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: nicegui>=1.4.0
25
+ Requires-Dist: pywinpty>=2.0.10
26
+ Requires-Dist: pyyaml>=6.0
27
+ Requires-Dist: mcp>=1.0.0
28
+ Requires-Dist: starlette>=0.27.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
31
+ Requires-Dist: black>=23.0.0; extra == "dev"
32
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ <!-- mcp-name: powershell-terminal -->
36
+ # PowerShell Terminal
37
+
38
+ **Shared AI + user PowerShell session on Windows — execute commands, run scripts, automate your PC**
39
+
40
+ PowerShell Terminal lets Claude (the AI assistant) run commands in a persistent, interactive PowerShell 7 session on your Windows machine through a real pseudo-terminal (ConPTY). Watch every command stream into your browser in real time while Claude receives smart-filtered output optimized for token efficiency.
41
+
42
+ ---
43
+
44
+ ## 🎯 What Is This?
45
+
46
+ Imagine telling Claude:
47
+
48
+ ```
49
+ "Check what Python version I have and install requests if it's missing"
50
+ "Run my build script and tell me if anything failed"
51
+ "Find all .log files modified today and show me any errors"
52
+ "Save this cleanup script and run it every time I ask"
53
+ ```
54
+
55
+ And Claude does it — executing commands in your real PowerShell session, analyzing output, saving reusable scripts, and taking action on your behalf.
56
+
57
+ **That's PowerShell Terminal.**
58
+
59
+ ---
60
+
61
+ ## ✨ Key Features
62
+
63
+ ### Core Capabilities
64
+
65
+ - **🖥️ Real PowerShell Session** — Persistent `pwsh` (PS7) or PS5.1 session via ConPTY; state carries across commands (working directory, variables, activated venv)
66
+ - **🌐 Shared Human + AI Terminal** — NiceGUI + xterm.js web terminal at `http://localhost:8090`; type your own commands alongside Claude's
67
+ - **🔄 Multi-Terminal Sync** — Open multiple browser tabs, all perfectly synchronized
68
+ - **🪟 No Popup Windows** — Native console executables (`git`, `python`, `ipconfig`, full paths) run inside ConPTY without spawning new windows
69
+ - **✂️ Dual-Stream Output** — You see full output in the browser; Claude receives a token-reduced summary
70
+ - **✅ Reliable Completion Detection** — Exit codes and command completion detected via invisible prompt token in OSC escape sequences — no fragile regex matching
71
+ - **⌨️ Interactive Commands** — Commands that prompt for input (`Read-Host`) work; Claude can send input and interrupt with Ctrl+C
72
+ - **📚 Script Library** — Save and reuse named `.ps1` scripts; full output persisted on script runs
73
+ - **🗄️ Command History** — Commands grouped into conversations and logged to SQLite with selective output persistence
74
+
75
+ ### The Interactive Web Terminal
76
+
77
+ PowerShell Terminal provides a **fully interactive terminal window** in your browser at `http://localhost:8090` — it looks and feels just like a native PowerShell window:
78
+
79
+ **You can:**
80
+ - Type commands directly (just like any terminal)
81
+ - Right-click to Copy/Paste, or use Ctrl+Shift+C / Ctrl+Shift+V
82
+ - Scroll through the full session scrollback
83
+ - Watch every command Claude runs appear in real time
84
+
85
+ **Claude can:**
86
+ - Execute commands that stream into your terminal
87
+ - See results instantly
88
+ - Continue working while you watch
89
+
90
+ **The key advantage:** Complete visibility and control. Every command Claude runs appears in your terminal in real time. You're never in the dark — it's like sitting side-by-side with an assistant who types commands while you watch the screen.
91
+
92
+ **Multi-Terminal Support:** Open multiple browser windows at `http://localhost:8090` — they all stay perfectly synchronized via WebSocket broadcast. Type in one terminal, see it in all terminals instantly.
93
+
94
+ ### The Dual-Stream Architecture
95
+
96
+ ```
97
+ PowerShell Session Output (ConPTY)
98
+ |
99
+ [Raw Output]
100
+ |
101
+ ---------+---------
102
+ | |
103
+ [FULL] [FILTERED]
104
+ | |
105
+ v v
106
+ Web Terminal Claude
107
+ (You see all) (Smart summary)
108
+ ```
109
+
110
+ - **You:** Full output, colors, and scrollback in the browser terminal
111
+ - **Claude:** Token-efficient filtered summary
112
+ - **Both:** Same live PowerShell session, synchronized state
113
+
114
+ ### Native Exe — No Popup Windows
115
+
116
+ A key problem with running an AI-controlled terminal on Windows: native console executables like `python`, `git`, `ipconfig`, or any `.exe` would spawn a separate `conhost.exe` popup window, breaking the in-terminal experience.
117
+
118
+ PowerShell Terminal solves this completely:
119
+
120
+ - A **PostCommandLookupAction hook** intercepts every native CUI executable before it runs
121
+ - A **PE header check** distinguishes console apps (CUI) from GUI apps — GUI apps like `notepad` and `code` open normally without blocking
122
+ - Execution is handled via `System.Diagnostics.Process` with `CreateNoWindow=true` and redirected I/O, so output flows through ConPTY instead of a new window
123
+ - Works for **short names** (`git`, `python`), **full paths** (`D:\tools\ffmpeg.exe`), and **any exe not known in advance**
124
+
125
+ ---
126
+
127
+ ## 🚀 Quick Start
128
+
129
+ ### Requirements
130
+
131
+ - Windows 10 1809+ or Windows 11 (ConPTY required)
132
+ - PowerShell 7 (`pwsh`) recommended; falls back to Windows PowerShell 5.1
133
+ - Python 3.10+
134
+
135
+ ### Option A — Install from PyPI
136
+
137
+ **Step 1: Create a virtual environment**
138
+
139
+ ```powershell
140
+ mkdir D:\powershell_terminal
141
+ cd D:\powershell_terminal
142
+ py -m venv .venv
143
+ .\.venv\Scripts\Activate.ps1
144
+ ```
145
+
146
+ **Step 2: Install the package**
147
+
148
+ ```powershell
149
+ pip install powershell-terminal-mcp
150
+ ```
151
+
152
+ **Step 3: Register with Claude Desktop**
153
+
154
+ ```powershell
155
+ notepad $env:APPDATA\Claude\claude_desktop_config.json
156
+ ```
157
+
158
+ Add:
159
+
160
+ ```json
161
+ {
162
+ "mcpServers": {
163
+ "powershell-terminal": {
164
+ "command": "D:\\powershell_terminal\\.venv\\Scripts\\powershell-terminal-mcp.exe"
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ ---
171
+
172
+ ### Option B — Install from Source (dev)
173
+
174
+ **Step 1: Clone the repo**
175
+
176
+ ```powershell
177
+ git clone https://github.com/TiM00R/powershell-terminal-mcp D:\powershell_terminal
178
+ cd D:\powershell_terminal
179
+ ```
180
+
181
+ **Step 2: Create the virtual environment and install dependencies**
182
+
183
+ ```powershell
184
+ .\setup_venv.ps1
185
+ ```
186
+
187
+ This creates `.venv`, installs all dependencies (including `pywinpty`), and installs the project in editable mode.
188
+
189
+ **Step 3: Register with Claude Desktop**
190
+
191
+ ```powershell
192
+ notepad $env:APPDATA\Claude\claude_desktop_config.json
193
+ ```
194
+
195
+ Add:
196
+
197
+ ```json
198
+ {
199
+ "mcpServers": {
200
+ "powershell-terminal": {
201
+ "command": "D:\\powershell_terminal\\.venv\\Scripts\\python.exe",
202
+ "args": ["D:\\powershell_terminal\\src\\mcp_server.py"]
203
+ }
204
+ }
205
+ }
206
+ ```
207
+
208
+ ---
209
+
210
+ Fully quit and relaunch Claude Desktop (system tray → Exit), then open a new conversation. On the first tool call the server starts the PowerShell session and opens the web terminal at `http://localhost:8090`.
211
+
212
+ ---
213
+
214
+ ## 💡 Usage Examples
215
+
216
+ ### Running Commands
217
+
218
+ ```
219
+ "What Python version do I have?"
220
+ "Run git status in D:\myproject"
221
+ "List all files modified today in my Downloads folder"
222
+ "Check if port 8080 is in use"
223
+ ```
224
+
225
+ ### Scripts & Automation
226
+
227
+ ```
228
+ "Save this build script and run it"
229
+ "Run my cleanup script"
230
+ "List my saved scripts"
231
+ ```
232
+
233
+ ### Diagnostics & System Info
234
+
235
+ ```
236
+ "Check disk space on all drives"
237
+ "What processes are using the most memory?"
238
+ "Show me the last 20 lines of the application event log"
239
+ "Is the Docker daemon running?"
240
+ ```
241
+
242
+ ### Development Workflows
243
+
244
+ ```
245
+ "Activate the venv and run the tests"
246
+ "Install requests and check if it imports correctly"
247
+ "Run git log --oneline -10 and summarize what changed"
248
+ ```
249
+
250
+ ---
251
+
252
+ ## 🎨 Example Session
253
+
254
+ **You:**
255
+ > Run my test suite and tell me what failed
256
+
257
+ **Claude:**
258
+ > I'll run the tests now...
259
+
260
+ *Web terminal opens automatically at http://localhost:8090*
261
+
262
+ **Web Terminal shows (real-time):**
263
+ ```
264
+ PS D:\myproject> python -m pytest tests/ -v
265
+ ============================= test session starts ==============================
266
+ collected 42 items
267
+
268
+ tests/test_api.py::test_login PASSED [ 2%]
269
+ tests/test_api.py::test_auth_required PASSED [ 4%]
270
+ tests/test_db.py::test_connection FAILED [ 26%]
271
+ ...
272
+ ========================= 3 failed, 39 passed in 8.42s =========================
273
+ ```
274
+
275
+ **Claude receives (filtered summary):**
276
+ ```
277
+ pytest: 42 tests, 3 failed, 39 passed (8.4s)
278
+ Failed: test_connection, test_insert_duplicate, test_rollback
279
+ ```
280
+
281
+ **Claude responds:**
282
+ > 3 tests failed, all in `test_db.py` — looks like a database connection issue. Want me to look at the error details and fix them?
283
+
284
+ ---
285
+
286
+ ## 🏗️ Architecture
287
+
288
+ ### How It Works
289
+
290
+ ```
291
+ Claude <--stdio JSON-RPC--> mcp_server.py
292
+ |
293
+ SharedTerminalState
294
+ / | \
295
+ PwshSession OutputBuffer SmartOutputFilter SQLite (db.py)
296
+ (ConPTY via (full human (AI token- (conversations,
297
+ pywinpty) scrollback) reduced view) commands, scripts)
298
+ |
299
+ NiceGUI + xterm.js web terminal (shared, multi-tab)
300
+ ```
301
+
302
+ - A single `pwsh` process runs inside a ConPTY (`pywinpty`). A background thread reads its output into a circular buffer.
303
+ - The session's prompt is overridden (in the MCP session only) to emit a unique completion token + exit status inside invisible OSC escape sequences. The browser swallows them; the server detects them in the raw stream.
304
+ - An output start-marker (emitted via a PSReadLine Enter handler, also invisible) lets the server separate a command's real output from the terminal's echo of the typed command.
305
+ - Human keystrokes from the browser are passed through raw and are not tracked by the AI's completion detection, so the two streams never collide.
306
+
307
+ ### Project Structure
308
+
309
+ ```
310
+ powershell_terminal/
311
+ ├── config/
312
+ │ └── config.yaml # Web port, filter thresholds, error patterns
313
+ ├── data/
314
+ │ └── commands.db # SQLite: conversations, commands, scripts
315
+ ├── scripts/ # Headless test harnesses
316
+ │ ├── test_pwsh_session.py # Session: completion, exit codes, interactive, Ctrl+C
317
+ │ ├── test_session_output.py # Buffer + dual-stream filter
318
+ │ └── test_mcp_dispatch.py # All MCP tools via direct dispatch
319
+ ├── src/
320
+ │ ├── config/ # Configuration loading
321
+ │ ├── output/ # Output filtering and buffering
322
+ │ ├── pwsh/ # PowerShell session (ConPTY)
323
+ │ │ ├── pwsh_launch.py # Shell spawn, init script, native exe hook
324
+ │ │ ├── pwsh_session.py # Session lifecycle, run_command, send_input
325
+ │ │ ├── session_output.py # Dual-stream wrapper (raw + filtered)
326
+ │ │ └── completion_token.py # Prompt token and OSC escape injection
327
+ │ ├── web/
328
+ │ │ └── web_terminal.py # NiceGUI + xterm.js web terminal
329
+ │ ├── db.py # SQLite database layer
330
+ │ ├── mcp_server.py # MCP server entry point (all tools)
331
+ │ └── shared_state.py # Global session hub
332
+ ├── setup_venv.ps1 # One-command environment setup
333
+ └── run_web.py # Launch web terminal standalone (no Claude)
334
+ ```
335
+
336
+ ### Technology Stack
337
+
338
+ - **Python 3.10+** — Core language
339
+ - **MCP Protocol** — Claude integration (stdio JSON-RPC)
340
+ - **pywinpty** — ConPTY pseudo-terminal on Windows
341
+ - **NiceGUI + WebSockets** — Web terminal with multi-tab sync
342
+ - **SQLite** — Command history and script storage
343
+ - **xterm.js** — Browser terminal renderer
344
+
345
+ ---
346
+
347
+ ## 🔧 MCP Tools Reference
348
+
349
+ ### Terminal / Execution
350
+
351
+ | Tool | Description |
352
+ |------|-------------|
353
+ | `execute_command(command, timeout?)` | Run a command; returns filtered output + exit code. Returns `status: "running"` on timeout. |
354
+ | `get_command_output(command_id, raw?)` | Fetch a prior command's output by id. |
355
+ | `send_input(text)` | Answer a running interactive command, then wait for completion. |
356
+ | `send_interrupt()` | Send Ctrl+C to the running command. |
357
+ | `get_terminal_status()` | Session alive? Web terminal URL. |
358
+ | `restart_session()` | Kill and respawn the PowerShell session (clears all state). |
359
+ | `open_terminal()` | Open (or re-open) the web terminal in the browser. |
360
+
361
+ ### Scripts
362
+
363
+ | Tool | Description |
364
+ |------|-------------|
365
+ | `save_script(name, content)` | Save (or overwrite) a named `.ps1` script. |
366
+ | `list_scripts()` | List all saved scripts. |
367
+ | `run_script(name, timeout?)` | Run a saved script; full output is always persisted. |
368
+
369
+ ### Conversations (History)
370
+
371
+ | Tool | Description |
372
+ |------|-------------|
373
+ | `start_conversation(label?)` | Group subsequent commands; returns `conversation_id`. |
374
+ | `end_conversation(conversation_id?, status?)` | End the active (or specified) conversation. |
375
+ | `list_conversations(limit?)` | List recent conversations. |
376
+ | `get_conversation_commands(conversation_id)` | Commands logged under a conversation. |
377
+
378
+ ---
379
+
380
+ ## 🔧 Configuration
381
+
382
+ `config.yaml` (project root) controls:
383
+ - `server.host` / `server.port` — Web terminal address (default `localhost:8090`)
384
+ - Output filter thresholds and error patterns
385
+ - SQLite database lives at `data\commands.db` in the project root
386
+
387
+ ---
388
+
389
+ ## 🛡️ Security Considerations
390
+
391
+ - Web terminal bound to `localhost` only — not exposed to the network
392
+ - Full command audit trail in SQLite
393
+ - The init script runs in the MCP's own session only — **your `$PROFILE`, normal PowerShell, and prompt are never modified**
394
+ - Claude runs commands in your local user context with your normal permissions
395
+
396
+ ---
397
+
398
+ ## 🐛 Known Issues & Limitations
399
+
400
+ 1. **Windows only** — ConPTY is a Windows API; Linux/Mac not supported
401
+ 2. **Interactive TUI apps not supported** — Commands that take over the terminal (e.g. `vim`, `htop`) will hang; use `-NonInteractive` alternatives
402
+ 3. **Single session** — One shared PowerShell session; no per-command isolation
403
+
404
+ ---
405
+
406
+ ## 🔍 Development
407
+
408
+ Run the headless test harnesses without Claude Desktop:
409
+
410
+ ```powershell
411
+ .\.venv\Scripts\python.exe scripts\test_pwsh_session.py # session: completion, exit codes, interactive, Ctrl+C, restart
412
+ .\.venv\Scripts\python.exe scripts\test_session_output.py # buffer + dual-stream filter
413
+ .\.venv\Scripts\python.exe scripts\test_mcp_dispatch.py # all MCP tools via direct dispatch
414
+ python run_web.py # launch web terminal standalone
415
+ ```
416
+
417
+ ---
418
+
419
+ ## 📜 Version History
420
+
421
+ ### v0.1.0 (July 2026) — Initial public release
422
+
423
+ - ✅ ConPTY-based persistent PowerShell 7 session via `pywinpty`
424
+ - ✅ Shared human + AI terminal: NiceGUI + xterm.js web terminal, multi-tab WebSocket sync
425
+ - ✅ Native exe fix: all CUI executables run inside ConPTY without popup windows (`System.Diagnostics.Process` + `CreateNoWindow=true` + redirected I/O)
426
+ - ✅ PostCommandLookupAction hook covers short names, full paths, and any unknown exe
427
+ - ✅ PE header subsystem check: GUI apps (notepad, code) bypass the hook and open normally
428
+ - ✅ PATHEXT fix: session always gets a correct PATHEXT so bare command names resolve reliably
429
+ - ✅ Dual-stream output: full output in browser, token-reduced view for Claude
430
+ - ✅ Reliable command completion via prompt token in invisible OSC escape sequences
431
+ - ✅ Interactive commands: `Read-Host`, `Ctrl+C`, `send_input`
432
+ - ✅ SQLite history: conversations, commands (selective persistence), saved scripts
433
+ - ✅ Full MCP tool set: execute, send_input, interrupt, restart, scripts, conversations
434
+
435
+ ---
436
+
437
+ ## 🤝 Contributing
438
+
439
+ This is Tim's personal project. If you'd like to contribute:
440
+
441
+ 1. Test on your setup and document any issues found
442
+ 2. Suggest improvements or missing features
443
+ 3. Share useful scripts you create
444
+
445
+ ---
446
+
447
+ ## 📄 License
448
+
449
+ MIT
450
+
451
+ ---
452
+
453
+ **Ready to let Claude run PowerShell for you? Register the MCP server in Claude Desktop and open a new conversation to get started.**
454
+
455
+ ---
456
+
457
+ **Version:** 0.1.0
458
+ **Last Updated:** July 2026
459
+ **Maintainer:** Tim