hardened-terminal-mcp
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., "@hardened-terminal-mcplist files in the current directory"
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.
hardened-terminal-mcp
A security-hardened terminal MCP server. It exposes a small, policy-gated shell surface to an MCP client over stdio — allowlisted commands only, no shell, jailed to a single directory.
Guarantees
Deny by default. A command whose name is not on the allowlist is refused. Deny wins: a name on both lists is denied.
No shell. Commands run via
subprocesswithshell=Falseon a parsed argv. Shell metacharacters (; | & < > \$(...)`) are rejected before any policy check — no chaining, redirection, or substitution.Jailed cwd. Execution is confined to a configured jail root; traversal (
..), symlink, and absolute-path escapes are refused.Scrubbed environment. The child gets a minimal env (
PATH,HOME,LANG) so parent-process secrets can't leak into it.Bounded. Wall-clock timeout with process kill; stdout/stderr are capped.
Errors are data. No Python traceback ever reaches the client; every result is a
CommandResultenvelope with a typedResultCode.
Related MCP server: Shell-MCP
How it works
policy.py decides (explain), executor.py runs (run), server.py wires
both behind two FastMCP tools and maps every outcome onto one envelope.
Install
uv syncRun
uv run hardened-terminal-mcp # serves over stdioConfiguration (env vars, both optional):
HTMCP_POLICY_FILE— path topolicy.toml(default:policy.toml).HTMCP_JAIL_ROOT— directory commands are jailed to (default: process cwd).
Startup fails loudly if the policy is missing/invalid or the jail root is not a
directory. Edit policy.toml to change the allow/deny lists and argument rules.
Tool reference
Both tools return a CommandResult:
{ ok, code, stdout, stderr, exit_code, duration_ms, policy_reason }.
run_command(command, cwd=None)— evaluate against policy and, if allowed, run it sandboxed.cwd(if given) must resolve inside the jail root.explain_command(command)— dry run: return the verdict only, with empty output andexit_code=None. Never executes.
ResultCode values:
Code | Meaning |
| Executed and returned ( |
| Denied by policy (list, arg rule, metacharacter, empty). |
| Command could not be parsed into an argv. |
| Wall-clock timeout; process killed. |
| Ran, but output hit the cap. |
|
|
| Allowed command couldn't run (not found, permission, etc.). |
| Unexpected server error; generic message only. |
Tests
uv run pytestLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
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/Asaad-Suliman/hardened-terminal-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server