# Terminal sessions for agents

> Terminal sessions for agents is an open-source MCP server for developer tools. Real pseudo-terminal sessions for agents: run commands, read output, type input. It runs locally on your machine and is started by your AI client.

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

## About

This server starts real shells or programs in a pseudo-terminal, so an agent can work with things a plain command runner cannot: REPLs, prompts, vim, ssh and long-running dev servers. Each response reports session state, exit code, whether the shell is idle or busy, the current directory and whether the program is waiting for input, flagging password prompts when terminal echo is off.

Long output is read by cursor, so an agent can pick up where it left off. Commands that overrun their timeout keep running and return a cursor. Killing a session ends its whole process tree. Local clients use stdio via npx; hosted clients such as Manus connect over Streamable HTTP with a bearer token, usually through a tunnel.

The README says version 0.1.0 meets 8 of 8 original requirements and 24 of 45 planned features, and that safety features are mostly still planned. It needs Node.js 22.12 or newer on macOS or Linux, with bash or zsh.

## Features

- **Interactive programs:** Type text and named keys into REPLs and editors.
- **Command results:** terminal_exec returns output, exit code and new cwd.
- **Cursor-based reading:** Read only newer output of long-running processes.
- **Session state:** Reports idle, busy, awaiting input or exited.
- **Process-tree kill:** Ends a session and every child process.
- **Stdio and HTTP:** Local stdio, or Streamable HTTP with a bearer token.

## Good for

- Let an agent run a test suite and see the exit code
- Start a dev server and wait for a ready message
- Drive a Python REPL or ssh session
- Give a hosted agent such as Manus terminals on your machine

## Install

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

```sh
claude mcp add terminal-mcp -- npx -y @ryamgoh/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": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/terminal-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

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

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

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

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

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

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

```json
{
  "mcpServers": {
    "terminal-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/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 terminal-mcp -- npx -y @ryamgoh/terminal-mcp
```

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

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

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

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

Or run: gemini mcp add -s user terminal-mcp npx -- -y @ryamgoh/terminal-mcp

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

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

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

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

```json
{
  "mcpServers": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/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": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/terminal-mcp"
      ]
    }
  }
}
```

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

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/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": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/terminal-mcp"
      ]
    }
  }
}
```

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

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

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

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

```json
{
  "mcpServers": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/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": {
    "terminal-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ryamgoh/terminal-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 3 of 6 tools change data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `terminal_start` (name suggests: changes): Starts a shell or program session in a PTY.
- `terminal_exec` (name suggests: changes): Runs one command line and returns its output, exit code and cwd.
- `terminal_write` (name suggests: changes): Types text or named keys into a session.
- `terminal_read` (name suggests: reads): Reads session output without sending input, by cursor.
- `terminal_list` (name suggests: reads): Lists sessions with state, command and cwd.
- `terminal_kill`: Terminates a session and its process tree.

## FAQ

### How do I install Terminal sessions for agents?

Run claude mcp add terminal -- npx -y @ryamgoh/terminal-mcp, or use the JSON config with npx.

### What platforms are supported?

macOS and Linux with bash or zsh and Node.js 22.12 or newer.

### Can remote agents use Terminal sessions for agents?

Yes, in HTTP mode with a bearer token, typically behind a tunnel such as ngrok.

### Is Terminal sessions for agents production ready?

The README labels it version 0.1.0, with many safety features still planned.

### Is Terminal sessions for agents free?

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

### How do I add Terminal sessions for agents to Claude Code?

Run this command in your terminal: claude mcp add terminal-mcp -- npx -y @ryamgoh/terminal-mcp

### What are the best alternatives to Terminal sessions for agents?

The closest alternatives to Terminal sessions for agents 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/terminal-sessions-for-agents
