Lee Painter Music for the Soul. Code for the Bowl.
30 November 2026 / Agentic AI

Giving GitHub Copilot SSH Access to Remote Development Environments


In my previous article I looked at how we can use ChatGPT to interact with a development server using Maverick SSH MCP. What interests me about this is not so much that an AI can execute a command over SSH, but that it can determine for itself which commands it needs to execute in order to answer a question.

Having spent much of the last 25 years developing SSH APIs, I find this a rather interesting change in the way those APIs are being consumed. We would ordinarily write some code to establish a connection, execute a command and do something with the result. Now we can describe what we want to achieve and leave much of that work to the AI.

Of course, ChatGPT is only one of the applications that supports MCP. What about the AI we are already using within our development environment?

For this article we’ve been looking at GitHub Copilot in Eclipse. Rather than connect it to an existing development server, we’re going to create a couple of SSH servers in Docker and give Copilot access to them. This gives us an environment in which we can experiment without worrying about what the AI might do to one of our actual servers.

Where does the SSH connection originate?

One of the things worth understanding about Maverick SSH MCP is that the AI is not making the SSH connection itself. It is asking our MCP server to make that connection on its behalf. The SSH implementation is our Maverick Synergy Java SSH API, and the connection remains open in the MCP server until the AI closes it.

When the AI connects it gets a handle back. It can then use that handle to execute commands, open an interactive shell or create an SFTP session. This is particularly useful when there is more than one server involved, as we’ll see later.

For this exercise there are two separate forms of authentication. Eclipse authenticates to the MCP server using a bearer token over HTTP. Maverick authenticates to the SSH servers using a private key. We can tell Copilot where the key is located within the MCP container without having to put the key itself into the conversation. That is not, of course, a guarantee that an agent with file access cannot read sensitive material.

Creating an SSH playground

I’m using two Alpine Linux containers running OpenSSH. We’ve tested the original lab on an Apple Silicon Mac using Podman and Docker Compose. You can use Docker instead. You’ll also need OpenSSH, OpenSSL and Eclipse with the GitHub Copilot plugin installed and signed in.

Create a directory called ssh-lab and work from there. We’ll use a separate Docker network so that Maverick and both SSH servers can communicate by container name.

docker network create jadaptive-net

Generate a key specifically for this exercise. There is no passphrase on this key, so please don’t reuse it for anything outside this lab.

mkdir -p keys
ssh-keygen -t ed25519 -f keys/lab_key -N ""
cp keys/lab_key.pub keys/authorized_keys

The following Dockerfile gives us a minimal SSH server with a single user called lab. I’ve kept password authentication and root login disabled; neither is necessary for what we’re doing here.

# ssh-lab: minimal OpenSSH test server (Alpine, pinned)
ARG ALPINE_VERSION=3.24.4
FROM alpine:${ALPINE_VERSION}

ARG LAB_USER=lab
ARG LAB_UID=1000
ENV LAB_USER=${LAB_USER}

# Upgrade installed packages before adding OpenSSH.
RUN apk upgrade --no-cache \
 && apk add --no-cache openssh-server openssh-sftp-server bash curl \
 && adduser -D -u ${LAB_UID} -s /bin/bash ${LAB_USER} \
 && echo "${LAB_USER}:$(head -c 48 /dev/urandom | base64 | tr -d '\n')" | chpasswd \
 && mkdir -p /home/${LAB_USER}/workspace && chown ${LAB_USER}: /home/${LAB_USER}/workspace \
 && printf '%s\n' \
    'Port 22' \
    'PermitRootLogin no' \
    'PasswordAuthentication no' \
    'KbdInteractiveAuthentication no' \
    'PubkeyAuthentication yes' \
    "AllowUsers ${LAB_USER}" \
    'Subsystem sftp internal-sftp' \
    'LogLevel INFO' > /etc/ssh/sshd_config

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 755 /usr/local/bin/entrypoint.sh

EXPOSE 22
HEALTHCHECK --interval=30s --timeout=3s CMD nc -z 127.0.0.1 22 || exit 1
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

Create entrypoint.sh alongside it. Each new container generates its own host keys and installs the public key we generated earlier. I’ve also left in the provision for trusting an SSH certificate authority, which will be useful when we come to look at SSH Teams.

#!/bin/sh
set -eu
# Unique host keys per container
ssh-keygen -A >/dev/null

H=/home/${LAB_USER}
install -d -m 700 -o "${LAB_USER}" -g "${LAB_USER}" "$H/.ssh"

