Create terminal session
terminal_createSpawn a new terminal session and return its sessionId for interactive shells or one-off commands like tests and TUIs. Call before any per-session tool; sessions persist until destroyed or evicted.
Instructions
Spawn a new terminal session and return its sessionId. You must call this before any per-session tool — there is no shared default session. By default the session is an interactive shell. Pass command to run one program in the terminal instead (a TUI, a test run, a CLI under test): the session then lasts as long as that program, reports its exit status when it ends, and keeps its final screen readable until you destroy it. If the server already holds 50 live sessions, the least-recently-used one is evicted to make room (its sessionId is tombstoned and any later call against it will respawn with an 'evicted' notice).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Override the default working directory. | |
| env | No | Environment variables to set for the session, on top of the server's own environment. | |
| cols | No | ||
| rows | No | ||
| label | No | Optional human-readable name shown in terminal_list output (e.g. "dev-server"). | |
| login | No | Start the shell as a login shell (`-l`), so it reads the profile files (~/.zprofile, ~/.bash_profile, ~/.profile) where PATH is usually set up. Use it when tools that work in the user's own terminal are "command not found" here — typical when the MCP client was started from a GUI rather than a terminal. Slower to start. No effect in PowerShell or cmd.exe. Default false (or the server's --login flag). | |
| shell | No | Override the default shell (e.g. "/bin/zsh"; on Windows "pwsh.exe" or "cmd.exe" instead of PowerShell). | |
| theme | No | Color palette used by terminal_screenshot and terminal_click previews for THIS session. Persists across auto-respawn / hardReset. Default "dark" (VS Code Dark+). Options: "dark", "light", "solarized-dark", "solarized-light". | |
| command | No | Run this command line instead of an interactive shell, e.g. "vim notes.txt" or "npm test". It is run through the session's shell (`sh -c`; on Windows PowerShell `-Command`, or `cmd /c`), so quoting, pipes and redirection work as at that shell's prompt. Input tools talk to the program directly. When it exits, its exit status is reported, the final screen stays readable, and nothing is restarted automatically. | |
| scrollback | No |