A Better Mcp ssh Server
@zhangyc310
About A Better Mcp ssh Server
A Better Mcp ssh Server.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"ssh": {
"command": "/your_path_to_mcpssh/mcpssh",
"args": []
}
}
}Tools
3Initiates a new SSH connection to a specified host using a PTY. Returns a `session_id`.
Sends input to and reads output from an active SSH session. This allows for interactive shell usage (e.g., handling prompts, running scripts).
Terminates an active SSH session and cleans up resources.
Overview
What is A Better Mcp ssh Server?
A Better Mcp ssh Server is a Go-based MCP server that manages SSH sessions for AI agents. It enables an AI to interact with remote servers via SSH by creating persistent sessions, sending commands, and reading outputs through a pseudo-terminal (PTY) interface. It reads hosts from ~/.ssh/config, so users do not need to list every host in the MCP configuration file.
How to use A Better Mcp ssh Server?
Build the binary with go build -o mcpssh (requires Go 1.25.0+ and SSH installed). Then configure your MCP client (e.g., Codex or Gemini) to run the binary as a command server without arguments. After setup, the AI can connect to any host defined in ~/.ssh/config by name using the provided tools.
Key features of A Better Mcp ssh Server
- Supports hosts in
~/.ssh/configautomatically - AI can specify a host via natural language
- Persistent SSH sessions with PTY interface
- Three core tools: start, interact, and close session
- Built with Go for performance and minimal dependencies
Use cases of A Better Mcp ssh Server
- AI agent connects to a remote server and checks disk space
- AI runs a multi-step script that requires interactive prompts
- AI manages multiple persistent SSH sessions to different hosts
- AI retrieves command outputs from remote servers for monitoring
FAQ from A Better Mcp ssh Server
What are the prerequisites for running A Better Mcp ssh Server?
Go 1.25.0 or later must be installed, along with SSH (tested on macOS). A ~/.ssh/config file is required to define host entries.
How does the server discover SSH hosts?
It reads host definitions from ~/.ssh/config. There is no need to add every host to the MCP configuration file; the AI can reference hosts by their config alias.
What tools does A Better Mcp ssh Server provide?
Three tools: start_session (initiates SSH connection and returns a session ID), interact_session (sends input to and reads output from the PTY), and close_session (terminates the session and cleans up resources).
What are the core dependencies of A Better Mcp ssh Server?
The server depends on github.com/mark3labs/mcp-go (MCP SDK), github.com/creack/pty (PTY management), and github.com/google/uuid (session ID generation).
How does session management work?
Each start_session call creates a persistent PTY-based SSH connection and returns a unique session ID. The AI uses interact_session to send commands and read outputs, and close_session to terminate the session.
Frequently asked questions
What are the prerequisites for running A Better Mcp ssh Server?
Go 1.25.0 or later must be installed, along with SSH (tested on macOS). A `~/.ssh/config` file is required to define host entries.
How does the server discover SSH hosts?
It reads host definitions from `~/.ssh/config`. There is no need to add every host to the MCP configuration file; the AI can reference hosts by their config alias.
What tools does A Better Mcp ssh Server provide?
Three tools: `start_session` (initiates SSH connection and returns a session ID), `interact_session` (sends input to and reads output from the PTY), and `close_session` (terminates the session and cleans up resources).
What are the core dependencies of A Better Mcp ssh Server?
The server depends on `github.com/mark3labs/mcp-go` (MCP SDK), `github.com/creack/pty` (PTY management), and `github.com/google/uuid` (session ID generation).
How does session management work?
Each `start_session` call creates a persistent PTY-based SSH connection and returns a unique session ID. The AI uses `interact_session` to send commands and read outputs, and `close_session` to terminate the session.
Basic information
More Developer Tools MCP servers
MCP Inspector
modelcontextprotocolVisual testing tool for MCP servers

BetterBugs
BetterBugsThe BetterBugs MCP (Model Context Protocol) enables you to load BetterBugs bug reports (via report links) directly to your preferred AI Agents and developer environments with MCP Client capabilities (such as Cursor, VS C
TranscriptFetch MCP Server
TranscriptFetchModel Context Protocol (MCP) server for TranscriptFetch: fetch YouTube transcripts, search, channels, and playlists from any MCP client.
Unity MCP (Server + Plugin)
IvanMurzakAI Skills, MCP Tools, and CLI for Unity Engine. Full AI develop and test loop. Use cli for quick setup. Efficient token usage, advanced tools. Any C# method may be turned into a tool by a single line. Works with Claude Code, Gemini, Copilot, Cursor and any other absolutely for fr
Stakpak Agent CLI
stakpakShip your code, on autopilot. An open source agent that lives on your machines 24/7 and keeps your apps running. 🦀
Comments