SSH MCP Server
Enables AI coding agents to securely execute shell commands on remote SSH servers with granular per-host permission controls. Automatically discovers hosts from ~/.ssh/config and exposes dedicated tools for each allowed host to ensure proper authorization before remote execution.
README
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.
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 build
Configuration
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 link
Then 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.108
For 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.