# Smart Terminal

> Smart Terminal is an open-source MCP server for developer tools. Persistent interactive terminal sessions for AI agents, with strong Windows support. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Windows, macOS, Linux, Self-hosted
- **Repository:** https://github.com/pungggi/smart-terminal-mcp
- **MCP Registry name:** io.github.pungggi/smart-terminal
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Smart Terminal gives an agent a long-lived PTY shell via node-pty, so the working directory, environment and running processes carry from one step to the next. That matters for tools that hang on piped stdin, such as vim, npm prompts, REPLs and installers, and it supports Ctrl+C and arrow keys without hand-built escape sequences.

The tool set is built around keeping output manageable. terminal_exec uses unique completion markers and can exit early when output goes quiet; terminal_read takes a since position for incremental reads; terminal_wait and terminal_watch block until a pattern appears; terminal_retry reruns flaky commands with backoff; terminal_run_paged returns large read-only output a page at a time; terminal_diff compares two results; terminal_get_history revisits earlier output. terminal_run executes a binary directly with shell=false for predictable one-shot calls.

It supports up to 10 named sessions with readable IDs, detects PowerShell, cmd, bash or sh automatically and kills whole process groups on stop. The README is candid that a client with a good built-in terminal may not need it; the pitch is a consistent workflow across Claude Code, Cursor and others. Installs from npm.

## Features

- **Persistent PTY sessions:** Shell state survives across steps.
- **Pattern waiting:** Wait or watch for text instead of polling.
- **Incremental reads:** Fetch only output since the last position.
- **Paged and diffed output:** Page large results or diff two runs.
- **Direct one-shot runs:** Execute binaries with shell=false.
- **Windows support:** Auto-detects pwsh, PowerShell or cmd.

## Good for

- Run an interactive installer through an agent
- Watch a dev server log for a ready message
- Retry a flaky command with backoff
- Keep one shell open across a long debugging session
- Compare outputs of two builds

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add smart-terminal -- npx -y smart-terminal-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add smart-terminal -- npx -y smart-terminal-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.smart-terminal]
command = "npx"
args = ["-y", "smart-terminal-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user smart-terminal npx -- -y smart-terminal-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "smart-terminal": {
      "command": "npx",
      "args": [
        "-y",
        "smart-terminal-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 5 of 11 tools change data; 4 names don't say. From the server's own tool labels and tool names; not verified by us.

- `terminal_exec` (name suggests: changes): Run a command with deterministic completion markers
- `terminal_write` (name suggests: changes): Send input or keystrokes to the session
- `terminal_read` (name suggests: reads): Read output, incrementally by position
- `terminal_wait`: Wait for a pattern to appear
- `terminal_watch`: Event-driven watch for trigger patterns
- `terminal_retry`: Re-run flaky commands with bounded backoff
- `terminal_run` (name suggests: changes): Run a binary directly with shell disabled
- `terminal_run_paged` (name suggests: changes): Page through large read-only output
- `terminal_diff`: Unified diff of two command results
- `terminal_get_history` (name suggests: reads): Revisit earlier session output
- `terminal_stop` (name suggests: changes): Stop a session, optionally saving a transcript

## FAQ

### How many sessions can I run?

Up to 10 concurrent named sessions.

### How does Smart Terminal avoid hanging on prompts?

It uses a real pseudo-terminal instead of piped stdin.

### Does Smart Terminal save tokens?

The README says targeted reads can reduce context use, without guaranteeing runtime savings.

### Which shells are detected?

pwsh, PowerShell or cmd on Windows; $SHELL, bash or sh elsewhere.

### Is Smart Terminal free?

Yes. Smart Terminal is open source, so you can use and self-host it for free.

### How do I add Smart Terminal to Claude Code?

Run this command in your terminal: claude mcp add smart-terminal -- npx -y smart-terminal-mcp

### What are the best alternatives to Smart Terminal?

The closest alternatives to Smart Terminal are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/smart-terminal
