About Persistent Terminal MCP
Persistent Terminal MCP is an MCP server published by sanshao85 in the Developer Tools category. Conduid read 10 tools from its source: create_terminal, create_terminal_basic, fix_bug_with_codex, get_terminal_stats, kill_terminal, list_terminals and 4 more. It is published to npm as persistent-terminal-mcp and starts with npx.
The repository has 130 stars and 33 forks, is licensed MIT, and its last commit was on 11 Feb 2026. The latest release is v1.0.4 (10 Feb 2026): codex --yolo startup error in PTY sessions by auto-replying common terminal queries (e.g. It is the only release Conduid has on record for this repository. It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass No dynamic code execution. Its topics include devtools.
Install
claude mcp add persistent-terminal-mcp-91fa -- npx -y persistent-terminal-mcpnpx -y persistent-terminal-mcpgit clone https://github.com/sanshao85/persistent-terminal-mcpTools (10)
create_terminalCreate a new persistent terminal session| Parameter | Type | Description |
|---|---|---|
| cwd | string | Working directory (default: current directory) |
| env | object | Environment variables |
| shell | string | Shell to use (default: system default) |
create_terminal_basicCreate a new persistent terminal session (shell and cwd only). Useful for clients that cannot send env objects.| Parameter | Type | Description |
|---|---|---|
| cwd | string | Working directory (default: current directory) |
| shell | string | Shell to use (default: system default) |
fix_bug_with_codexUse OpenAI Codex CLI to automatically fix bugs with FULL SYSTEM ACCESS. WARNING CRITICAL: This tool gives Codex COMPLETE control over the codebase! - Sandbox: danger-full-access (no restrictions) - Approval: never (fully automated) YOUR RESPONSIBILITY (AI Assistant): You MUST provide a DETAILED and COMPREHENSIVE bug description to Codex. The quality of the fix depends entirely on how well you describe the problem! IMPORTANT NOTES: 1. ONLY use ENGLISH in the description (no Chinese, no emoji) 2. UTF-8 encoding issues may occur with non-ASCII characters 3. Keep the description clear, structured, and detailed 4. Use plain text formatting (avoid special characters) GOOD DESCRIPTION EXAMPLE (DO THIS): "Username validation bug in auth.js file. PROBLEM: - File: src/auth/login.ts, line 45 - Code: const usernameRegex = /^[a-zA-Z0-9]{3,20}$/ - Symptom: Username 'user_name' is rejected with 'Invalid username' error - Expected: Should accept usernames with underscores and hyphens ROOT CAUSE: - Regex [a-zA-Z0-9] only allows letters and numbers - Missing support for underscore and hyphen characters SUGGESTED FIX: - Change regex to: /^[a-zA-Z0-9_-]{3,20}$/ - This will allow underscores and hyphens in usernames IMPACT: - Affects login() and register() functions - May impact existing user validation logic RELATED FILES: - src/auth/login.ts (main fix) - src/auth/validation.ts (may need update) - tests/auth/login.test.ts (for verification) TEST CASES: - 'user_name' should pass - 'user-name' should pass - 'user@name' should fail VERIFICATION: - Run: npm test - Expected: all tests pass" BAD DESCRIPTION EXAMPLE (DON'T DO THIS): "Login has a bug, please fix it" "Username validation is wrong" "Fix the regex in auth.js" WHAT TO INCLUDE IN YOUR DESCRIPTION: 1. Problem symptoms - specific error behavior 2. Expected behavior - how it should work 3. Problem location - file path, line number, function name 4. Related code - the problematic code snippet 5. Root cause - why this problem occurs (if known) 6. Fix suggestions - how to fix it (if you have ideas) 7. Impact scope - what else might be affected 8. Related files - all relevant file paths 9. Test cases - how to verify the fix works 10. Context information - background that helps understand the problem HOW THIS TOOL WORKS: 1. Your bug description will be saved to: docs/codex-bug-description-TIMESTAMP.md 2. Codex will read this document and analyze the problem 3. Codex will fix the bug in the codebase 4. Codex will generate a fix report in: docs/codex-fix-TIMESTAMP.md 5. Both documents will be preserved in docs/ for reference WORKFLOW AFTER CALLING THIS TOOL: 1. Wait for Codex to complete (up to 10 minutes) 2. YOU MUST read the fix report: docs/codex-fix-TIMESTAMP.md 3. YOU MUST summarize the changes to the user 4. YOU MUST provide testing recommendations 5. Optionally, review the bug description document to see what was sent to Codex WHAT CODEX WILL DO: 1. Read your bug description from docs/codex-bug-description-TIMESTAMP.md 2. Analyze the problem based on your description 3. Fix the bug in the codebase 4. Generate a comprehensive fix report in docs/codex-fix-TIMESTAMP.md 5. The report includes: problem, changes, files modified, testing guide TIMEOUT: Default: 10 minutes (600000ms) Adjust if the fix is complex or involves many files TIP: Before calling this tool, gather as much information as possible: - Read error messages - Check relevant files - Understand the expected behavior - Review recent changes that might have caused the bug| Parameter | Type | Description |
|---|---|---|
| cwd | string | Working directory (default: current directory) |
| description * | string | DETAILED bug description for Codex. MUST INCLUDE: - Problem symptoms (what's broken) - Expected behavior (what should happen) - Problem location (file paths, line numbers) - Related code snippets - Root cause (if known) - Fix suggestions (if any) - Impact scope (what else might be affected) - Related files (all relevant file paths) - Test cases (how to verify the fix) - Context (background information) The more detailed, the better the fix! |
| timeout | number | Timeout in milliseconds (default: 600000 = 10 minutes) |
get_terminal_statsGet detailed statistics about a terminal session including size, tokens, etc.| Parameter | Type | Description |
|---|---|---|
| terminalId * | string | Terminal session ID |
kill_terminalTerminate a terminal session| Parameter | Type | Description |
|---|---|---|
| signal | string | Signal to send (default: SIGTERM) |
| terminalId * | string | Terminal session ID |
list_terminalsList all active terminal sessionsopen_terminal_uiOpen a web-based terminal management UI in the browser. This provides a visual interface to manage all terminal sessions.| Parameter | Type | Description |
|---|---|---|
| autoOpen | boolean | Automatically open browser (default: true) |
| port | number | Port for the web server (default: auto-detect from 3002) |
read_terminalRead output from a terminal session. For Codex/TUI conversation, use mode="tail" + raw=true + cleanAnsi=true. If tail seems incomplete, retry with mode="head-tail" in raw mode.| Parameter | Type | Description |
|---|---|---|
| cleanAnsi | boolean | When raw=true, sanitize ANSI/control sequences into readable text. Default: true |
| headLines | number | Number of lines to show from the beginning when using head or head-tail mode (default: 50) |
| maxChars | number | Maximum characters returned in this tool response (default: 12000, hard cap for context safety) |
| maxLines | number | Maximum number of lines to read (default: 1000) |
| mode | string | Reading mode: full, head, tail, head-tail. For recent chat turns, prefer tail. For screen-refresh TUI recovery, use head-tail. |
| raw | boolean | Read raw PTY stream. Strongly recommended for Codex/vim-like TUIs to avoid missing lines caused by cursor redraw. |
| since | number | Line number to start reading from (default: 0) |
| stripSpinner | boolean | Whether to strip spinner/animation frames (uses global setting if not specified) |
| tailLines | number | Number of lines from the end in tail/head-tail mode. For chat checks, 10-30 is a good starting range. |
| terminalId * | string | Terminal session ID |
wait_for_outputWait for terminal output to stabilize. Useful after running commands to ensure all output is captured.| Parameter | Type | Description |
|---|---|---|
| stableTime | number | Time with no new output to consider stable in milliseconds (default: 500) |
| terminalId * | string | Terminal session ID |
| timeout | number | Maximum time to wait in milliseconds (default: 5000) |
write_terminalWrite input to a terminal session. For Codex/LLM chat: send message text first, then force Enter with sendEnter=true when the app appears to wait for submission.| Parameter | Type | Description |
|---|---|---|
| appendNewline | boolean | Whether to append newline automatically. Default true for normal text. Keep false only for raw key/control sequences. |
| input * | string | Input to send to the terminal. For chat text, send the full sentence/paragraph here. |
| sendEnter | boolean | Force one Enter key (CR). Recommended for Enter-only actions (input="") or when Codex/TUI appears to be waiting for submit. |
| terminalId * | string | Terminal session ID |
Security checks
Static checks derived from the repository 11 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 2.1K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by package-lock.json and typescript-sdk-main/package-lock.json.
- !No dynamic code executionScanned 52 source files and found 1 call to eval or shell execution, in src/web-ui-manager.ts:125. Review how tool inputs reach them before granting credentials.
1 check has not been run yet.
What the source scan found
- Transport
- stdio, Streamable HTTP and HTTP with SSEsrc/index.ts:3, typescript-sdk-main/src/server/streamableHttp.ts:147, typescript-sdk-main/src/cli.ts:12
- Starts other programs
- 2 callssrc/web-ui-manager.ts:125, typescript-sdk-main/src/client/stdio.ts:121
- Outbound network calls
- 10 callstypescript-sdk-main/src/client/websocket.ts:29, public/app.js:33, public/app.js:68
- Writes or deletes files
- 2 callssrc/mcp-server.ts:213, src/mcp-server.ts:216
- Lockfile
- package-lock.json and typescript-sdk-main/package-lock.json
Pattern matches on the source text of 52 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 2.1K words, fetched a month ago. The original in the repository is authoritative.
Read full README