This container is designed for using VSCode with multiple remote locations mounted via SSHFS. It enables seamless development across several remote servers, with all mounts accessible under /mnt/sshfs/{project}.
It also mitigates VSCode deprecating old servers. You can mount your old servers into this container and keep on using VSCode.
- SSHFS Mounts: Automatically mounts remote project folders as defined in
/config/servers.jsonto/mnt/sshfs/{name}. - Integrated MCP Server (
ssh_search): Provides fast, credential-aware remote file and string search for use with Roo, Cline, or other MCP-compatible agents. - Password and key-based SSH support: Uses credentials from
/config/servers.json. - Remote Command Execution (
dremote): Execute commands directly on remote servers while maintaining correct paths.
The dremote command allows you to execute commands directly on the remote server while preserving the correct path mapping. This is particularly useful for operations that are faster to perform directly on the server rather than through SSHFS, such as:
- Git operations (add, commit, push)
- File operations on large sets of files
- Server-side build or deployment commands
- Database operations
dremote <command>Example: When you're in an SSHFS mounted directory like /mnt/sshfs/myproject/src and run:
dremote git statusThe command executes in the corresponding remote directory (e.g., /var/www/myproject/src).
-
Git Operations:
dremote git add . dremote git commit -m "Update files" dremote git push
-
File Operations:
dremote find . -name "*.log" dremote rm -rf cache/*
-
Build Commands:
dremote npm run build dremote composer install
The command automatically:
- Determines which server to use based on your current SSHFS mount
- Maps the local path to the correct remote path
- Uses the appropriate SSH credentials from your config
-
Build the container:
docker build -t ssh-proxy . -
Run the container (mount your config):
docker run -v $(pwd)/config:/config ssh-proxy- Ensure your
servers.jsonis in theconfigdirectory.
- Ensure your
-
Purpose: Exposes two tools for Roo/Cline or other MCP clients:
list_folders(): Lists available project folders (from/mnt/sshfs).remote_search(folder, regex, file_pattern): Searches for strings or patterns on the remote server using SSH, with credentials from/config/servers.json.
-
How it works:
The MCP server is started automatically by Roo/Cline when needed. It uses the FastMCP protocol to expose its tools. No manual port or server management is required. -
Config Add this to your mcp-server config
"ssh_search": { "command": "/venv/bin/python", "args": [ "/tools/mcp_ssh_search/server.py" ] }
Add this to your system prompt:
When searching for files or strings in files, always use mcp tool ssh_search. List folders before first use and determine the right folder from current workspace.
Typical workflow:
- Use
list_folders()to see available projects. - Use
remote_search(folder, regex, file_pattern)to search files or strings in the correct project.
{
"servers": [
{
"name": "project_name",
"user": "ssh_user",
"password": "your_password_or_remove_for_key_auth",
"host": "example.com",
"port": 22,
"remote_path": "/"
}
// ... more servers
]
}- All SSHFS mounts appear under
/mnt/sshfs/{name}. - The MCP server is only accessible inside the container.
- Roo/Cline will automatically discover and use the MCP server for search operations.