How to Configure Amazon Q SSH MCP Server
You set up an amazon q ssh mcp server by registering the tool in your agent settings. Next, you point that local tool to your remote host keys and target machine list. Engineering teams often use this setup so their coding assistant can check remote logs or services. Still, giving an AI tool direct shell keys creates major risks when permissions are too broad. A single bad prompt can lead the agent to alter files or stop live services. How an amazon q ssh mcp server works Amazon Q uses the Mo
SSH Bastion Hosts / Jump Servers + Kubernetes API Server Access: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up an amazon q ssh mcp server by registering the tool in your agent settings. Next, you point that local tool to your remote host keys and target machine list. Engineering teams often use this setup so their coding assistant can check remote logs or services. Still, giving an AI tool direct shell keys creates major risks when permissions are too broad. A single bad prompt can lead the agent to alter files or stop live services.
How an amazon q ssh mcp server works
Amazon Q uses the Model Context Protocol to talk to external tools on your workstation. When you add an SSH server tool, the agent starts that process in the background. The agent reads your prompt and decides when it needs to run a remote command. It sends a structured request over standard input to the local MCP server process. That local process then opens a remote shell session using the SSH keys on your machine.
To log in, the tool relies on standard OpenSSH keys or signed user certificates. OpenSSH added certificate support for users and hosts in version 5.4. A certificate holds a public key, identity info, principal names, and signed options from a CA. This format is much simpler than the X.509 format used in TLS. Once the remote host checks the key or certificate, it opens a shell for the tool. The local MCP server runs the requested command and sends the text output back to the agent.
Preparing keys and host roles for the agent
Most teams start by creating a dedicated key pair just for their local AI assistant. If your team uses an OpenSSH CA, you sign the public key to make a user certificate. The signing step sets a key identity and lists the allowed user or host principals. You should also set a short time limit when signing the certificate. If you do not set a window, the certificate stays valid forever by default.
Next, you place the public key or CA rule on the target Linux host. You should link the agent key to a restricted Linux user account with limited read rights. Many engineers skip this step and let the MCP server use their personal SSH agent. When the tool shares your personal key, it gets every permission you hold on that box. If your account can run root commands, the AI agent can run root commands too.
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.
What native SSH setup solves and what it misses
Native OpenSSH keys and certificates do a great job of verifying who can log in. They prove that a connection comes from an approved workstation or a signed key identity. You can also add certificate options to limit port forwarding or force a specific start command. For basic tasks, a fixed command rule on the host can lock down a key well.
Still, AI coding agents need flexible shell use to inspect logs, check disk space, and read configs. Once the host allows a general shell session, native SSH stops checking what happens next. The host setup decides who logs in, not what individual commands do in flight. If an agent reads a log file with customer emails or phone numbers, the raw text returns to the model. If the agent hallucinates a destructive delete command, the Linux shell runs it right away. You also lack a clean, central log that links each shell command back to the user prompt.
Check SSH commands and file transfers on the host
OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails on the host. It checks callers with OpenSSH certificates and works with ssh, sftp, scp, and rsync clients.
When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs. Then hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.
Frequently asked questions
How does Amazon Q run commands on a remote Linux host?
The agent sends a tool request to your local MCP server process. That local server opens an SSH session using your local keys and runs the shell command.
Should the MCP server use my personal SSH key?
No, using your personal key gives the AI agent all of your admin rights. Always create a separate key linked to a restricted Linux user with read-only permissions.
Can OpenSSH certificates stop an agent from reading sensitive data?
No, OpenSSH certificates only control who can log in and start a session. They do not inspect command output or mask sensitive fields like card numbers or national IDs.
Related guides
In this post