Node Terminal MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Node Terminal MCP create a new terminal session and run 'ls -la' to list files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Node Terminal MCP
A local MCP server for persistent terminal sessions. It uses node-pty and communicates with its MCP client over stdio. Each session keeps its own shell state, including its working directory.
Install
Use Node.js 18 or newer. On Windows, use Windows 10 version 1809 or newer. For an MCP client with JSON stdio configuration, launch the existing npm package with npx.
{
"mcpServers": {
"node-terminal-mcp": {
"command": "npx",
"args": ["-y", "@hazzel-cn/node-terminal-mcp"]
}
}
}You can also run npm install -g @hazzel-cn/node-terminal-mcp and set the client's command to node-terminal-mcp with an empty arguments list. See SETUP.md for Gemini CLI, local builds, and connection troubleshooting. Google ADK uses StdioConnectionParams for the same command and arguments.
The shell starts in the MCP server's working directory and inherits its environment and OS permissions. Connect the server to a trusted local client. Output is raw terminal text and may include ANSI control sequences.
Related MCP server: pty-mcp
Tools
Tool | What it does |
| Start a session with a unique active |
| Send an |
| Send a named key such as |
| Read and clear pending output for one session. |
| Set the columns and rows of an active session. |
| List active session IDs. |
| Close a session and discard its unread output. |
The server uses SHELL when it is set and /bin/bash otherwise. Pass a shell executable explicitly on Windows. Terminals start at 80 columns by 24 rows.
For example, create demo, write echo hello, send enter, and read from demo. Output may arrive after the write finishes. Reading clears the pending output, and an exited session is removed. Closing a session releases its ID immediately and starts PTY cleanup in the background. The server also reaps managed PTYs when the client closes stdin.
Develop
git clone https://github.com/henryzhz/node-terminal-mcp.git
cd node-terminal-mcp
npm ci
npm test
npm run test:packagenpm test builds the project and exercises the MCP server and a local PTY. npm run test:package packs the CLI, installs it into a fresh directory, and opens a PTY from that installation. CI runs these checks on Linux, macOS, and Windows.
This release pins node-pty@1.2.0-beta.18 on all platforms. For a source build, see node-pty's native build prerequisites.
The prepack step copies the extra compiled paths from compat-dist/ into dist/. Those files come byte-for-byte from the published 1.0.7 package to preserve direct imports.
Releases
GitHub Actions builds and tests the package. npm releases are issued separately by a maintainer of @hazzel-cn/node-terminal-mcp. Before releasing, confirm the npm account with npm whoami, run the tests, and inspect the tarball with npm pack --dry-run.
Keep the npm package name and executable stable. If npm trusted publishing is configured later, use henryzhz/node-terminal-mcp and the exact publish workflow filename in the npm settings.
License
Available Tools
7 toolsterminal_closeA
Close a terminal session permanently. This will terminate the shell process and free up resources. Use this when you no longer need a terminal session or want to clean up. Note: Any running processes in the terminal will be terminated.
Inputs: sessionId (required).
terminal_createA
Create a new persistent terminal session that will continue running until explicitly closed. Terminal sessions maintain their state, environment variables, working directory, and command history. Use this to establish a long-running interactive environment for executing commands, running processes, or maintaining context across multiple operations.
Inputs: sessionId (required), cols, rows, shell.
terminal_listA
List all currently active terminal sessions. Use this to check which terminal sessions are available before interacting with them, or to manage multiple terminal contexts. Each session maintains its own state, working directory, and environment.
Inputs: no named parameters.
terminal_readA
Read the current output buffer from a terminal session. CRITICAL: Always call this after sending input to see command results, error messages, prompts, or any terminal output. The terminal session maintains its state, so you should read frequently to stay updated on the current state, especially after commands that might change the working directory, environment, or running processes.
Inputs: sessionId (required).
terminal_resizeA
Resize a terminal session to adjust its dimensions. Useful when output is truncated or when you need to accommodate different content formats. Some commands and applications behave differently based on terminal size.
Inputs: cols (required), rows (required), sessionId (required).
terminal_send_keyB
Send special keys and key combinations to a terminal session. Use this for navigation, control sequences, and interactive commands that require specific key presses. Essential for terminal interactions like confirming prompts, navigating command history, or sending interrupt signals.
Inputs: key (required), sessionId (required).
terminal_writeA
Send text input to a terminal session. This is used for typing commands, text, or any character input. The terminal will process this input as if typed by a user. Always follow up with read_from_terminal to see the results and any output generated by the command.
Inputs: input (required), sessionId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a distinct lifecycle action on a terminal session, and descriptions clearly separate input (terminal_write) from special key sequences (terminal_send_key). The write vs. send_key boundary is the only place an agent could hesitate, but the descriptions resolve it well enough.
Every tool uses the identical terminal_<verb> snake_case pattern with a single, unambiguous verb (create, write, send_key, read, resize, list, close). No mixed conventions or vague names.
Seven tools is a tight, well-scoped set that covers exactly the operations needed to manage persistent terminal sessions without filler. Nothing appears redundant or missing at the count level.
Full session lifecycle is covered: create, interact (write/send_key/read), resize, list, and close. A convenience exec-style tool for one-shot command execution or explicit exit-status retrieval would round it out, but agents can work around this via write+read.
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Linux cloud desktop your AI can use by the hour: run commands, read and write files, see the screen.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a pseudo-terminal (PTY) interface that allows AI agents to interact with command-line tools requiring interactive prompts. It enables agents to autonomously spawn processes, read output, and send inputs for workflows like database migrations and project scaffolding.1MIT
- FlicenseAqualityDmaintenanceEnables AI agents to start and manage pseudo-terminal sessions, run shell commands and interact with REPLs programmatically.7-
- AlicenseAqualityDmaintenanceEnables AI agents to spawn, interact with, and orchestrate multiple concurrent terminal sessions via tmux.9MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, interactive pseudo-terminal sessions for running CLI tools, SSH, and AWS SSM, including support for prompts, concurrent commands, and a live web TUI.-