ssh-mcp
Click on "Install 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 ที่ค้างในเซสชัน |
| ปิดเซสชัน |
| แสดงเซสชันที่เปิดอยู่ |
ติดตั้ง
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aposadm/ssh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server