# Public keys the lab user accepts (mounted read-only from ./keys)
if [ -f /keys/authorized_keys ]; then
  install -m 600 -o "${LAB_USER}" -g "${LAB_USER}" /keys/authorized_keys "$H/.ssh/authorized_keys"
fi

# Optional: trust an SSH certificate authority (e.g. SSH Teams / own CA); added once only
if [ -f /keys/ca.pub ] && ! grep -q '^TrustedUserCAKeys' /etc/ssh/sshd_config; then
  echo "TrustedUserCAKeys /keys/ca.pub" >> /etc/ssh/sshd_config
fi

exec /usr/sbin/sshd -D -e

Now create compose.yml. We’re publishing the SSH ports on loopback so we can independently check what Copilot has done using our own SSH client. The containers themselves communicate over the Docker network. Only the authorised public key file needs to be mounted into the SSH nodes.

name: sshlab

x-ssh: &ssh
  image: ${SSH_LAB_IMAGE:-ssh-lab:alpine-3.24.4}
  build:
    context: .
    args:
      ALPINE_VERSION: ${ALPINE_VERSION:-3.24.4}
      LAB_USER: ${LAB_USER:-lab}
  volumes:
    - ./keys/authorized_keys:/keys/authorized_keys:ro
  restart: unless-stopped
  security_opt:
    - no-new-privileges:true
  cap_drop: [ALL]
  cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETUID, SETGID, SYS_CHROOT, KILL, NET_BIND_SERVICE]
  networks: [lab]

services:
  ssh-1:
    <<: *ssh
    container_name: sshlab-ssh-1
    ports: ["127.0.0.1:${SSH1_PORT:-2222}:22"]

  ssh-2:
    <<: *ssh
    container_name: sshlab-ssh-2
    ports: ["127.0.0.1:${SSH2_PORT:-2223}:22"]

  # extra nodes: enable with COMPOSE_PROFILES=four
  ssh-3:
    <<: *ssh
    container_name: sshlab-ssh-3
    ports: ["127.0.0.1:${SSH3_PORT:-2224}:22"]
    profiles: [four]

  ssh-4:
    <<: *ssh
    container_name: sshlab-ssh-4
    ports: ["127.0.0.1:${SSH4_PORT:-2225}:22"]
    profiles: [four]

networks:
  lab:
    name: ${SSH_LAB_NETWORK:-jadaptive-net}
    external: true

Running Maverick SSH MCP

Create a second file called compose.maverick.yml to add Maverick to the same network.

services:
  maverick:
    image: jadaptive/maverick-ssh-mcp:latest
    container_name: maverick-mcp
    restart: unless-stopped
    environment:
      MCP_TOKEN: ${MCP_TOKEN:?set MCP_TOKEN in .env}
    volumes:
      # 1) Named volume: Maverick's state (OAuth cache, SSH Teams device store). Survives recreate.
      - maverick-data:/root/.sshteam-mcp
      # 2) Bind mount: your Mac file ./keys/lab_key appears inside the container
      #    as /keys/lab_key. ":ro" = read-only, Maverick can read but never change it.
      - ./keys/lab_key:/keys/lab_key:ro
    ports:
      - "127.0.0.1:7693:7693"            # also reachable from your Mac
    networks: [lab]

volumes:
  maverick-data:
    name: maverick-ssh-mcp-data

There are two volumes here. The first preserves Maverick’s state in /root/.sshteam-mcp when the container is recreated. At the moment that means the OAuth cache and the SSH Teams device store. The second makes the private key available to Maverick as /keys/lab_key. Note that this path is relative to the MCP server’s filesystem, not the IDE’s. I’ve used the latest tag for simplicity, but it moves as new builds are published, so once you have a working setup you may prefer to pin the image to a specific tag or digest.

Generate a token using openssl rand -hex 32 and put it into the following .env file.

ALPINE_VERSION=3.24.4
SSH_LAB_IMAGE=ssh-lab:alpine-3.24.4
LAB_USER=lab
SSH_LAB_NETWORK=jadaptive-net

# ssh-lab + Maverick
COMPOSE_FILE=compose.yml:compose.maverick.yml
MCP_TOKEN=<paste-your-64-char-hex-token-here>

#COMPOSE_PROFILES=four          # 4 nodes instead of 2

Keep the key and token out of version control. Add the following entries to both .dockerignore and .gitignore (the former prevents the key being sent into the image build context).

.env
keys/

We can now build the image and start everything up.

