πŸ›°οΈ Safe & Token-Efficient SSH for AI Coding Agents

agentic_ssh

Connect Claude, Cursor, Gemini, and Antigravity to your servers without token avalanches, silent disconnects, or quoting nightmares.

brew install sandbanks/tap/agentic_ssh && agentic_ssh install⚑️ 1-step
AI Agent Multi-Host Interrogation & Security Guardrail
AI Agent Multi-Host Interrogation and Guardrail Demo

πŸ“Š Token & Quota Impact

Raw terminal SSH drains your model's context window and budget. See how agentic_ssh preserves memory and infrastructure.

Metric / ScenarioRaw SSH in PromptWith agentic_ssh MCPThe Difference
Context Consumption15,000+ tokens (raw stdout dump)185 tokens (structured JSON)98.8% token savings πŸ“‰
API Cost per Query~$0.05 – $0.15~$0.0004Fraction of a cent πŸ’°
Security & Blast RadiusUnrestricted ~/.ssh/config accessStrict allow_hosts whitelistUnauthorized hosts blocked πŸ›‘οΈ
Connection Latency800ms – 1.5s handshake reconnect0ms (pooled keepalive socket)Instant execution ⚑️
Long-Running BuildsBlocks agent / silent timeoutDetached async (background: true)Non-blocking parallel flow πŸš€

Why AI Agents Struggle with Raw SSH

Standard terminal tools weren't built for Large Language Models. Here's why agents fail over plain SSHβ€”and how agentic_ssh solves it:

πŸ’₯

The Context Avalanche

When an agent runs a build or package upgrade, 10,000 lines of GCC/Cargo compiler noise dump straight into your LLM context window.agentic_ssh auto-summarizes output and redirects full streams to clean session logs.

πŸ‘»

Silent Death by Dropout

Tailscale, firewalls, and cloud NATs love to silently drop idle sockets during long compiles.agentic_ssh uses Rust-native keepalives and automatic connection pooling that never sleeps.

πŸ˜΅β€πŸ’«

Nested Escaping Hell

Asking an LLM to quote bash inside SSH inside an MCP tool string leads to constant syntax errors.agentic_ssh handles arguments and command joining natively behind the scenes.

πŸ›‘οΈ

Safe-by-Default Whitelists

A hallucinating agent shouldn't touch your production database.agentic_ssh enforces strict host boundaries (allow_hosts) and cryptographic local config signatures.

πŸ€– Copy & Paste Agent Prompt Recipes

Drop these directly into Claude Code, Cursor, Gemini, or Antigravity to see agentic_ssh in action:

πŸ“ŠCluster Health Audit

"Check the CPU load, RAM usage, and available disk space across stan, cartman, and aruba. Report any bottlenecks."

πŸ›‘οΈPort & Service Security Scan

"Inspect all listening TCP and UDP ports on cartman. Flag any processes bound to 0.0.0.0 that should be private."

🐳Docker Health & Log Tailing

"Check if any Docker containers crashed on stan, and tail the last 40 lines of the web container logs."

⏳Async Background Deployment

"Run the database backup on aruba in the background and notify me when the session log indicates success."

πŸ–₯️ Built-in CLI Tools for Humans

agentic_ssh is also a full-featured terminal CLI for developers.

πŸ’‘ Keystroke Tip: Add alias ash="agentic_ssh" to your ~/.zshrc or ~/.bashrc!
agentic_ssh watch (Multi-Host Live Streaming TUI)
agentic_ssh watch TUI demo
agentic_ssh watch

Multi-host streaming TUI grid across multiple servers.

agentic_ssh watch fleet 'uptime'
agentic_ssh json

Direct JSON queries from terminal for shell scripting.

agentic_ssh json list_ports stan
agentic_ssh doctor

Instant diagnostic scan of keys and agent configs.

agentic_ssh doctor

⚑️ Installation & Setup

Step 1

Install Binary

Install via Homebrew, Cargo, or Nix:

brew install sandbanks/tap/agentic_ssh
Step 2

Auto-Register MCP

Auto-configures your installed AI agents:

agentic_ssh install
Step 3

Run Doctor

Verify SSH keys and agent connections:

agentic_ssh doctor

🧰 Built-in MCP Tools Catalog

Tool NameDescriptionKey Arguments
list_hostsLists all discovered and permitted SSH hosts from ~/.ssh/config.none
run_commandExecutes shell commands across hosts concurrently (supports async background mode).hosts, command, background
get_system_statsRetrieves CPU load, RAM usage, and disk partition stats.hosts
list_portsScans listening TCP/UDP ports with PID & binary attribution.hosts, protocol
check_docker_statusInspects Docker daemon health and container runtime metrics.hosts
tail_container_logsTails recent frames from target Docker container logs.hosts, container, lines
search_processesSearches and evaluates active processes via regex.hosts, pattern

Ready to give your AI agent SSH superpowers?

Install with one command and start exploring your fleet safely.