MCP SSH Agent
A server that enables secure interaction with remote SSH hosts through standardized MCP interface, providing functions like listing hosts, executing commands, and transferring files using native SSH tools.
README
MCP SSH Agent
A Model Context Protocol (MCP) server for managing and controlling SSH connections via STDIO interface. Uses native SSH commands for maximum reliability and compatibility.
Overview
This MCP server provides SSH operations through a clean, standardized interface that can be used by MCP-compatible language models. The server automatically discovers SSH hosts from your ~/.ssh/config and ~/.ssh/known_hosts files and executes commands using local ssh and scp tools.
Example Usage

The screenshot above shows the MCP SSH Agent in action, demonstrating how it integrates with MCP-compatible clients to provide seamless SSH operations.
Key Features
- Reliable SSH: Uses native
ssh/scpcommands instead of JavaScript SSH libraries - Automatic Discovery: Finds hosts from SSH config and known_hosts files
- Full SSH Support: Works with SSH agents, keys, and all authentication methods
- File Operations: Upload and download files using
scp - Batch Commands: Execute multiple commands in sequence
- Error Handling: Comprehensive error reporting with timeouts
Functions
The agent provides the following MCP tools:
- listKnownHosts() - Lists all known SSH hosts, prioritizing entries from ~/.ssh/config first, then additional hosts from ~/.ssh/known_hosts
- runRemoteCommand(hostAlias, command) - Executes a command on a remote host using
ssh - getHostInfo(hostAlias) - Returns detailed configuration for a specific host
- checkConnectivity(hostAlias) - Tests SSH connectivity to a host
- uploadFile(hostAlias, localPath, remotePath) - Uploads a file to the remote host using
scp - downloadFile(hostAlias, remotePath, localPath) - Downloads a file from the remote host using
scp - runCommandBatch(hostAlias, commands) - Executes multiple commands sequentially
Installation
# Clone the repository
git clone <repository-url>
cd mcp-ssh
# Install dependencies
npm install
Usage
The agent runs as a Model Context Protocol server over STDIO:
# Start the MCP SSH agent
npm start
# Or use the provided startup script
./start.sh
The server will output initialization messages and then wait for MCP requests over STDIO.
Integration with MCP Clients
To use this agent with an MCP-compatible client:
{
"mcpServers": {
"ssh": {
"command": "./start.sh",
"cwd": "/path/to/mcp-ssh"
}
}
}
Alternative (more verbose) configuration:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["server-simple.mjs"],
"cwd": "/path/to/mcp-ssh"
}
}
}
Project Structure
mcp-ssh/
├── server-simple.mjs # Main MCP server implementation
├── package.json # Dependencies and scripts
├── start.sh # Startup script (./start.sh)
├── doc/
│ └── example.png # Usage example screenshot
├── src/
│ ├── ssh-client.ts # SSH operations implementation (TypeScript reference)
│ ├── ssh-config-parser.ts # SSH configuration parsing (TypeScript reference)
│ ├── types.ts # TypeScript type definitions
│ └── index.ts # (Empty - using server-simple.mjs)
├── README.md # This file
└── IMPLEMENTATION_NOTES.md # Technical implementation details
Requirements
- Node.js 18 or higher
- Existing SSH configuration with key-based authentication
- SSH keys must be properly configured (no interactive password prompts)
Security Notes
- Uses existing SSH keys and configurations
- Does not store or handle passwords
- Requires pre-configured SSH key authentication
- All operations use your existing SSH setup
Troubleshooting
- Server won't start: Check that all dependencies are installed with
npm install - SSH operations fail: Verify your SSH configuration works with standard
sshcommands - Host not found: Ensure hosts are properly configured in
~/.ssh/config
Development
The server is implemented in JavaScript using:
@modelcontextprotocol/sdkfor MCP protocol compliance- Native
sshandscpcommands for reliable SSH operations ssh-configfor parsing SSH configuration files- Node.js
child_processfor command execution
The implementation prioritizes reliability and simplicity by leveraging the existing SSH infrastructure rather than complex JavaScript SSH libraries.
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.