SSH — policy-gated remote access
MCP server by tufantunc Community
Gives LLM agents policy-gated SSH access to Linux and Windows hosts, with command classification, role-based authorization, approvals and audit logging.
Install SSH — policy-gated remote access
Built from the published package, never by AI.
claude mcp add ssh-policy-gated-remote-access -- npx -y ssh-mcpRun in your terminal. Add --scope user to use it in every project.
Step-by-step: install SSH — policy-gated remote access in Claude Code
{
"mcpServers": {
"ssh-policy-gated-remote-access": {
"args": [
"-y",
"ssh-mcp"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
Step-by-step: install SSH — policy-gated remote access in Claude Desktop
{
"mcpServers": {
"ssh-policy-gated-remote-access": {
"args": [
"-y",
"ssh-mcp"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
Step-by-step: install SSH — policy-gated remote access in Cursor
{
"servers": {
"ssh-policy-gated-remote-access": {
"args": [
"-y",
"ssh-mcp"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
Step-by-step: install SSH — policy-gated remote access in VS Code
codex mcp add ssh-policy-gated-remote-access -- npx -y ssh-mcpStep-by-step: install SSH — policy-gated remote access in Codex
{
"mcpServers": {
"ssh-policy-gated-remote-access": {
"args": [
"-y",
"ssh-mcp"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
Step-by-step: install SSH — policy-gated remote access in Antigravity CLI
gemini mcp add ssh-policy-gated-remote-access npx -y ssh-mcpGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
Step-by-step: install SSH — policy-gated remote access in Gemini CLI
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the ssh-policy-gated-remote-access block.
About
SSH MCP Server is a Model Context Protocol server that gives LLM agents controlled SSH access to remote hosts. It classifies each command before running it, checks it against a role and host-group policy, and asks for human approval on destructive work. Every decision is recorded in an audit log, whether the command runs or not.
The server needs a config.toml file that names hosts, roles and approval policy, and it refuses tool calls until one exists. Linux and macOS configs must be owner-only. The README says the risk is not removed: it recommends never pointing it at a root account. It is for people who want LLM agents to reach remote Linux or Windows hosts with controls in place.
Written from the project's README and checked against it.
Tools it gives your assistant
read-commandRuns allowlisted read-only commands such as ls, cat and grep on a remote host.run-commandRuns arbitrary commands, with destructive or privileged ones needing approval unless set to auto.privileged-commandRuns a command with sudo, subject to approval unless the profile uses auto approval.open-sessionCreates a named interactive (stateful) or background session on a host.sftp-listLists a remote directory, bounded in entries and bytes.sftp-upload-fileStreams a local file to the remote host without sending its bytes through model context.sftp-download-fileStreams a remote file to local disk without sending its bytes through model context.signal-processSends INT, TERM or KILL to a remote process ID.list-connectionsLists available hosts and their connection status.reload-configShows the config file status or re-reads and applies it without a restart.
What you need
- npm to install the ssh-mcp package
- A config.toml file at the platform config path
- An SSH key, SSH agent, or SSH_MCP_PASSWORD for password auth
- Linux, macOS or Windows
| Setting | Needed | What it is |
|---|---|---|
SSH_Environment variable, secret | Optional | Password for the configured profile; a per-profile SSH_MCP_<PROFILE>_PASSWORD takes precedence. Credentials are never accepted as CLI arguments. |
SSH_Environment variable | Optional | Path to the private key file to authenticate with — the path, not the key material. A per-profile SSH_MCP_<PROFILE>_KEY takes precedence. |
SSH_Environment variable, secret | Optional | Passphrase for an encrypted private key. |
SSH_Environment variable, secret | Optional | Password the sudo tool escalates with, when the policy in force allows the privileged class. |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Run uptime on the dev host and tell me the load average
- Show the status of the nginx service on the staging server
- Download the latest app log from the server into my transfer folder
Good to know
- Refuses every tool call until a config file is present, except reload-config.
- The SFTP transfer tools stay off until defaults.transferRoot is set.
- The SFTP transfer tools are not available on Windows.
- Policy narrows the blast radius of prompt injection but does not remove the risk.
Security check
C- Downloads a script from the internet and runs itIn
README.md:curl|sh - Asks for administrator rights (sudo)In
README.md:sudo
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to SSH — policy-gated remote access
All alternatives →Agentmesh MCP Proxy is a security proxy for MCP servers, described by its publisher as a firewall for the Model Context Protocol. It is aimed at teams that run AI agents which call tools and other agents.
Hardens client-side artifacts such as binaries, Electron apps, JS bundles, Python and WebAssembly against AI reverse-engineering agents. Built for developers who ship proprietary logic to user-controlled devices.
Bla Agents is an MCP server and CLI that adds seeded, format-specific decoys to shipped binaries, JavaScript, WebAssembly and other artifacts. It is for developers who ship proprietary logic to user-controlled devices and want to make AI reverse-engineering slower.
A shared OAuth server for the MCP route of an app, built on better-auth, with passkey sign-in for the owner
Agent Governance Toolkit adds policy enforcement, identity, sandboxing and audit logging to autonomous AI agents. It is aimed at teams shipping agents to production. The source does not confirm the Claude Desktop MCP server named in the listing.
Convex MCP Gateway is a Convex component that exposes selected Convex functions as MCP tools. It checks each call with your own authorize callback and writes an audit log. It is for developers who run Convex apps and want AI assistants to call parts of them.
Compare with Agentmesh MCP Proxy, Bla or Bla Agents
SSH — policy-gated remote access: common questions
Does it stop prompt injection?
No. The README says prompt injection has no general fix, so the server classifies, authorizes and gates commands to narrow the blast radius, and it records each decision.
How does it check the config file permissions?
On Linux and macOS the server refuses to start if the file or its directory is not owner-only. On Windows it reads the ACL and refuses writes by other accounts.
Can it move large files without filling the model context?
Yes. sftp-upload-file and sftp-download-file stream between the remote host and local disk, and the response is only a byte count and two paths.
How do I install SSH — policy-gated remote access?
In Claude Code run claude mcp add ssh-policy-gated-remote-access -- npx -y ssh-mcp. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is SSH — policy-gated remote access the official server?
SSH — policy-gated remote access is a community project by tufantunc, not verified by a company domain.
Is SSH — policy-gated remote access free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is SSH — policy-gated remote access safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade C (downloads a script from the internet and runs it). Review the code before you install. How grades work.
What are alternatives to SSH — policy-gated remote access?
Similar MCP servers: Agentmesh MCP Proxy, Bla, Bla Agents, MCP Auth.
Does SSH — policy-gated remote access work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
