ssh
MCP server from vilasone455/ssh-mcp-server
claude mcp add --transport stdio vilasone455-ssh-mcp-server node /path/to/ssh-mcp-server/dist/index.js \ --env MACHINES_PATH="/path/to/your/machines.json"
How to use
This SSH MCP Server exposes SSH control as MCP tools, allowing a large language model or MCP client to discover, connect to, and execute commands on remote machines via SSH. The server offers tools for listing available SSH targets, establishing and managing SSH sessions, and executing commands securely (with an option for read-only or safer executions). Available tools include get_available_connections (lists known machines), create_connection (opens a new SSH session and returns a connection_id), get_connections (lists active sessions), execute_command (runs a shell command with no restrictions), secure_execute_command (blocks potentially destructive actions), and close_connection (terminates an active session). The client example demonstrates how to wire the server into a Claude Desktop-like workflow by providing the server command, path to the built dist script, and an environment variable pointing to your machines.json configuration.
To use, start the MCP server through the configured command, then issue natural-language prompts like: "Open an SSH session to Todo server and run uptime" or "What is the status of all active SSH connections?" The MCP client will translate these prompts into the appropriate tool calls, manage connections, and present the command output back to you.
How to install
Prerequisites:
- Node.js (recommended LTS) and npm/yarn installed
- TypeScript project (this repository) with dependencies
- Access to a machines.json file describing SSH targets
Installation steps:
-
Clone the repository git clone https://github.com/vilasone455/ssh-mcp-server.git cd ssh-mcp-server
-
Install dependencies npm install
or yarn install
-
Build the TypeScript project (produces dist/index.js) npm run build
or if the project uses tsc directly: npm run compile
-
Prepare your machines configuration Create a machines.json describing your SSH targets, e.g.: (example) [ {"machine_id": "todo-server-01", "label": "Todo server", "os": "ubuntu", "source": "digitalocean", "ssh": {"host": "192.168.1.11", "port": 22, "username": "user", "password": "your_password_here"}}, {"machine_id": "build-agent-01", "label": "CI Build Agent (Key Auth)", "os": "ubuntu", "source": "aws", "ssh": {"host": "192.168.1.12", "port": 22, "username": "ubuntu", "keyPath": "/home/ubuntu/.ssh/id_rsa"}} ]
-
Run the server using the provided MCP configuration (example shown in mcp_config):
- Ensure MACHINES_PATH points to your machines.json file
- Start the server (as configured in your MCP client): node dist/index.js
-
Connect via MCP client Use your MCP client configuration to point to the server (see mcp_config example).
Additional notes
Tips and common considerations:
- Keep MACHINES_PATH secure and restrict access to the machines.json to trusted environments.
- Use secure_execute_command for safer interactions; consider enabling read-only mode for limited contexts.
- Ensure SSH targets are reachable from the server host and that SSH keys or passwords are correctly configured.
- If you modify machines.json, reload or restart the MCP server so the changes take effect.
- Monitor for connection limits or session cleanup to avoid resource leaks.
- The server is designed to work with the MCP SDK; verify compatibility with your MCP client version when upgrading.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.