install_instructions.txt•3.26 kB
## Step 1: Save the Files
Ensure all the generated files (`Dockerfile`, `requirements.txt`, `ubuntu_server.py`, `README.md`, `GEMINI.md`, and this file) are in the `ubuntu` directory.
## Step 2: Build Docker Image
Open a terminal and navigate to the `ubuntu` directory. Run the following command to build the Docker image:
```bash
docker build -t ubuntu-mcp-server .
```
## Step 3: Set Up Secrets
This server requires the SSH private key to be stored as a Docker secret. It also requires the VM's host and user to be set.
1. **Store the SSH Key**:
First, get the content of your private key. For example:
```bash
cat ~/.ssh/id_rsa
```
Then, create a Docker secret named `UBUNTU_SSH_KEY` with the content of your key.
**Important**: Be careful with your private key.
You can create the secret using the `docker mcp secret` command (this is a conceptual example, your specific tool might have a different way of setting secrets):
```bash
docker mcp secret set UBUNTU_SSH_KEY "<paste your private key content here>"
```
2. **Set Environment Variables**:
You will also need to set `UBUNTU_HOST` and `UBUNTU_USER` when you run the container. For example, `UBUNTU_HOST=192.168.1.100` and `UBUNTU_USER=myuser`.
## Step 4: Create Custom Catalog
Follow your MCP client's instructions for adding a custom catalog. You will need to add an entry for the `ubuntu-mcp-server`. Here is an example snippet for a `custom.yaml` file:
```yaml
version: 2
name: custom
displayName: Custom MCP Servers
registry:
ubuntu:
description: "An MCP server to interact with an Ubuntu VM via SSH."
title: "Ubuntu VM Control"
type: server
dateAdded: "2025-11-02T12:00:00Z"
image: ubuntu-mcp-server:latest
ref: ""
readme: ""
toolsUrl: ""
source: ""
upstream: ""
icon: ""
tools:
- name: execute_command
- name: type_text
- name: click
- name: get_active_window_title
- name: take_screenshot
secrets:
- name: UBUNTU_SSH_KEY
env: UBUNTU_SSH_KEY
example: "-----BEGIN OPENSSH PRIVATE KEY-----"
# You will need to pass these as environment variables when running the container
# For example, using `docker run -e UBUNTU_HOST=... -e UBUNTU_USER=...`
# Or configure them in your MCP client if it supports it.
metadata:
category: automation
tags:
- ubuntu
- vm
- remote control
license: MIT
owner: local
```
## Step 5: Run the Server
When you run the server (either directly with `docker run` or through your MCP client), you must provide the `UBUNTU_HOST` and `UBUNTU_USER` environment variables.
Example `docker run` command:
```bash
docker run -i --rm \
-e UBUNTU_HOST=192.168.1.100 \
-e UBUNTU_USER=myuser \
--mount type=secret,id=UBUNTU_SSH_KEY,target=/run/secrets/UBUNTU_SSH_KEY,mode=0400 \
ubuntu-mcp-server
```
(Note: The way secrets are mounted and environment variables are passed may vary depending on your MCP client setup.)
## Step 6: Restart and Test
Restart your MCP client (e.g., Claude Desktop) and the new tools from the Ubuntu VM Control server should appear. You can test them by asking the assistant to perform actions on your VM.
```