home / mcp / mcp terminal mcp server
MCP Terminal Server - Interactive terminal sessions via Model Context Protocol
Configuration
View docs{
"mcpServers": {
"alejoair-mcp-terminal": {
"url": "http://localhost:8777/mcp",
"headers": {
"MCP_TERMINAL_HOST": "0.0.0.0",
"MCP_TERMINAL_PORT": "8777",
"MCP_TERMINAL_LOG_LEVEL": "debug"
}
}
}
}You can run an interactive terminal server that exposes real PTY sessions through MCP and REST, letting you control, automate, and observe terminal sessions from AI assistants or remote clients across platforms.
Start by running the MCP Terminal Server locally to expose terminal sessions over MCP and REST. You can create multiple terminal sessions, send input, resize, capture visual snapshots, and close sessions from your MCP client. Use the MCP endpoint to access terminal endpoints and manage sessions from your automation tools.
Prerequisites: Python and pip must be available on your system.
Install the MCP Terminal package from PyPI.
pip install mcp-terminalConfiguration notes help you tailor the server for development or production use. You can bind to a specific host and port, enable auto-reload for development, and adjust logging levels.
Runtime examples show how to start and access the server. The default port is 8777, but you can override it with command line options. For example, to start on port 8777 and be accessible on all interfaces, you would run the same command without extra options or specify a host.
mcp-terminal
```
```
mcp-terminal --port 9000
```
```
mcp-terminal --host 0.0.0.0 --port 8888If you need to adjust where the server runs or how it is exposed, use the host and port options. When running behind a reverse proxy, ensure the proxy forwards the MCP endpoint at /mcp and the REST API at /docs.
You can create terminal sessions, send commands, retrieve visual snapshots, resize, and close terminals. Use an MCP client to interact with these endpoints in a structured, tool-like fashion.
Create a new terminal session with specified rows and cols. Returns a terminal_id that you will use for subsequent actions.
List all active terminal sessions with their IDs and statuses.
Fetch a visual snapshot of the terminal display, including cursor position and size.
Send input to a specific terminal session to run commands or interact with the shell.
Resize the terminal session by adjusting rows and columns.
Close and terminate a terminal session.