A Model Context Protocol (MCP) server that provides comprehensive cloud build workflow support. Through rclone, it enables file synchronization, remote command execution, and automated builds, helping developers achieve a cloud development model of local development and remote building.
- π Directory Synchronization: Intelligently sync local directories to remote servers with support for ignore rules and incremental updates
- π€ File Upload: Quickly upload individual files to remote servers
- π File Reading: Read file contents from remote servers with support for multiple encoding formats
- π₯οΈ Remote Command Execution: Execute commands on remote servers via SSH
- π Directory Browsing: List remote directory contents and view detailed file information
- π§ Automated Builds: Support for automatic builds after synchronization with automatic compilation error fixing
- βοΈ Flexible Configuration: Support for project-level configuration and environment variable configuration
- Python 3.12 or higher
- rclone (for file transfer operations, supports multiple backends such as SFTP, S3, FTP, etc.)
- MCP client (such as Claude Desktop, Cursor, etc.)
pip install -r requirements.txtuv sync- Install rclone: Download and install from rclone official website
- Configuration
-
GUI Method:
GUI Download: https://github.com/rclone/rclone-webui-react
Load command:
rclone rcd --rc-web-gui --rc-user=abc --rc-pass=abcd ./uiThen configure via the GUI.
-
Command Line Method:
Configure Remote Storage: Run
rclone configto create remote configuration. rclone supports multiple backend types (SFTP, S3, FTP, Google Drive, etc.)rclone config
SFTP Configuration Example:
[route84] type = sftp host = 192.0.0.1 user = xxxx pass = <obscured_password> # Password encrypted using rclone obscure shell_type = unix port = 22 # Optional, defaults to 22
Note: rclone supports multiple storage backends. You can configure different types of remote storage such as SFTP, S3, FTP, etc., according to your needs.
- Configuration File Location: rclone automatically searches for configuration files in the following order:
- Path specified by
RCLONE_CONFIGenvironment variable rclone.confin the current working directoryrclone.confin the Python script directory- Windows:
%APPDATA%\rclone\rclone.conf - Linux/Mac:
~/.config/rclone/rclone.confor~/.rclone.conf
- Path specified by
Add server configuration to the MCP client configuration file (using Claude Desktop as an example, the configuration file is usually located at ~/Library/Application Support/Claude/claude_desktop_config.json or the corresponding location on Windows):
{
"mcpServers": {
"cloud-builder": {
"command": "uv",
"args": [
"--directory",
"/path/to/cloud-builder",
"run",
"python",
"src/main.py"
],
"env": {
"RCLONE_EXE_PATH": "D:\\dev\\rclone\\rclone.exe",
"PROJECT_PATH": "${workspaceFolder}"
}
}
}
}Important Notes:
- Replace
/path/to/cloud-builderwith the absolute path to the project root directory - The
PROJECT_PATHenvironment variable is used to specify the current working project directory. The server will look for the.cloudbuilder.jsonconfiguration file in this directory - The server uses stdio transport and does not require a network port
CloudBuilder supports two configuration methods, with project-level configuration taking precedence over environment variables.
Create a .cloudbuilder.json file in each project root directory:
{
"REMOTE_HOST_NAME": "route84",
"LOCAL_PATH": "E:\\AI\\test_c",
"REMOTE_PATH": "/home/xxxx/ftp_dir",
"BUILD_COMMAND": {
"build": "/home/xxxx/ftp_dir/build.sh",
"clean": "make clean",
"rebuild": "/home/xxxx/ftp_dir/rebuild.sh"
}
}BUILD_COMMAND Configuration:
BUILD_COMMAND supports two formats:
-
JSON Key-Value Format (Recommended): Define multiple build commands and select which one to execute by key
"BUILD_COMMAND": { "build": "/home/xxxx/ftp_dir/build.sh", "clean": "make clean", "rebuild": "/home/xxxx/ftp_dir/rebuild.sh" }
-
String Format (Backward Compatible): Single build command
"BUILD_COMMAND": "/home/xxxx/ftp_dir/build.sh"
When using JSON key-value format:
- If there's only one key-value pair,
build_workflowandsync_and_build_workflowwill automatically use that command - If there are multiple key-value pairs, you need to specify the
command_keyparameter when using the workflow to select which command to execute
Advantages:
- β Each project can have independent configuration
- β Configuration is managed together with project code (can be committed to version control)
- β Automatically uses corresponding configuration when switching projects
Search Logic: The server searches for the .cloudbuilder.json file in the directory specified by the PROJECT_PATH environment variable.
Set environment variables in the MCP client configuration:
{
"mcpServers": {
"cloud-builder": {
"command": "python",
"args": ["-m", "src.main"],
"env": {
"REMOTE_HOST_NAME": "route84",
"RCLONE_EXE_PATH": "D:\\dev\\rclone\\rclone.exe",
"LOCAL_PATH": "E:\\AI\\test_c",
"REMOTE_PATH": "/home/xxxx/ftp_dir",
"BUILD_COMMAND": "{\"build\": \"/home/xxxx/ftp_dir/build.sh\", \"clean\": \"make clean\"}"
}
}
}
}Note: When using JSON key-value format in environment variables, you need to serialize the JSON object as a string.
| Configuration Item | Description | Required | Notes |
|---|---|---|---|
REMOTE_HOST_NAME |
Remote configuration name in rclone.conf (e.g., route84) | β | Must exactly match the name in rclone configuration (case-sensitive) |
RCLONE_EXE_PATH |
Path to rclone executable file | β | Optional, recommended to set for path validation |
LOCAL_PATH |
Local project directory path | β | Local root directory for file synchronization |
REMOTE_PATH |
Remote server directory path | β | Remote root directory for file synchronization |
BUILD_COMMAND |
Build command (string or JSON key-value pairs) | β | Optional, used for automated build workflows. Supports string format (backward compatible) or JSON key-value format (recommended) |
Important Notes:
- Remote connection information (host, user, pass, port, etc.) is automatically read from rclone.conf and does not need to be set in the configuration
- Passwords are encrypted/decrypted using rclone's obscure algorithm, no manual handling required
- rclone supports multiple backend types (SFTP, S3, FTP, etc.), and configuration methods may vary slightly
- Synchronization ignore rules are read from the project's
.sync_rulesfile (rclone filter format)
Create a .sync_rules file in the project root directory using rclone filter format:
- .specstory/**
- .cursorindexingignore
- build/**
- *.log
- node_modules/**
Synchronize local directory to remote server (via rclone).
Parameters:
local_dir(optional): Local directory path, defaults toLOCAL_PATHconfigurationremote_dir(optional): Remote directory path, defaults toREMOTE_PATHconfigurationdelete_excess(optional): Whether to delete files in the target that don't exist in the source, defaults totrue
Returns: Dictionary containing synchronization results, including:
- List and statistics of uploaded files
- List of created directories
- List of deleted files (if enabled)
- List of ignored items
- Error messages (if any)
Examples:
# Use default configuration paths
sync_directory()
# Specify custom paths
sync_directory("/custom/local/path", "/custom/remote/path")
# Disable deleting excess files
sync_directory(delete_excess=False)Upload a single file to remote server (via rclone).
Parameters:
local_file_path: Local file path to upload (recommended to use absolute path, or relative path relative toLOCAL_PATH)remote_file_path(optional): Remote target path. If not specified, automatically determined based onLOCAL_PATH/REMOTE_PATHmapping
Returns: Dictionary containing upload results, including file size and path information.
Examples:
# Automatically determine remote path (based on LOCAL_PATH/REMOTE_PATH mapping)
upload_file("E:\\AI\\test_c\\main.c")
# Specify exact remote target path
upload_file("E:\\AI\\test_c\\main.c", "/home/xxxx/ftp_dir/main.c")Read file content from remote server (via rclone).
Parameters:
remote_file_path: Remote file path to readencoding(optional): Text encoding format, defaults toutf-8
Returns: Dictionary containing file content, size, and encoding information.
Examples:
# Read using default UTF-8 encoding
read_remote_file("/home/xxxx/ftp_dir/main.c")
# Specify encoding format
read_remote_file("/home/xxxx/ftp_dir/main.c", "latin-1")Execute commands on remote server via SSH.
Parameters:
command: Command to execute on remote serverworking_directory(optional): Working directory for the command
Returns: Dictionary containing command output, exit code, stdout, and stderr.
Examples:
# Simple command
execute_remote_command("ls -la")
# Command with working directory
execute_remote_command("make clean", "/home/xxxx/ftp_dir")
# Execute build command
execute_remote_command("/home/xxxx/ftp_dir/build.sh")List contents of remote directory (via rclone).
Parameters:
remote_dir_path: Remote directory path to list
Returns: Dictionary containing directory contents, including file names, sizes, permissions, and type information.
Examples:
list_remote_directory("/home/xxxx/ftp_dir")Get current CloudBuilder server configuration information (does not include sensitive data such as passwords).
Returns: JSON containing the following information:
- Connection status (configured/incomplete)
- Remote server information (host, port, username)
- Path configuration (local path, remote path)
- Build command (if configured)
- Missing or incomplete settings
Workflow prompt for checking CloudBuilder configuration. Guides how to:
- Get current configuration
- Check configuration completeness
- Report missing configuration items
File synchronization workflow prompt. Provides step-by-step guidance for synchronizing files to remote servers.
Remote build workflow prompt. Supports:
- Executing build commands on remote servers
- Automatically reading compilation errors
- Automatically fixing errors (up to 5 attempts)
- Converting remote file paths to local paths for fixing
Parameters:
command_key(optional): Key of the build command to use. If not provided andBUILD_COMMANDcontains only one key-value pair, automatically uses that command. IfBUILD_COMMANDcontains multiple key-value pairs, this parameter is required.
Complete workflow prompt for synchronization and building. Combines file synchronization and automated building, including:
- Synchronizing files to remote servers
- Executing build commands (supports selection by key)
- Automatically fixing compilation errors
- Repeating until build succeeds or maximum attempts reached
Parameters:
command_key(optional): Key of the build command to use. If not provided andBUILD_COMMANDcontains only one key-value pair, automatically uses that command. IfBUILD_COMMANDcontains multiple key-value pairs, this parameter is required.
- β Stdio Transport: Server uses stdio transport, eliminating network security issues
- β Password Encryption: Remote credentials stored in rclone.conf using rclone's obscure algorithm encryption
- β Automatic Decryption: Passwords automatically decrypted, no need to store in plain text in environment variables
- β Sensitive Data Protection: Sensitive data (such as passwords) will not be exposed in logs or responses
- β Path Restrictions: All file operations are restricted to configured paths
- β SSH Security: SSH connections use paramiko with appropriate host key handling
- β Multi-Backend Support: Support for multiple storage backends (SFTP, S3, FTP, etc.) through rclone
Problem: Unable to connect to remote server
Solutions:
- Verify that
REMOTE_HOST_NAMEexactly matches the remote configuration name in rclone.conf (case-sensitive) - Check if rclone.conf configuration file exists and is readable
- Verify that configuration fields in rclone.conf are correct (fields may vary depending on backend type)
- SFTP:
host,user,pass,port, etc. - S3:
access_key_id,secret_access_key,region, etc. - For other backends, refer to rclone documentation
- SFTP:
- If there is a
portfield in the configuration (such as SFTP), ensure the port number is correct (default is 22) - Check if the remote server is accessible from your network
- Use
rclone config show <remote_name>to verify the configuration is correct - Test rclone connection:
rclone lsd <remote_name>:
Problem: File synchronization fails or path errors
Solutions:
- Verify that
LOCAL_PATHexists and is readable - Ensure that
REMOTE_PATHexists on the remote server and has write permissions - Check file permissions on local and remote systems
- Use absolute paths instead of relative paths
- Verify path mapping is correct (
LOCAL_PATHβREMOTE_PATH)
Problem: Configuration not taking effect or configuration file not found
Solutions:
- Check if
PROJECT_PATHenvironment variable is set correctly - Confirm that
.cloudbuilder.jsonfile is located in the project root directory - Verify JSON format is correct (can use JSON validation tools)
- Check if configuration item names are spelled correctly
- View server logs to understand the configuration loading process
Problem: rclone operations fail
Solutions:
- Ensure rclone.conf file is in a searchable location (see configuration file location instructions above)
- Use
rclone config pathsto view rclone's configuration file path - Verify remote configuration name is spelled correctly (case-sensitive)
- If password decryption fails, check if the pass field (if applicable) is a valid obscure encrypted value
- You can use
python src/rclone/rclone_decrypt_pass.py --remote <remote_name>to test configuration reading - If
RCLONE_EXE_PATHis set, verify the path exists and is executable - Depending on the backend type used, ensure all required configuration fields are correctly set
Problem: Files that shouldn't be synchronized are being synchronized, or files that should be synchronized are being ignored
Solutions:
- Check if
.sync_rulesfile format is correct (rclone filter format) - Patterns support Unix-style wildcards (
*,?,[]) - Directory patterns should end with
/ - Use
-prefix to indicate exclusion patterns - Test rules:
rclone ls <remote_name>:<remote_path> --filter-from .sync_rules
Problem: Build command execution fails
Solutions:
- Verify that
BUILD_COMMANDpath is correct - Ensure build command is executable on remote server
- Check working directory permissions on remote server
- View error messages in command output
- Try manually executing the build command on remote server to verify
-
Check Configuration:
Use check_config_workflow prompt to check current configuration -
Synchronize Files:
Use sync_workflow prompt to synchronize local files to remote server -
Execute Build:
Use build_workflow prompt to build project on remote server -
Synchronize and Build:
Use sync_and_build_workflow prompt to complete the full synchronization and build process
# 1. Synchronize entire project directory
sync_directory()
# 2. Upload a single file
upload_file("src/main.c")
# 3. Read remote file
read_remote_file("/home/xxxx/ftp_dir/src/main.c")
# 4. Execute build command
execute_remote_command("/home/xxxx/ftp_dir/build.sh", "/home/xxxx/ftp_dir")
# 5. List remote directory
list_remote_directory("/home/xxxx/ftp_dir")Note: MCP servers typically don't need to be run manually. They are automatically started and managed by MCP clients (such as Claude Desktop, Cursor). If you need to test manually, you can use:
uv run python src/main.pyThis project is licensed under the MIT License.
Issues and Pull Requests are welcome!
For questions or suggestions, please contact us through:
- Submit a GitHub Issue
- View project documentation