mcp-ssh
MCP server from mfangtao/mcp-ssh-server
claude mcp add --transport stdio mfangtao-mcp-ssh-server node dist/server.js \ --env PORT="Port to run the MCP server on (default 3000)"
How to use
mcp-ssh is an MCP server that exposes SSH remote command execution over MCP. It uses SSH2 to connect to target hosts and runs commands remotely, returning stdout, stderr and exit codes to the MCP client. Clients can invoke the execute_ssh_command tool via MCP to perform secured remote commands, with authentication supported by password or private key methods. The server is built with TypeScript for type safety and leverages the MCP SDK for a consistent protocol surface.
To use, run the server locally or in your environment, then connect with an MCP client and call the execute_ssh_command tool, supplying the SSH connection details and the command you want to run. The client should provide connection host, port, username, and either a password or a privateKey to authenticate. Example usage from an MCP client: create a request to the execute_ssh_command tool with a connection object (host, port, username, and credentials) and the command string you want to execute (for example, ls -la). The server will return the command output along with any errors and the exit code.
How to install
Prerequisites:
- Node.js >= 16
- npm or yarn
- Git
Manual installation steps:
-
Clone the repository git clone https://github.com/your-repo/ssh-server.git cd ssh-server
-
Install dependencies npm install
-
Build the project (TypeScript to JavaScript) npm run build
-
Start the server npm start
Optional Smithery installation (automatic): npx -y @smithery/cli install @mfangtao/mcp-ssh-server --client claude
Notes:
- Ensure environment variables (like PORT) are set if you override defaults.
- If you customize host binding or TLS, configure accordingly in your deployment setup.
Additional notes
Tips and common considerations:
- Ensure SSH authentication methods are properly configured on target hosts (password or privateKey). If using privateKey, ensure the key is accessible by the server and has appropriate permissions.
- When deploying in production, consider restricting access to MCP clients and using TLS where possible.
- If you run into build issues, verify TypeScript version compatibility and ensure all dependencies (@types/*) align with Node.js version.
- The server exposes an execute_ssh_command tool via MCP; you can extend or customize tooling by integrating additional SSH commands as needed.
- Environment variable PORT can be used to change the listening port without editing code.
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.