SSH MCP Server
Planned integration for personal password manager functionality, allowing secure credential storage and retrieval for SSH connections
Planned integration for secure credential storage and retrieval, enabling enterprise-grade secret management for SSH authentication
Planned integration for personal password manager functionality, allowing secure credential storage and retrieval for SSH connections
Planned integration with HashiCorp Vault for multi-cloud secret management and secure credential storage for SSH operations
Provides remote Linux server management capabilities including command execution, system administration, service management, and system monitoring via SSH
Uses macOS Keychain for secure credential storage with TouchID/password protection for SSH authentication
Enables running Puppet agent in no-op mode for configuration management and infrastructure automation on remote systems
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SSH MCP Servercheck disk usage on server.company.local"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SSH MCP Server
An MCP (Model Context Protocol) server that provides SSH client functionality for remote Linux server management. This server enables AI assistants to execute commands on remote Linux hosts via SSH, solving the limitations of built-in tools when working with remote systems.
Why SSH MCP Server?
Built-in MCP tools are limited to local operations. This server extends AI capabilities to remote Linux systems by providing:
Remote Command Execution: Execute any command on remote Linux hosts
System Administration: Manage services, check system health, monitor processes
Secure Authentication: Multiple secure credential storage options
Enterprise Integration: Works with domain-joined systems and enterprise environments
Related MCP server: TermPipe MCP
Features
SSH Command Execution: Execute arbitrary commands on remote Linux hosts
Sudo Support: Run commands with elevated privileges (secure password handling)
Installation
From PyPI (Recommended)
pip install ssh-mcp-serverFrom Source
git clone https://github.com/rorymcmahon/ssh-mcp-server.git
cd ssh-mcp-server
pip install -e .System Information: Get system stats, processes, disk usage, and services
Secure Credentials: Secure credential storage (currently macOS Keychain, expanding to other providers)
Connection Management: Automatic connection handling with timeouts
Error Handling: Comprehensive error reporting and recovery
Puppet Integration: Run Puppet agent in no-op mode for configuration management
Installation
From PyPI (when published)
pip install ssh-mcp-serverFrom Source
git clone https://github.com/rorymcmahon/ssh-mcp-server.git
cd ssh-mcp-server
pip install -e .Development Installation
git clone https://github.com/rorymcmahon/ssh-mcp-server.git
cd ssh-mcp-server
pip install -e ".[dev]"Configuration
MCP Client Configuration
Add to your MCP client configuration (e.g., Claude Desktop, Q CLI):
{
"mcpServers": {
"ssh": {
"command": "ssh-mcp-server",
"args": []
}
}
}Available Tools
Core SSH Operations
execute_ssh(hostname: str, command: str)
Execute a command on a remote Linux host via SSH.
Parameters:
hostname: Target hostname (e.g., "server.company.local")command: Command to execute
Returns:
{
"status": 0,
"stdout": "total 24\ndrwxr-xr-x 3 user user 4096 ...",
"stderr": ""
}Or on error:
{
"error": "SSH connection or authentication failed"
}execute_sudo(hostname: str, command: str)
Execute a command with sudo privileges. Automatically handles password input securely.
Returns: Same format as execute_ssh
System Information Tools
ssh_get_system_info(hostname: str)
Get basic system information (OS, kernel, memory, root disk usage).
get_running_processes(hostname: str)
Get top 10 CPU-consuming processes.
get_disk_usage(hostname: str)
Get disk usage for all mounted filesystems.
get_services(hostname: str)
Get top 20 running systemd services.
ssh_puppet_noop(hostname: str)
Run Puppet agent in no-op mode (dry run) with verbose output.
Usage Examples
Basic Command Execution
# Execute a simple command
result = execute_ssh("server.company.local", "uptime")
if "error" not in result:
print(result["stdout"]) # System uptime informationSystem Administration
# Check system health
system_info = ssh_get_system_info("server.company.local")
disk_usage = get_disk_usage("server.company.local")
processes = get_running_processes("server.company.local")
# Restart a service with sudo
result = execute_sudo("server.company.local", "systemctl restart nginx")Error Handling
result = execute_ssh("server.company.local", "invalid_command")
if "error" in result:
print(f"Error: {result['error']}")
elif result["status"] != 0:
print(f"Command failed with exit code {result['status']}")
print(f"Error output: {result['stderr']}")Security Considerations
Credential Storage: Uses secure credential storage (Keychain, future: Vault, AWS Secrets Manager)
Network Security: Ensure SSH connections are over secure networks
Access Control: Limit SSH user permissions on target hosts
Audit Logging: Monitor SSH access and command execution
TouchID Protection: macOS Keychain integration requires TouchID/password for access
Password Security: Sudo passwords are passed securely via stdin, not visible in process lists
Development
Running Tests
pytestCode Formatting
black src/ tests/
isort src/ tests/Type Checking
mypy src/Coverage Report
pytest --cov=ssh_mcp_server --cov-report=htmlContributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Add tests for new functionality
Ensure all tests pass (
pytest)Format code (
blackandisort)Commit changes (
git commit -m 'Add amazing feature')Push to branch (
git push origin feature/amazing-feature)Open a Pull Request
Roadmap
SSH key-based authentication
AWS Secrets Manager credential provider
HashiCorp Vault credential provider
Azure Key Vault credential provider
Connection pooling and reuse
File transfer operations (SCP/SFTP)
Interactive shell sessions
Connection health monitoring
Batch command execution
Custom SSH client configuration
Windows support (additional credential providers)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Changelog: CHANGELOG.md
Available Tools
15 toolscache_credentialsD
Legacy compatibility - Pre-cache credentials
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
execute_sshC
Legacy compatibility - Execute command on remote Linux host via SSH
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
execute_sudoC
Legacy compatibility - Execute command with sudo on remote Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
get_disk_usageC
Legacy compatibility - Get disk usage information from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
get_running_processesC
Legacy compatibility - Get running processes from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
get_servicesC
Legacy compatibility - Get systemd services status from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_clear_credentialsB
Clear all cached SSH credentials
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_execute_sshC
Execute command on remote Linux host via SSH
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_execute_sudoC
Execute command with sudo on remote Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_get_disk_usageC
Get disk usage information from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_get_running_processesC
Get running processes from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_get_servicesC
Get systemd services status from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_get_system_infoC
Get basic system information from Linux host
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_puppet_noopA
Run Puppet agent in no-op mode (dry run) with verbose output
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
ssh_setup_credentialsC
Setup credentials for a Linux host using GUI prompts
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
15 tool updates
v0.2.0- First observed
cache_credentials - First observed
execute_ssh - First observed
execute_sudo - First observed
get_disk_usage - First observed
get_running_processes - First observed
get_services - First observed
ssh_clear_credentials - First observed
ssh_execute_ssh - First observed
ssh_execute_sudo - First observed
ssh_get_disk_usage - First observed
ssh_get_running_processes - First observed
ssh_get_services - First observed
ssh_get_system_info - First observed
ssh_puppet_noop - First observed
ssh_setup_credentials
TDQS
Scored across 15 tools
Five of fifteen tools are explicit 'Legacy compatibility' duplicates of newer tools with near-identical descriptions (get_running_processes vs ssh_get_running_processes, execute_ssh vs ssh_execute_ssh, execute_sudo vs ssh_execute_sudo, cache_credentials vs ssh_setup_credentials). An agent must guess whether the legacy or ssh_-prefixed variant is the intended entry point, and the descriptions offer no behavioral difference to disambiguate.
All names are snake_case, but two competing prefix schemes coexist (bare verb_noun vs ssh_-prefixed), and verb ordering flips between pairs like execute_ssh and ssh_execute_ssh. The result is a set where the same action is spelled two different ways, which undermines predictability.
Fifteen tools is within a reasonable range for an SSH/remote-admin server, and the functional surface (execute, sudo, credentials, system info, processes, disk, services, puppet) is sensibly scoped. However, roughly a third of the count is pure legacy duplication, so the effective tool set is ~10 padded out with redundant entries.
Core remote-admin workflows are covered: command execution, privileged execution, credential lifecycle (setup/clear/cache), system info, processes, disk, services, and Puppet dry-run. Gaps exist around file transfer/scp and host inventory listing, but agents can work around these via the execute tools.
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Image and video AI tools and your own pipelines, run from any AI assistant.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely perform actions on your computer including file system management, command execution, clipboard access, application launching, and local search with license-based monetization built in.-
- AlicenseNot gradedqualityCmaintenanceProvides AI assistants with direct terminal access to execute commands, manage files, and run persistent REPL sessions. It features automated installation scripts that educate AI assistants on its capabilities for seamless integration.MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to control mobile and desktop devices with natural language, including running automation tasks, taking screenshots, and managing devices.65 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control Windows systems through natural language commands, providing 200+ automation tools for system control, file operations, web automation, and more.61MIT