ssh MCP sunucusu
Commit 9 Kas 2026Model Context Protocol aracılığıyla yapay zeka ajanlarına kalıcı SSH oturumları, sanal terminal emülasyonu ve SFTP dosya transferi sağlar.
Ayrıca bilinen adı taigrr/ssh-mcp
- Yıldızlar
- 13
- Araçlar
- 15
- İndirmeler, 30 gün
- —
- En son sürüm
- —
- Son commit
- 9 Kas 2026
- Lisans
- 0BSD
ssh MCP nedir?
ssh bir MCP sunucusudur. Model Context Protocol aracılığıyla yapay zeka ajanlarına kalıcı SSH oturumları, sanal terminal emülasyonu ve SFTP dosya transferi sağlar. 15 araç sunar; örneğin ssh_connect, ssh_exec, ssh_send_command.
Özet, projenin README dosyasından oluşturuldu
ssh MCP sunucusu hakkında
ssh-mcp, uzak sunucuları yönetmeyi ve altyapı hatalarını ayıklamayı bir yapay zeka kodlama ajanı içerisinden yapmanıza olanak tanır. Bu sunucu, yapay zeka ajanlarına belirli bir uzak ana bilgisayar kümesine doğrudan erişim sağlayarak komut çalıştırmalarına, dosyaları yönetmelerine ve terminal kullanıcı arayüzleriyle etkileşime girmelerine imkan verir. Mevcut ~/.ssh/config dosyanızdaki bağlantı ayrıntılarını çözümleyerek ve ssh-agent veya gpg-agent üzerinden kimlik doğrulaması yaparak çalışır; böylece yerleşik güvenlik iş akışlarınızı kullanmanızı sağlar.
Yazılımcılar bu aracı, yerel kodlama ile uzak yürütme arasındaki boşluğu kapatmak için kullanırlar. ANSI işleme süreçlerini yönetmek için PTY emülasyonuna sahip sanal bir terminal sunar; bu sayede bir ajanın, bir insanın terminalde tam olarak göreceği şeyi görmesi mümkün hale gelir. Sunucu, özyinelemeli dizin yükleme ve indirme dahil olmak üzere SFTP üzerinden çift yönlü dosya transferini destekler. Güvenliği korumak adına yalnızca izin verilenler listesi (allowlist) üzerinden çalışır; bu nedenle izin verilen ana bilgisayarları --allowed-hosts bayrağı veya bir config.json dosyası aracılığıyla açıkça tanımlamanız gerekir.
Neler yapabilirsiniz
- 1Uzak sunucu hata ayıklamaBir yapay zeka ajanı, logları veya sistem durumunu incelemek için kalıcı bir kabuk (shell) kullanarak bir staging sunucusuna bağlanabilir.
- 2Otomatik dosya yönetimiBir ajana, SFTP kullanarak yapılandırma dosyalarını taşımasını veya uzak bir makineye kod dağıtmasını (deploy) söyleyebilirsiniz.
Projenin README dosyasından alınmıştır. Her kullanım durumu, oradaki bir alıntı ile kontrol edilir.
ssh MCP araçları 15
README dosyasından algılandıssh_connectssh_execssh_send_commandssh_send_keysssh_get_screenssh_clear_screenssh_resizessh_read_filessh_write_filessh_edit_filessh_uploadssh_download
| ssh_connect | — | |
| ssh_exec | — | |
| ssh_send_command | — | |
| ssh_send_keys | — | |
| ssh_get_screen | — | |
| ssh_clear_screen | — | |
| ssh_resize | — | |
| ssh_read_file | — | |
| ssh_write_file | — | |
| ssh_edit_file | — | |
| ssh_upload | — | |
| ssh_download | — |
15 aracın tümünü gösterDaha az araç göster
ssh_list_sessionsssh_list_hostsssh_close_session
| ssh_list_sessions | — | |
| ssh_list_hosts | — | |
| ssh_close_session | — |
Yapılandırma
SSH_AUTH_SOCK
| Ad | Açıklama | Sunucu |
|---|---|---|
| SSH_AUTH_SOCK | — |
Otomatik kontroller
Çalıştırıldı 13 Kas 2026Tam rapor →Henüz doğrulanmadı. Bir sunucunun 80 puana, ciddi bir bulgu olmamasına ve kontrol edebilmemiz için yeterli veriye ihtiyacı vardır. Kontroller nasıl çalışır · Daha fazla puan için nelerin düzeltileceği
- Kaynak deposu bağlantılı ve erişilebilirtaigrr/ssh-mcp is public and reachablegithub.com/taigrr/ssh-mcp ↗Geçti
- Paket, bu depoyu kaynağı olarak gösteriyorKontrol edilmedi
- Derleme kökeni (Sigstore onayı)Kontrol edilmedi
- Açık kaynak lisansı (OSI)0BSDspdx.org/licenses/0BSD.html ↗Geçti
- Son bir yıl içinde commit veya sürüm mevcutLast commit or release 2026-11-09github.com/taigrr/ssh-mcp ↗Geçti
- OpenSSF ScorecardKontrol edilmedi
- Paket adı popüler bir pakete yakın değilKontrol edilmedi
- Pakette veya bağımlılıklarında kritik uyarı yokKontrol edilmedi
- Modele yönelik gizli talimat yok15 tool descriptions and the README read; no override phrases, credential paths or hidden charactersGeçti
- Yıkıcı araçlar etiketlenmişNo tool named like delete, drop or execGeçti
- Uzak uç nokta MCP el sıkışmasına yanıt veriyorKontrol edilmedi
ssh-mcp
MCP server providing persistent SSH sessions for AI coding agents via the Model Context Protocol.
The Problem
AI coding agents can't interact with remote machines. You need to manually SSH in, run commands, and paste output back. For fleet management, server debugging, or remote development, this kills the feedback loop.
The Solution
ssh-mcp gives your AI agent direct SSH access to an allowed set of hosts. It resolves connections from ~/.ssh/config, authenticates via ssh-agent/gpg-agent, and exposes a virtual terminal so the agent sees exactly what you'd see.
# Start with allowed hosts
ssh-mcp --allowed-hosts="web1,db1,staging"
Features
- SSH config integration — Resolves hosts from
~/.ssh/config(HostName, Port, User, IdentityFile) - Agent forwarding — Authenticates via
ssh-agentorgpg-agent(SSH_AUTH_SOCK) - Virtual terminal — Full PTY emulation with ANSI rendering via charmbracelet/x/vt
- File transfer — Bidirectional file and directory transfers via SFTP (recursive)
- Allowlist-only access — Only explicitly permitted hosts can be connected to
- Session management — Multiple concurrent sessions with independent state
- Zero config — Works out of the box if your
~/.ssh/configis set up
Installation
go install github.com/taigrr/ssh-mcp@latest
Requirements
- Go >= 1.26.5 (for installation)
~/.ssh/configentries for your hosts- One of:
ssh-agentorgpg-agentrunning (recommended)- SSH private key at
~/.ssh/id_ed25519or~/.ssh/id_rsa
Quick Start
- Ensure your hosts are in
~/.ssh/config:
Host my-desktop
HostName 10.0.1.50
User tai
- Run with allowed hosts:
ssh-mcp --allowed-hosts="my-desktop"
- Or use a config file (
config.jsonin working directory):
{
"hosts": ["my-desktop", "web1", "db1"]
}
🔌 MCP Tools
| Tool | Description |
|---|---|
ssh_connect |
Connect to an allowed host by alias (optional width, height) |
ssh_exec |
Run a command and block until it finishes or times out |
ssh_send_command |
Send a command (non-blocking); for TUIs / fire-and-forget |
ssh_send_keys |
Send raw bytes with no newline (Ctrl-C, Esc, arrows, TUI keys) |
ssh_get_screen |
Get the current terminal screen content |
ssh_clear_screen |
Reset the local emulator screen + scrollback |
ssh_resize |
Resize a session's terminal (sends SIGWINCH to the remote shell) |
ssh_read_file |
Read a remote file over SFTP (clean bytes, no shell) |
ssh_write_file |
Write a remote file over SFTP (no quoting pitfalls) |
ssh_edit_file |
Exact find-and-replace edit of a remote file (read it first) |
ssh_upload |
Upload a local file or directory via SFTP |
ssh_download |
Download a remote file or directory via SFTP |
ssh_list_sessions |
List all sessions with active state and size |
ssh_list_hosts |
List allowed hosts with resolved connection details |
ssh_close_session |
Close a session |
Choosing between ssh_exec and ssh_send_command
Both run in the same persistent shell (cwd and environment carry over), but they have opposite blocking semantics:
ssh_execis what you want for almost everything that should finish: builds,git, installs, queries, scripts. It wraps the command with internal sentinels, blocks until it completes ortimeout_mselapses, and returns clean output (ANSI/prompt stripped) plus the exit code. On timeout the command is not killed — it keeps running, and you get a screen snapshot so you can see what it is stuck on, then poll (ssh_get_screen), interrupt (ssh_send_keysCtrl-C), or wait longer.ssh_send_commandis non-blocking and exists for interactive TUIs (vim, less, htop, tmux, REPLs) and fire-and-forget launches. It returns the screen after a short settle delay regardless of completion.
The emulator backing every session is a real virtual terminal, so even when an
ssh_exec command times out or a TUI is open, the session stays responsive and
its state is always inspectable via ssh_get_screen — nothing can hang the
server.
ssh_exec's timeout_ms defaults to 60s (matching Crush's bash tool, which
auto-backgrounds a synchronous command after 60s) and is capped at 10m. A
timeout is not an error: the tool returns a normal result noting the command
is still running, plus the current screen, so the model just keeps going with
ssh_get_screen / ssh_send_keys.
One shell per session: concurrency
Each session is a single interactive shell with one stdin and one stdout. The server keeps that consistent under concurrent tool calls:
- Byte level — all writes to the shell go through one serialized path, so bytes from different calls never interleave mid-sequence. Output is captured by a concurrency-safe terminal emulator.
- Two
ssh_execat once (same session) — rejected. Only onessh_execmay be waiting in a session's shell at a time; the loser gets an "already executing" error. This prevents two wrapped commands from racing into the same shell and scrambling each other's captured output. ssh_send_commandduring anssh_exec— rejected for the same reason (it would inject a second command line mid-exec).ssh_send_keysduring anssh_exec— allowed on purpose. This is how you send Ctrl-C to interrupt a command that timed out and is still running.- Different sessions — fully independent; run them in parallel freely.
If you fire several commands at the same session simultaneously, expect all but one to come back with an "already executing" error rather than corrupting the shell. Sequence them, or use separate sessions.
Terminal size
Sessions default to a 200x50 virtual terminal, large enough for typical
ls, tail, ps, log, and progress-bar output without triggering line wraps
that pollute scrollback. Clients can override the initial size via width /
height on ssh_connect, or resize a live session with ssh_resize. Values
are clamped to [20, 500] columns x [5, 200] rows.
Session lifecycle
ssh_list_sessions returns every session the server knows about along with
its current state ([active] or [inactive]) and current terminal size.
Background goroutines watch each session's stdout and keepalive channel; when
they detect that the remote end has gone away (EOF, keepalive timeout) the
session is automatically marked inactive and removed from the manager, so
a follow-up ssh_list_sessions won't keep advertising a dead entry. Only
sessions reported as [active] accept ssh_send_command / ssh_get_screen
/ ssh_resize; attempts on inactive entries return ErrSessionInactive.
ssh_send_command is non-blocking
ssh_send_command writes the command + newline to the remote shell's stdin,
waits a short settle delay (~3.5s) for the terminal to redraw, then returns
the screen as-is. It does not wait for the command to finish. This is
intentional: it keeps TUIs (vim, htop, tmux, less) interactive across calls.
Practical consequences for clients (especially LLM agents):
- A long-running command (
sleep 60,make, training jobs, package installs) keeps running on the remote host after the call returns. - To wait for completion, sleep on your side (your own timer / bash tool
outside this MCP), then call
ssh_get_screento read fresh output. Do not prefixsleep N;to the SSH command expecting it to block here. - Sending a second command before the first finishes queues bytes in the
remote shell's stdin and produces garbled, interleaved output. Poll with
ssh_get_screenuntil you see the prompt first. - For output you'd rather not stream through the screen, redirect to a file
(
cmd > /tmp/out 2>&1 &) and read it back withcat.
⚙️ Crush Configuration
Add to your project's crush.json or .crush.json:
{
"mcp": {
"ssh": {
"command": "ssh-mcp",
"args": ["--allowed-hosts=my-desktop,staging"],
"type": "stdio"
}
}
}
🤖 Claude Configuration
Claude Code
Register the server with the Claude Code CLI (writes to your MCP config):
claude mcp add ssh -- ssh-mcp --allowed-hosts=my-desktop,staging
Or add it manually to ~/.claude.json (global) or .mcp.json (project):
{
"mcpServers": {
"ssh": {
"command": "ssh-mcp",
"args": ["--allowed-hosts=my-desktop,staging"],
"type": "stdio"
}
}
}
Claude Desktop
Add to your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ssh": {
"command": "ssh-mcp",
"args": ["--allowed-hosts=my-desktop,staging"]
}
}
}
If ssh-mcp is not on your PATH, use the absolute path (e.g. the output of which ssh-mcp, typically ~/go/bin/ssh-mcp) as the command. Because the server authenticates via ssh-agent, ensure SSH_AUTH_SOCK is available to the Claude process; you can pass it explicitly:
{
"mcpServers": {
"ssh": {
"command": "/Users/you/go/bin/ssh-mcp",
"args": ["--allowed-hosts=my-desktop,staging"],
"env": {
"SSH_AUTH_SOCK": "/path/to/ssh-agent.sock"
}
}
}
}
Restart Claude Desktop after editing the config.
Flags
| Flag | Description |
|---|---|
--allowed-hosts |
Comma-separated list of allowed SSH host aliases |
If --allowed-hosts is not provided, falls back to config.json in the working directory.
How It Works
- Resolve — Looks up host alias in
~/.ssh/configfor connection details - Authenticate — Tries ssh-agent → key file → password (in order)
- Connect — Opens a PTY session with
xterm-256colorterminal - Emulate — Captures output in a virtual terminal emulator
- Expose — Returns rendered screen content (with ANSI) to the MCP client
Architecture
┌──────────────────────────────────────────────────┐
│ ssh-mcp │
│ │
│ ~/.ssh/config ──► Host Resolution │
│ │
│ SSH_AUTH_SOCK ──► Authentication │
│ │
│ Sessions: │
│ ├─ tai@10.0.1.50:22 (PTY + VT) │
│ ├─ admin@web1.example.com:22 (PTY + VT) │
│ └─ ... │
│ │
│ MCP Tools ◄──► stdio transport ◄──► AI Agent │
└──────────────────────────────────────────────────┘
Development
# Build
go build -o ssh-mcp .
# Test
go test ./...
# Lint
staticcheck ./...
Related Projects
- Crush — Charm's AI coding agent
- charmbracelet/x/vt — Virtual terminal emulator
- neocrush — LSP/MCP bridge for Crush + Neovim
License
ssh MCP soruları
ssh MCP hangi araçları sunar?
15 araç sunar; bunlar arasında ssh_connect, ssh_exec, ssh_send_command, ssh_send_keys, ssh_get_screen yer alır.
Sunucu uzak ana bilgisayarlara nasıl kimlik doğrular?
ssh-agent, gpg-agent veya ~/.ssh/id_ed25519 ya da ~/.ssh/id_rsa konumundaki bir SSH özel anahtarı aracılığıyla kimlik doğrulaması yapar.
Bu sunucuyu kullanarak dosya transferi yapabilir miyim?
Evet, sunucu, özyinelemeli (recursive) transferler dahil olmak üzere SFTP kullanarak çift yönlü dosya ve dizin transferini destekler.
ssh_exec ile ssh_send_command arasındaki fark nedir?
ssh_exec, bitmesi gereken komutlar (build işlemleri veya git gibi) için kullanılan bloklayan bir araçtır; ssh_send_command ise bloklamayan ve vim veya htop gibi etkileşimli TUI'lar için tasarlanmış bir araçtır.