The SSH MCP Server allows secure remote access and execution via the MCP protocol. Its features include:
Execute commands on remote servers via SSH using a private key (
ssh_exec
).Manage SSH credentials: add (
add_credential
), list (list_credentials
), and remove (remove_credential
).Copy files/directories between local and remote systems using rsync (
rsync_copy
).
Manages SSH credentials storage through a SQLite database, enabling persistence of connection details for remote command execution.
SSH MCP Server
A Model Context Protocol (MCP) server implementation that provides SSH capabilities. This server allows for secure remote access and execution through the MCP protocol.
Features
SSH server implementation using MCP protocol
SQLite database integration for data persistence
TypeScript implementation for type safety and better development experience
Prerequisites
Node.js (v16 or higher recommended)
npm or yarn package manager
TypeScript knowledge for development
Installation
Installing via Smithery
To install SSH Server for Claude Desktop automatically via Smithery:
Manual Installation
Clone the repository:
Install dependencies:
Build the project:
Usage
Configuration
The server uses a SQLite database (ssh.db
) to store SSH credentials. The
database file will be created automatically when the server starts.
Tools
The server provides the following tools:
ssh_exec
Execute a command over SSH.
Input Parameters:
host
: The host to connect to. (required)command
: The command to execute. (required)username
: The username to use for the SSH connection. (required)privateKeyPath
: The path to the private key file. (required)
Example Usage:
Note: The privateKeyPath
must be a valid path to a private key file.
add_credential
Add a new SSH credential.
Input Parameters:
name
: The name of the credential. (required)host
: The host to connect to. (required)username
: The username to use for the SSH connection. (required)privateKeyPath
: The path to the private key file. (required)
Example Usage:
Note: The privateKeyPath
must be a valid path to a private key file.
list_credentials
List all stored SSH credentials.
Input Parameters:
None
Example Usage:
remove_credential
Remove a stored SSH credential.
Input Parameters:
name
: The name of the credential to remove. (required)
Example Usage:
Starting the server
The server will start running on the configured port (default settings can be modified in the source code).
Project Structure
src/
- Source code directorybuild/
- Compiled JavaScript outputnode_modules/
- Project dependencies
Dependencies
@modelcontextprotocol/sdk
: MCP protocol implementationsqlite3
: SQLite database drivertypescript
: Development dependency for TypeScript support
Development
To make changes to the project:
Make your changes in the
src/
directoryRebuild the project:
Start the server to test your changes:
License
ISC
Contributing
Fork the repository
Create your feature branch
Commit your changes
Push to the branch
Create a new Pull Request
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server implementation that enables secure remote command execution via SSH, with features for managing and using SSH credentials.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.Last updated -3
- -securityFlicense-qualityA secure SSH server implementation for Model Context Protocol that enables remote command execution and file operations, supporting both password and key-based authentication.Last updated -48
- -securityAlicense-qualityA Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.
- AsecurityFlicenseAqualityA server that enables remote command execution over SSH through the Model Context Protocol (MCP), supporting both password and private key authentication.Last updated -1182