SSH MCP Server
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.
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 Serverlist all my saved SSH credentials"
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 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
Related MCP server: Shell MCP Server
Prerequisites
Node.js 18 or higher
npm or yarn package manager
TypeScript knowledge for development
Installation
Installing via Smithery
To install SSH Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @KinoThe-Kafkaesque/ssh-mcp-server --client claudeManual Installation
Clone the repository:
git clone <repository-url>
cd ssh-serverInstall dependencies:
npm installBuild the project:
npm run buildUsage
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 stores named credentials, then every remote action refers to a
credentialName. privateKeyPath must point to an existing private key.
add_credential: save{ "name", "host", "username", "privateKeyPath" }.list_credentials: list stored credential records.remove_credential: delete{ "name" }.ssh_exec: run a shell command with{ "credentialName", "command", "timeout" }.ssh_exec_raw: run an argv-style command array, for example{ "credentialName": "prod", "command": ["grep", "-E", "foo|bar", "/var/log/app.log"] }.scp_copy: copy one file over SFTP with{ "credentialName", "localPath", "remotePath", "direction" }.rsync_copy: copy directories or larger trees with rsync and the same transfer shape.ssh_session_start,ssh_session_send,ssh_session_read,ssh_session_end,ssh_session_list: manage interactive SSH sessions.ssh_tunnel_start,ssh_tunnel_list,ssh_tunnel_stop: manage local or remote port-forwarding tunnels.
Example:
{
"tool_name": "ssh_exec",
"arguments": {
"credentialName": "prod",
"command": "uptime",
"timeout": 120000
}
}Starting the server
npm startThe 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:
npm run buildStart the server to test your changes:
npm startLicense
MIT
Contributing
Fork the repository
Create your feature branch
Commit your changes
Push to the branch
Create a new Pull Request
Maintenance
Latest Blog Posts
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/KinoThe-Kafkaesque/ssh-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server