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 (Khuyên dùng qua File JSON)

Vì mảng cấu hình có thể khá dài và việc viết chuỗi JSON dính liền với các dấu \ (escape) trong cấu hình môi trường sẽ phức tạp, bạn nên tách cấu hình ra một file JSON riêng biệt.

Bước 1: Tạo một file có tên ssh_servers.json ở bất kỳ đâu trên máy của bạn (ví dụ C:\Users\NamHT\ssh_servers.json) và điền danh sách các server dạng mảng thuần túy:

[
  {
    "name": "production_server",
    "host": "192.168.1.100",
    "user": "root",
    "password": "mat_khau_1",
    "port": 22
  },
  {
    "name": "staging_server",
    "host": "192.168.1.101",
    "user": "ubuntu",
    "key_path": "/path/to/key.pem"
  }
]

Bước 2: Cập nhật mcp_config.json của ArcticFactory chỉ truyền vào biến SSH_CONFIG_FILE trỏ đến file đó:

{
  "mcpServers": {
    "ssh-server": {
      "command": "uvx",
      "args": [
        "ssh-mcp-vn"
      ],
      "env": {
        "SSH_CONFIG_FILE": "C:\\Users\\NamHT\\ssh_servers.json"
      }
    }
  }
}

Các trường trong từng block JSON cấu hình

Mỗi object của một server hỗ trợ các trường sau:

  • name (bắt buộc): Tên gọi riêng cho server này (VD: "production", "staging") để giúp công cụ AI nhận biết server muốn thao tác.
  • 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ố server_name để 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.2.tar.gz (5.4 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.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ssh_mcp_vn-0.1.2.tar.gz
  • Upload date:
  • Size: 5.4 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.2.tar.gz
Algorithm Hash digest
SHA256 db07d279b49694176c2aa883dbbabd01990d0e43e6932eaae3b7a38929b0d9e1
MD5 925e66e0b31c4c357ec8ba96bff83005
BLAKE2b-256 7899c3690633d267f6b89442dac538a53bd45aafb66c8270f5b7cc903427e32d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssh_mcp_vn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d67488cdf19dc7a7b5b343b57a1cb805bcd5889c0af0955d114a80099991ad6
MD5 c3644e45f6a48333f4e723ad2903d621
BLAKE2b-256 0022d06533fab0bf0899448e59cd61fe14ae61bf61bb04444591d792a129afb5

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