SSH MCP Server
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., "@SSH MCP Servercheck disk space on my production server"
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.
SSH MCP Server
A Model Context Protocol (MCP) server that provides an SSH command wrapper for AI coding agents. This allows agents (like Gemini CLI, Claude Code, and Continue) to securely execute shell commands on remote servers using a dedicated tool, ensuring that you receive proper native permission prompts for remote execution.
Motivation
When using AI coding agents, if the agent simply runs the local ssh command using its local shell runner, you get a generic "Allow local command execution?" prompt. Furthermore, the agent has to construct complex string arrays for arguments.
By exposing ssh_execute_command as a native MCP tool, the agent cleanly requests permission to use the SSH tool, separating local operations from remote operations.
Related MCP server: ssh-mcp-server
Features
Per-Host Permissions: Dynamically generates a specific tool for each allowed host (e.g.,
ssh_execute_example_com). This allows your AI agent's permission system to ask for permission per server. Once you approve a host for a session, the AI can execute commands on it seamlessly, but connecting to a new host will trigger a new permission request.Auto-Discovery: Automatically parses your
~/.ssh/configto discover available hosts, or accepts specific allowed hosts via command-line arguments.Key Management: Automatically handles standard SSH keys (
~/.ssh/id_ed25519or~/.ssh/id_rsa) and works withssh-agent.Cross-Platform: Compatible with all major MCP clients.
Installation and Build
Ensure you have Node.js installed.
git clone https://github.com/li-liwen/SSH-MCP.git
cd SSH-MCP
npm install
npm run buildConfiguration
You need to add this MCP server to your preferred coding agent. By default, ssh-mcp will read your ~/.ssh/config file to discover allowed hosts. Alternatively, you can explicitly pass the allowed hosts as arguments.
For Gemini
First, link the package globally (or install it globally using npm install -g .):
npm linkThen add it to your environment. You can pass specific allowed IP addresses or hostnames at the end:
gemini mcp add ssh-mcp ssh-mcp 10.101.0.108 example.com(If you omit the hosts, it will automatically expose tools for all hosts found in ~/.ssh/config).
For Claude Code
Run the following command in your terminal:
claude mcp add ssh-mcp ssh-mcp 10.101.0.108For Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"ssh-mcp": {
"command": "ssh-mcp",
"args": ["10.101.0.108", "example.com"]
}
}
}For Continue & Other Agents (OpenCode, Codex, Cursor)
Add the following to your config.json (or equivalent settings file) under mcpServers:
{
"mcpServers": {
"ssh-mcp": {
"command": "ssh-mcp",
"args": ["10.101.0.108"]
}
}
}How the Agent uses it
Once configured, the MCP server will expose explicit tools like ssh_execute_10_101_0_108. Simply instruct your agent:
"Connect to my remote server at 10.101.0.108 with username ubuntu and check the disk space."
The agent will seamlessly use the explicit per-host tool (like ssh_execute_10_101_0_108) to execute commands (e.g., df -h) on the remote server and return the results directly into the conversation.
This server cannot be installed
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 Servers
- Flicense-qualityDmaintenanceEnables AI assistants to securely execute shell commands on local machines through an SSH interface with session management, command execution, and sudo support.Last updated1
- AlicenseAqualityCmaintenanceEnables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isolation to prevent unauthorized operations.Last updated1044MIT
- AlicenseAqualityAmaintenanceEnables AI assistants to execute shell commands and transfer files via SFTP across remote servers using existing SSH configurations. It supports parallel execution on server groups and provides built-in safety warnings for potentially destructive commands.Last updated62Mozilla Public 2.0
- Alicense-qualityBmaintenanceEnables AI assistants to securely execute commands, transfer files, and manage port forwarding on remote servers via SSH.Last updated13536Apache 2.0
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate your own Linux servers from your LLM. Requires the SentinelX agent installed per host.
Runtime permission, approval, and audit layer for AI agent tool execution.
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/li-liwen/SSH-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server