Terminal MCP
Provides tools for observing and interacting with whitelisted tmux sessions, including listing sessions, tailing and capturing output, checking status, sending text or keys, and managing logical bindings to tmux sessions.
Click on "Install 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., "@Terminal MCPcheck the last 200 lines of tmux session claude-mesflow"
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.
Terminal MCP
Purpose
Terminal MCP lets an MCP client observe and, when explicitly enabled, send constrained input to whitelisted tmux sessions. It supports local STDIO and a loopback-only Streamable HTTP transport intended to sit behind an authenticated HTTPS tunnel.
Related MCP server: Ryan's Tmux MCP Server
Architecture
Claude / Codex / shell
|
tmux
|
Terminal MCP
|
MCP (STDIO or loopback HTTP)
|
ChatGPTtmux is the source of truth. The server calls tmux with explicit argument arrays through Python subprocess; it never uses shell=True.
Quick start
cd /home/dell/workspace/terminal-mcp
python3 -m venv .venv
.venv/bin/pip install -e '.[test]'
.venv/bin/terminal-mcpFor the remote-capable, loopback-only Streamable HTTP mode:
.venv/bin/terminal-mcp-http
# MCP endpoint: http://127.0.0.1:8766/mcpThe HTTP bind address is deliberately fixed to 127.0.0.1. Do not expose it
directly or change it to 0.0.0.0; use an authenticated HTTPS tunnel that maps
only its MCP route.
The installed user service can be managed with:
systemctl --user status terminal-mcp-http.service
systemctl --user restart terminal-mcp-http.serviceIts unit is ~/.config/systemd/user/terminal-mcp-http.service, runs as the
current user, and uses Restart=on-failure. Authentication is intentionally
not implemented as an ad-hoc MCP wrapper: it must be enforced by the HTTPS
tunnel/identity provider before traffic reaches the loopback endpoint.
For private ChatGPT Developer Mode connectivity, use OpenAI Secure MCP Tunnel.
The credential-free deployment runbook and inactive service template are in
deploy/secure-tunnel. No Cloudflare/public ingress is
required for this mode.
Equivalent module command:
.venv/bin/python -m terminal_mcp.serverExample MCP client command configuration:
{
"command": "/home/dell/workspace/terminal-mcp/.venv/bin/terminal-mcp",
"args": [],
"env": {
"TERMINAL_MCP_CONFIG": "/home/dell/workspace/terminal-mcp/config.yaml"
}
}Config
config.yaml controls read/input permissions, allowed session patterns, and capture limits. Input is disabled by default.
permissions:
terminal_read: true
terminal_input: false
allowed_session_patterns:
- "claude-*"
- "codex-*"
- "agent-*"
- "test-*"
max_capture_lines: 2000
default_tail_lines: 200Security model
Sessions are denied unless their name matches a whitelist pattern.
Sensitive names containing
root,ssh,password,secret, ordatabaserequire an exact literal whitelist entry.Output is sanitized for common API keys, bearer/authorization values, passwords, and tokens.
There is no shell execution, arbitrary filesystem access, environment disclosure, process killing, scheduler, or autonomous agent.
HTTP mode listens only on loopback and cannot change permissions or whitelist through requests.
terminal_send_textuses tmux literal mode.terminal_send_keysaccepts only a fixed V1 key allowlist.Errors do not reveal details about denied sessions.
Create an agent tmux session
tmux new -s claude-mesflow
claudetmux new -s codex-mesflow
codexDetach with Ctrl-b d and reattach with tmux attach -t SESSION.
Enable terminal input
Edit only the permission in config.yaml:
permissions:
terminal_read: true
terminal_input: trueRestart the MCP child process after changing configuration. Enabling input lets the MCP client type into allowed sessions; review this change carefully.
Tools
terminal_list_sessionsterminal_tailterminal_captureterminal_statusterminal_send_textterminal_send_keysterminal_bindterminal_get_bindingterminal_list_bindingsterminal_unbindterminal_tail_boundterminal_status_boundterminal_send_bound
Chat ↔ tmux logical binding
A logical binding gives a chat or work context a stable name without relying on
an internal ChatGPT conversation ID. Bindings persist in SQLite at
~/.local/state/terminal-mcp/bindings.db (or the path in
TERMINAL_MCP_BINDINGS_DB) and resolve to tmux, which remains the source of
truth.
Create an agent session:
tmux new -s claude-mesflow
claudeFrom ChatGPT, bind mesflow-dev to claude-mesflow with terminal_bind, then
requests such as “xem agent này đang làm gì”, “đọc 300 dòng cuối”, or “kiểm tra
nó đang chờ input không” can use:
terminal_tail_bound(binding="mesflow-dev")
terminal_tail_bound(binding="mesflow-dev", lines=300)
terminal_status_bound(binding="mesflow-dev")Binding names contain only lowercase letters, digits, -, _, or ., with a
maximum of 64 characters. A target must exist and pass the session whitelist;
sensitive session names are never bindable. Existing bindings require
replace=true for an explicit remap. If a tmux session disappears, its binding
is retained and status becomes MISSING.
New bindings use read_enabled=true and input_enabled=false. Bound input is
allowed only when both the local global permission and the binding permission
are true. Creating a binding never enables global terminal input.
Known limitations
Status detection is heuristic and intentionally returns
UNKNOWNwhen evidence is weak.Only the active pane of each tmux session is inspected.
Capture is line-based and capped; it does not stream incremental events.
Redaction covers common secret shapes, not full DLP.
HTTP mode is local-only until a separately authenticated HTTPS tunnel is configured.
tmux sessions must run under the same Unix user as Terminal MCP.
terminal-mcp
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Experimental MCP server for current empirical verification of explicit public HTTPS endpoint claims.
21
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server for SSH and local terminal access. Supports interactive commands, long-running processes, and TUI apps like tmux/zellij63MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for tmux operations that provides comprehensive control over tmux sessions, windows, and panes.1
- FlicenseAqualityCmaintenanceA persistent, stateful MCP server that exposes a detached tmux session to clients, enabling shell command execution, terminal buffer reading, and control signal sending via JSON-RPC over stdio.3
- AlicenseNot gradedqualityAmaintenanceExposes a Windows or Linux host terminal to remote MCP clients via Streamable HTTP, enabling command execution, tunnel management, and privileged operations with security features like OAuth and audit logging.392MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hungtranbkit/terminal-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server