podman build -t ssh-lab:alpine-3.24.4 .           # or: docker build -t ssh-lab:alpine-3.24.4 .
docker-compose up -d
sleep 5; docker-compose ps -a                     # everything should stay "Up"
docker-compose logs --tail=10 ssh-1               # expect: Server listening on 0.0.0.0 port 22

If you’re using Podman, building the image separately avoids the dependency on Docker’s buildx plugin. With Docker you can use docker build instead.

Before involving the AI, let’s establish that we can actually connect to both servers.

docker exec maverick-mcp ls -l /keys/lab_key
docker exec maverick-mcp getent hosts sshlab-ssh-1 sshlab-ssh-2
ssh -i keys/lab_key -p 2222 lab@localhost hostname     # node 1
ssh -i keys/lab_key -p 2223 lab@localhost hostname     # node 2

On first connection, verify the host key against the corresponding container before accepting it. Make a note of the hostnames returned. In our test the first server returned 8eb330656c39. We’ll use that in a moment to check that Copilot is connecting to the same server.

One thing that can be a little confusing here is that we have two ways of addressing each server. From our terminal we use localhost and ports 2222 and 2223. From Maverick we use sshlab-ssh-1 and sshlab-ssh-2, both on port 22. If we tell Copilot to connect to localhost, Maverick will attempt to connect to itself.

Connecting GitHub Copilot to Maverick SSH MCP

In Eclipse, click the GitHub Copilot icon, select Edit Preferences and find the MCP configuration under GitHub Copilot. Add the following configuration, substituting the token you generated earlier.

{
  "servers": {
    "maverick-ssh": {
      "url": "http://localhost:7693/mcp",
      "requestInit": {
        "headers": {
          "Authorization": "Bearer <paste-your-64-char-hex-token-here>"
        }
      }
    }
  }
}

The configuration in Eclipse uses servers rather than the mcpServers property you might have seen in other MCP clients. The requestInit property allows us to supply the HTTP Authorization header, so include it as shown. If you leave it out, Maverick will challenge the client to sign in with OAuth, which isn’t the route to take for now. Anyone who has this token and can reach the MCP endpoint can use its tools, so treat it as a credential. The token is static and there is no built-in rotation in this release; to replace it, change .env and recreate the container. Docker secrets are an option if you’d rather not keep it in an environment file. We’re using HTTP on loopback here; a remotely accessible deployment should use TLS and appropriate access controls.

Under Tools, select Agent Mode and enable the maverick-ssh tools. Apply the changes and open Copilot Chat in Agent mode rather than Ask mode.

The Copilot console should report that the connection is running and that it has discovered one resource. That resource is mcp://maverick/handles, which allows the client to inspect the handles currently open on the MCP server.

Let’s give it something to do

The first thing we asked Copilot was whether it had access to the Maverick SSH MCP tools.

Do you have the Maverick SSH MCP tools? List the groups you can use.

Rather than repeat the connection details every time we want to do something, we can give Copilot some context at the beginning of the conversation.

For all SSH work use the maverick-ssh tools. Lab nodes: host sshlab-ssh-1 and sshlab-ssh-2, port 22, username lab, privateKeyPath /keys/lab_key, sshTeamEnabled false. Never ask me for a password. Show raw responses for connections. Close handles when done.

We’re explicitly disabling SSH Teams for this exercise because we’re using conventional public key authentication. Now let’s ask it to connect.

Connect to sshlab-ssh-1 and run: whoami; hostname; uname -sm. Show the raw response.

Copilot has made three calls to the MCP server: ssh_connect, ssh_exec and ssh_close. The result tells us that we’re logged in as lab, running Linux on ARM64, and importantly that the hostname is 8eb330656c39, the same hostname we obtained from our terminal earlier.

There is nothing particularly remarkable about executing those three commands. What’s interesting is that Copilot has understood how to use an SSH API that it hasn’t been specifically programmed to use. It has discovered the tools, established a connection, used the handle returned by the server and closed it when it has finished.

Transferring files with SFTP

Let’s do something a little more involved. We have a complete SFTP API available through MCP, so we don’t need to execute shell commands to manipulate files on the server.

Connect to sshlab-ssh-1. Using SFTP only, create /home/lab/workspace/notes.md with the text “hello from Copilot via SFTP”, then read it back and show the raw responses.

This time there are ten tool calls. Copilot has opened an SSH connection, opened an SFTP session using that connection, opened a file for writing and written the data. It then closes the file, opens it again for reading and finally closes all the handles it has created.

