# zsh-tool

Runs native Zsh sessions with PTY support and hanging-process prevention. Handles interactive password prompts and terminal deltas.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: ArkTechNWA
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ArkTechNWA/zsh-tool
- Updated: 2026-04-15
- HTML: https://affpapa.org/en/nevibecode/mcp/zsh-tool

## What it does

Default Bash executors frequently stumble over Zsh syntax and quoting conventions. That causes unnecessary debug loops that waste tokens. This server executes commands directly inside Zsh. Its PTY mode creates a pseudo-terminal, allowing the assistant to handle interactive prompts and enter credentials.

Long-running commands do not freeze the session. Execution yields after a selected duration, returning partial output. You can then collect incremental lines via `zsh_poll` instead of dumping whole logs. If a command times out three times in a rolling hour, the NEVERHANG circuit breaker cuts it off for 5 minutes.

Telemetry and command history write to SQLite via the A.L.A.N. engine. Without setting the `ALAN_DB_PATH` environment variable, session history resets on restart.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `ALAN_DB_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env ALAN_DB_PATH=<ALAN_DB_PATH> --transport stdio zsh-tool -- uvx zsh-tool-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from zsh-tool-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add zsh-tool --env ALAN_DB_PATH=<ALAN_DB_PATH> -- uvx zsh-tool-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from zsh-tool-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "zsh-tool": {
            "command": "uvx",
            "args": [
                "zsh-tool-mcp"
            ],
            "env": {
                "ALAN_DB_PATH": "<ALAN_DB_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from zsh-tool-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "zsh-tool": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "zsh-tool-mcp"
            ],
            "env": {
                "ALAN_DB_PATH": "<ALAN_DB_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from zsh-tool-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ALAN_DB_PATH=<ALAN_DB_PATH> zsh-tool uvx zsh-tool-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from zsh-tool-mcp <command>

## When to use it
- run native Zsh commands without escaping or quotation mismatches
- enter passwords and handle interactive prompts via PTY mode
- break hanging processes with the NEVERHANG circuit breaker
- stream only new console lines using `zsh_poll` delta checks

## Example prompts
- Run `pass insert mypass` using PTY mode and supply the password when prompted.
- Start `pip install .` with `yield_after` set to 5 seconds and poll new output.
- List all background tasks using `zsh_tasks`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
