MCP.so

๐Ÿ” ssh-mcp-server

@classfang

๐Ÿ” ssh-mcp-server ใซใคใ„ใฆ

ๅŸบไบŽ SSH ็š„ MCP ๆœๅŠก ๐Ÿง™โ€โ™€๏ธใ€‚ๅทฒ่ขซMCPๅฎ˜ๆ–นๆ”ถๅฝ• ๐ŸŽ‰ใ€‚ SSH MCP Server ๐Ÿง™โ€โ™€๏ธ. It has been included in the community MCP repository ๐ŸŽ‰.

ๅŸบๆœฌๆƒ…ๅ ฑ

ใ‚ซใƒ†ใ‚ดใƒช

้–‹็™บ่€…ใƒ„ใƒผใƒซ

ใƒฉใ‚คใ‚ปใƒณใ‚น

ISC

ใƒฉใƒณใ‚ฟใ‚คใƒ 

node

ใƒˆใƒฉใƒณใ‚นใƒใƒผใƒˆ

stdio

ๅ…ฌ้–‹่€…

classfang

่จญๅฎš

ไปฅไธ‹ใฎ่จญๅฎšใ‚’ไฝฟใฃใฆใ€ใ“ใฎใ‚ตใƒผใƒใƒผใ‚’ MCP ๅฏพๅฟœใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใซ่ฟฝๅŠ ใ—ใฆใใ ใ•ใ„ใ€‚

{
  "mcpServers": {
    "ssh-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fangjunjie/ssh-mcp-server",
        "--host",
        "192.168.1.1",
        "--port",
        "22",
        "--username",
        "root",
        "--password",
        "pwd123456"
      ]
    }
  }
}

ใƒ„ใƒผใƒซ

ใƒ„ใƒผใƒซใฏๆคœๅ‡บใ•ใ‚Œใพใ›ใ‚“ใงใ—ใŸ

ใƒ„ใƒผใƒซใฏ README ใ‹ใ‚‰่‡ชๅ‹•็š„ใซๆŠฝๅ‡บใ•ใ‚Œใพใ™ใ€‚ใƒกใƒณใƒ†ใƒŠใƒผใฏ ## Tools ใจใ„ใ†่ฆ‹ๅ‡บใ—ใฎไธ‹ใซ่จ˜่ผ‰ใ™ใ‚‹ใ“ใจใงใ€ใ“ใฎใ‚ฟใƒ–ใซๅๆ˜ ใงใใพใ™ใ€‚

ๆฆ‚่ฆ

What is ๐Ÿ” ssh-mcp-server?

๐Ÿ” ssh-mcp-server is a Model Context Protocol (MCP) server that enables AI assistants and other MCP-compatible applications to execute remote SSH commands through a standardized interface. It acts as a secure bridge, allowing AI models to operate remote servers without directly exposing SSH credentials.

How to use ๐Ÿ” ssh-mcp-server?

It can be run directly via npx without global installation. Configuration is done in your MCP client's mcp.json file, passing arguments such as --host, --port, --username, and authentication method (--password, --privateKey, or --passphrase). Multiple connection profiles, command restrictions, transport modes, and MFA support are configured through additional CLI arguments or a JSON config file.

Key features of ๐Ÿ” ssh-mcp-server

  • Supports password and private key (with passphrase) authentication
  • Whitelist and blacklist patterns for command security control
  • Complies with MCP protocol for seamless AI integration
  • Dual transport modes: exec and shell for bastion/jump hosts
  • Bidirectional file transfer (upload and download)
  • Credentials managed locally, never exposed to AI models

Use cases of ๐Ÿ” ssh-mcp-server

  • AI assistant executing remote server commands (e.g., system inspection, log reading)
  • Securely managing servers through MCP clients with command restrictions
  • Connecting to bastion/jump hosts or devices that require an interactive shell
  • Multi-server management via a single MCP server configuration
  • Automated file transfers between local and remote machines

FAQ from ๐Ÿ” ssh-mcp-server

What authentication methods are supported?

Password authentication, private key authentication, and private key with passphrase are supported. The server can also reuse entries from ~/.ssh/config.

How can I restrict which commands can be executed?

Use --whitelist to allow only commands matching specified patterns, or --blacklist to block dangerous commands. Both accept comma-separated regular expressions.

What is the difference between exec and shell transport modes?

exec mode supports command execution, upload, and download. shell mode runs commands through a persistent shell session (useful for bastion hosts) but does not support file transfers (upload/download).

How do I handle MFA (multi-factor authentication) on the SSH server?

Enable --try-keyboard and set the environment variable SSH_MCP_2FA_CODE before connecting. The server will supply password and private key automatically, then prompt for the 2FA code.

What tools does this server provide?

It provides four tools: execute-command (run commands), upload (upload files), download (download files), and list-servers (list configured SSH connections).

ใ‚ณใƒกใƒณใƒˆ

ใ€Œ้–‹็™บ่€…ใƒ„ใƒผใƒซใ€ใฎไป–ใฎใ‚ณใƒณใƒ†ใƒณใƒ„