How to Configure Goose SSH MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a goose ssh mcp server by registering an SSH tool extension in the agent profile. You then point that extension to your remote host details and local OpenSSH keys. Most teams start by giving the local agent a standard private key for remote servers. This quick setup works at first, but broad host permissions create big risks when an AI agent runs shell commands on its own. How a goose ssh mcp server works Goose is a local AI agent that uses the Model Context Protocol to talk to ext

SSH Bastion Hosts / Jump Servers + Kubernetes API Server Access: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up a goose ssh mcp server by registering an SSH tool extension in the agent profile. You then point that extension to your remote host details and local OpenSSH keys. Most teams start by giving the local agent a standard private key for remote servers. This quick setup works at first, but broad host permissions create big risks when an AI agent runs shell commands on its own.

How a goose ssh mcp server works

Goose is a local AI agent that uses the Model Context Protocol to talk to external tools. When you add an SSH server extension, the agent can open shell sessions on remote Linux hosts. The agent reads your prompt, picks a shell command, and sends it to the MCP server process.

The MCP server process then uses the local OpenSSH client to log in to the remote host. Instead of static keys, teams can use OpenSSH certificates added in OpenSSH 5.4. A Certification Authority key signs a user public key to make a certificate. This certificate holds a public key, identity info, principal names, and a set of options. It uses a much simpler format than X.509 certificates.

When the agent needs to run a task, the SSH client presents this signed certificate or key to the remote host. If the host trusts the Certification Authority key, it lets the agent log in as the matching principal user. The MCP server then runs the shell command and sends the text output back to the local agent.

What native SSH keys solve and what they miss

Using OpenSSH certificates or keys solves the basic login problem for your agent setup. You can set a key identity and list one or more user principals during signing. You can also set a validity window so the user certificate expires after a short time. This stops old keys from working forever if someone copies them from a laptop.

Still, host login checks only decide who can open a session on the server. Once the goose ssh mcp server logs in, the remote shell runs whatever the UNIX user role allows. Native login setup does not check what each command does in flight.

SSH Bastion Hosts / Jump Servers + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

An AI agent might misread a prompt and run a bad command that deletes files or stops a service. It might also read files that hold user emails, phone numbers, card numbers, or national IDs. When the remote shell prints that text, the output flows right back into the agent context window. Standard SSH login rules cannot rewrite matched fields in results or pause a risky command for human approval.

Locking down remote shell commands for AI agents

To keep remote hosts safe, teams need controls that work inside the active session. Start by giving the agent a locked-down UNIX user role on the remote machine. Do not give the agent root permissions or broad sudo rules.

Next, separate read tasks from write tasks in your daily workflows. Checking disk space or reading app logs is safe for an agent to do alone. Restarting services or changing host files should require a human to check the command first. You also need a clear log of every command the agent sends and what the host returns.

Inspect one-shot SSH commands and file tasks

SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an open-source SSH listener on the host where people and agents keep their normal ssh, sftp, and scp tools.

First, hoop.dev guardrails check one-shot commands and file paths before they run. Next, hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.

Frequently asked questions

How does Goose run commands over SSH?

Goose sends a tool request to the local SSH MCP server process. That process opens an OpenSSH session to the remote host, runs the shell command, and returns the text output.

Are OpenSSH certificates better than static keys for AI agents?

Yes, OpenSSH certificates let you sign a public key with a Certification Authority key and set an expiration window. Static keys stay valid until you remove them from the remote host by hand.

Can SSH login rules stop an AI agent from reading sensitive files?

SSH login rules only control who can log in to the host. Once logged in, the agent can read any file the UNIX user role allows, including files with emails or card numbers.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.