Skip to main content

High-performance SSH & SFTP MCP Server for Linux

Project description

SSH & SFTP MCP Server (ssh-mcp-vn)

Một MCP (Model Context Protocol) Server mạnh mẽ dùng để thực thi lệnh (SSH) và truyền tải file (SFTP) trên nhiều máy chủ Linux từ xa (multi-host) cùng lúc.

Hướng dẫn cài đặt

Chạy qua UVX (Được khuyến nghị)

Bạn có thể chạy trực tiếp server này qua uvx mà không cần phải tải hay cài đặt thủ công:

uvx ssh-mcp-vn

Các tính năng chính

  • Hỗ trợ Multi-host: Có thể tương tác với nhiều máy chủ Linux mà không cần chạy nhiều instance.
  • Thực thi qua SSH: Chạy lệnh bash/shell tùy ý trên máy chủ từ xa.
  • Quản lý thư mục: Dễ dàng tạo cấu trúc thư mục từ xa (hoạt động giống lệnh mkdir -p).
  • Tải lên qua SFTP: Đẩy file từ máy tính cá nhân lên máy chủ từ xa.
  • Tải về qua SFTP: Tải file từ máy chủ từ xa về máy tính.
  • Liệt kê file bằng SFTP: Xem danh sách các file trong một thư mục bất kỳ trên máy chủ.

Cấu hình

MCP server này hỗ trợ nhận cấu hình dạng một chuỗi JSON (JSON string) qua biến môi trường SSH_SERVERS. Trong file mcp_config.json, bạn cấu hình theo định dạng như sau:

{
  "mcpServers": {
    "ssh-server": {
      "command": "uvx",
      "args": [
        "ssh-mcp-vn"
      ],
      "env": {
        "SSH_SERVERS": "[{\"host\":\"192.168.1.100\", \"user\":\"root\", \"password\":\"mat_khau_1\", \"port\":22}, {\"host\":\"192.168.1.101\", \"user\":\"ubuntu\", \"key_path\":\"/path/to/key.pem\"}]"
      }
    }
  }
}

Các trường trong mảng JSON cấu hình

Trong mảng JSON cấu hình (SSH_SERVERS), mỗi object hỗ trợ các trường sau:

  • host (bắt buộc): Địa chỉ IP hoặc Hostname của máy chủ SSH.
  • user (bắt buộc): Tên đăng nhập (username).
  • port (tùy chọn): Cổng SSH, mặc định là 22.
  • password (tùy chọn): Mật khẩu đăng nhập.
  • key_path (tùy chọn): Đường dẫn tuyệt đối đến file khóa bí mật (private key) nếu dùng key để đăng nhập.

Danh sách công cụ (Tools)

(Tất cả các công cụ đều yêu cầu tham số host để hệ thống biết sẽ thao tác trên máy chủ nào).

  • ssh_execute_command: Chạy một lệnh shell trên máy Linux từ xa.
  • ssh_create_folder: Tạo thư mục từ xa.
  • sftp_upload_file: Chuyển một file từ local lên máy chủ.
  • sftp_download_file: Lấy một file từ máy chủ về local.
  • sftp_list_directory: Liệt kê tất cả file trong một thư mục từ xa.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssh_mcp_vn-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssh_mcp_vn-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file ssh_mcp_vn-0.1.0.tar.gz.

File metadata

  • Download URL: ssh_mcp_vn-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ssh_mcp_vn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58cc30f2deda6092f952c4fbe4b5714bfb7290b12bf4ca051ca1cd463aac1ba6
MD5 f4ff39f2e3b90298f3b544e900f7dfe0
BLAKE2b-256 95e6cc82d490c3eec03bfb825164dc97403a7ec1daf99dac7fb7444d1a10d1e9

See more details on using hashes here.

File details

Details for the file ssh_mcp_vn-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ssh_mcp_vn-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ssh_mcp_vn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5be1fef7819f032343ef72bdf32dae1cb009cde67a04189d11cca3e83a4713
MD5 1cc9e7753ffc424802622f2a6ebd4ed7
BLAKE2b-256 c2c915bc2252c3c0eeefc44e11cb9e5919631243f1d8ccd2c80d69039c0a7d23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page