We can check the result ourselves.

ssh -i keys/lab_key -p 2222 lab@localhost cat workspace/notes.md

The output is hello from Copilot via SFTP. There is no trailing newline, which explains the % you may see in a zsh terminal.

Now, given that we have two servers, why not ask it to copy the file between them?

Using SFTP only, copy /home/lab/workspace/notes.md from sshlab-ssh-1 to sshlab-ssh-2 and verify both files match.

Copilot has read the file as base64 from the first server, written it to the second and read it back to compare the content. Again we can verify the result independently.

ssh -i keys/lab_key -p 2222 lab@localhost sha256sum workspace/notes.md
ssh -i keys/lab_key -p 2223 lab@localhost sha256sum workspace/notes.md

Both files returned the same SHA-256 hash in our test.

There is a subtle but important distinction in what we’ve just done. This is not a direct server-to-server transfer. Copilot has orchestrated two SFTP sessions and the file content has passed through the MCP client. For a small text file that’s fine, but I wouldn’t want to use this approach to move a large archive or sensitive data. In that situation I would be looking at having the AI orchestrate a transfer where the data itself does not need to pass through the model.

What else could we do with this?

We’ve been quite prescriptive in our prompts so far because we wanted to see which tools Copilot was using. In practice I’d be more inclined to ask it a question about the environment and let it decide how to obtain the information.

Here are a few things you could try in the lab. These are suggested experiments rather than results from the tests above.

Compare disk usage, available memory and running processes on both of my lab servers.

Review the SSH server configuration on sshlab-ssh-1 and tell me whether there is anything you would change.

Using SFTP, compare the contents of the workspace directories on both servers.

We also have the ability to create tunnels, which opens up some interesting possibilities when we’re dealing with services that aren’t directly accessible from our development machine.

A word of caution here. An agent with SSH access can do whatever the account it authenticates as is permitted to do. The MCP server runs whatever the agent asks it to, within the limits of that account; it is not a substitute for human approval of every command. This is why we’ve created a disposable environment for the article. Don’t simply give an AI access to a privileged production account and assume the MCP protocol will protect you from the consequences.

A note on recreating the lab

If you recreate the SSH containers, their host keys will change. Your local SSH client may quite correctly warn you that the remote host identification has changed. Having established that you really have recreated the lab, you can remove the old entries using:

ssh-keygen -R '[localhost]:2222'
ssh-keygen -R '[localhost]:2223'

Verify the new host keys before accepting them. A host certificate authority is a better solution for environments where servers are routinely recreated.

Maverick, on the other hand, won’t complain. The current release of Maverick SSH MCP uses the Maverick 3.2.0 default, which accepts any host key. When we recreated sshlab-ssh-1, our terminal refused the changed key, but Copilot connected straight away and reported the new hostname, f72ea9913eb4 rather than 8eb330656c39. For a throwaway lab on a private network that is acceptable, but it is worth pinning the image version you tested with, and I wouldn’t point this setup at servers whose network path you can’t trust.

If Copilot cannot see the tools, check Agent mode and the tool selection first. If it cannot connect to Maverick, check the token and container logs. If it can connect to Maverick but not the SSH servers, check the container names, port 22 and the private key path. We also encountered an initial tool discovery timeout during testing which resolved on retry.

Where I think this gets more interesting

There is still something about this configuration that I’d like to change. We have a private key sitting on disk that grants access to both of our SSH servers. Those servers will continue to accept that key until we remove it from their authorised keys files.

If you’ve read my previous article on connecting ChatGPT to a development server, you’ll know that we can use SSH Teams with Maverick SSH MCP instead. Rather than provision long-lived authentication keys for the AI, we can register Maverick as a device and have it obtain short-lived SSH certificates.

We’ve already included the provision for trusting a user certificate authority in our lab’s entrypoint. To use it we’d mount the CA public key at /keys/ca.pub, recreate the nodes and issue certificates with the lab principal. That’s an experiment for another article.

What I find particularly interesting about all this is that we haven’t had to build a GitHub Copilot integration into our SSH API. We’ve exposed the API through MCP and the same tools we used with ChatGPT are now available within Eclipse.

The more capable these AI development environments become, the less reason there is for us to be continually moving between the IDE and a terminal, copying the output of one into the other. We can have a conversation about the application we’re developing and the infrastructure on which it runs in the same place.

That’s something I think is worth exploring further.

Find out more about Maverick SSH MCP or get the Docker image.