ssh-mcp
Click on "Deploy 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-mcprun 'df -h' on prod server"
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
MCP server ที่เปิดให้ Claude (หรือ MCP client อื่น) สั่งงานเครื่องปลายทางผ่าน SSH ได้ —
รันคำสั่ง, อ่าน/เขียนไฟล์, โอนไฟล์ SFTP และเปิด shell แบบ interactive
กำหนดหลายโฮสต์ผ่านไฟล์ .env ยืนยันตัวตนด้วย username/password
ความสามารถ (Tools)
Tool | หน้าที่ |
| แสดงรายชื่อโฮสต์ที่ตั้งค่าไว้ (ไม่คืน password) |
| รันคำสั่ง คืน stdout / stderr / exit_status |
| อ่านไฟล์ปลายทางผ่าน SFTP |
| เขียน/สร้างไฟล์ปลายทางผ่าน SFTP |
| แสดงรายการไฟล์ในไดเรกทอรีปลายทาง |
| อัปโหลดไฟล์ในเครื่อง → ปลายทาง |
| ดาวน์โหลดไฟล์ปลายทาง → เครื่องนี้ |
| เปิด interactive shell คืน |
| ส่งข้อความ/คำสั่งเข้าเซสชัน แล้วคืน output |
| อ่าน output ที่ค้างในเซสชัน |
| ปิดเซสชัน |
| แสดงเซสชันที่เปิดอยู่ |
Related MCP server: SSH MCP Server
ติดตั้ง
pip install -r requirements.txt
# หรือแบบ editable พร้อม console script `ssh-mcp`
pip install -e .ตั้งค่า
คัดลอก .env.example → .env แล้วแก้ค่าโฮสต์จริง แต่ละโฮสต์เป็น "profile" ตามรูปแบบ prefix:
SSH_PROFILES=prod,staging
SSH_PROD_HOST=10.0.0.1
SSH_PROD_PORT=22
SSH_PROD_USER=root
SSH_PROD_PASSWORD=secret
SSH_STAGING_HOST=10.0.0.2
SSH_STAGING_USER=deploy
SSH_STAGING_PASSWORD=secretชื่อ profile (ตัวพิมพ์เล็ก เช่น
prod,staging) คือค่าที่ส่งเป็น argumenthostของแต่ละ toolSSH_PROFILESระบุ/จัดลำดับ profile ที่จะเปิดใช้ ถ้าเว้นว่างจะ auto-detect จากSSH_*_HOSTทั้งหมดGlobal options:
SSH_CONNECT_TIMEOUT,SSH_COMMAND_TIMEOUT,SSH_KNOWN_HOSTS_POLICY(auto_add|reject)
ความปลอดภัย:
.envอยู่ใน.gitignoreอยู่แล้ว อย่า commit ค่าจริง สำหรับ production แนะนำตั้งSSH_KNOWN_HOSTS_POLICY=reject(โฮสต์ต้องอยู่ใน~/.ssh/known_hosts)
รัน
python -m ssh_mcp.server # stdio transport
# หรือ (หลัง pip install -e .)
ssh-mcpเชื่อมกับ Claude Code / Claude Desktop
เพิ่มเข้าไฟล์ config MCP:
{
"mcpServers": {
"ssh": {
"command": "python",
"args": ["-m", "ssh_mcp.server"],
"cwd": "d:\\AI\\apos"
}
}
}ทดสอบด้วย MCP Inspector
npx @modelcontextprotocol/inspector python -m ssh_mcp.serverแล้วลองเรียก ssh_list_hosts → ssh_exec (เช่น whoami) → วงจร ssh_session_open / ssh_session_send / ssh_session_close
ตัวอย่างการใช้ interactive session
ssh_session_open(host="prod")→ ได้session_idssh_session_send(session_id, data="top\n")→ คืน output รอบแรกssh_session_send(session_id, data="q")เพื่อออกจาก topssh_session_close(session_id)
หมายเหตุ:
ssh_session_sendไม่เติม newline ให้อัตโนมัติ — ต้องใส่\nเองเมื่อต้องการกด enter
This server cannot be deployed
Maintenance
Related MCP Connectors
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Run commands and read/write files on your servers over Termalin's keyless tunnels (hosted MCP).
Remote shell and detached long-running jobs on your own machines — no SSH, open ports or VPN.
- emisarOAuthdev.emisar
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables SSH operations including connecting to remote servers, executing commands, and transferring files between local and remote systems. Supports multiple SSH connections with both password and private key authentication methods.18-
- AlicenseBqualityDmaintenanceEnables SSH connectivity and remote command execution on servers, allowing users to test connections and run commands remotely with support for both local networks and public servers.27 npm1ISC
- AlicenseAqualityDmaintenanceEnables secure SSH connections to multiple remote servers with support for command execution, file transfers (SFTP), directory listing, and both password and key-based authentication.7MIT
- AlicenseAqualityDmaintenanceEnables remote server management through SSH and SFTP, supporting command execution, file transfers, and interactive shell sessions. It allows for multiple concurrent connections using either password or SSH key authentication.119 npm4MIT