SSH远程访问
STDIO提供安全远程访问和执行的MCP服务器
提供安全远程访问和执行的MCP服务器
A Model Context Protocol (MCP) server implementation that provides SSH capabilities. This server allows for secure remote access and execution through the MCP protocol.
To install SSH Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @KinoThe-Kafkaesque/ssh-mcp-server --client claude
git clone <repository-url> cd ssh-server
npm install
npm run build
The server uses a SQLite database (ssh.db
) to store SSH credentials. The
database file will be created automatically when the server starts.
The server provides the following tools:
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:
{ "tool_name": "ssh_exec", "arguments": { "host": "example.com", "command": "ls -l", "username": "user", "privateKeyPath": "/path/to/private/key" } }
Note: The privateKeyPath
must be a valid path to a private key file.
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:
{ "tool_name": "add_credential", "arguments": { "name": "my_credential", "host": "example.com", "username": "user", "privateKeyPath": "/path/to/private/key" } }
Note: The privateKeyPath
must be a valid path to a private key file.
List all stored SSH credentials.
Input Parameters:
Example Usage:
{ "tool_name": "list_credentials", "arguments": {} }
Remove a stored SSH credential.
Input Parameters:
name
: The name of the credential to remove. (required)Example Usage:
{ "tool_name": "remove_credential", "arguments": { "name": "my_credential" } }
npm start
The server will start running on the configured port (default settings can be modified in the source code).
src/
- Source code directorybuild/
- Compiled JavaScript outputnode_modules/
- Project dependencies@modelcontextprotocol/sdk
: MCP protocol implementationsqlite3
: SQLite database drivertypescript
: Development dependency for TypeScript supportTo make changes to the project:
src/
directorynpm run build
npm start
ISC