SSH MCP Server
Click on "Install 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 192.168.1.100"
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 (Node.js)
A secure, high-performance Model Context Protocol (MCP) server that enables AI assistants like Claude Desktop to execute SSH commands on remote servers. Built with Node.js and the official MCP SDK for maximum compatibility and reliability.
๐ Version 2.1.0 - Token-Efficient File Operations: Complete rewrite in Node.js with official MCP SDK - eliminates all previous Go compatibility issues!
โจ Features
๐ Secure SSH: Private key authentication with multiple key format support
๐ค AI-Ready: Official MCP SDK integration for Claude Desktop and other AI tools
โก High Performance: Node.js async architecture for fast command execution
๐ฆ Zero Setup: One-command installation via NPX - no compilation required
๐ Universal: Pure JavaScript runs on Windows, macOS, and Linux
๐ก๏ธ Type Safe: Built with modern JavaScript and comprehensive error handling
๐ Standards Compliant: Uses official @modelcontextprotocol/sdk
Related MCP server: ssh-mcp-server
๐ Quick Start
Installation & Usage
# Use directly with NPX (recommended)
npx @idletoaster/ssh-mcp-server@latest
# Or install globally
npm install -g @idletoaster/ssh-mcp-serverClaude Desktop Configuration
Add to your Claude Desktop MCP configuration file:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["-y", "@idletoaster/ssh-mcp-server@latest"],
"env": {}
}
}
}That's it! Claude can now execute SSH commands on your remote servers.
๐ฌ Usage Examples
Once configured, Claude can help you with commands like:
"Check disk usage on my production server at 192.168.1.100"
"Restart the nginx service on server.example.com as user admin"
"Show running processes on my Ubuntu server using my SSH key"
Manual Tool Usage
{
"tool": "remote-ssh",
"arguments": {
"host": "192.168.1.100",
"user": "ubuntu",
"command": "df -h",
"privateKeyPath": "/home/user/.ssh/id_rsa"
}
}๐ง Configuration
SSH Key Authentication
The server supports multiple authentication methods:
1. Explicit Key Path
{
"privateKeyPath": "/path/to/your/private/key"
}2. Environment Variable
export SSH_PRIVATE_KEY="/home/user/.ssh/id_rsa"3. Auto-Discovery
Automatically searches for keys in:
~/.ssh/id_rsa~/.ssh/id_ed25519~/.ssh/id_ecdsa
Supported Key Formats
โ RSA keys (
id_rsa)โ ED25519 keys (
id_ed25519)โ ECDSA keys (
id_ecdsa)โ OpenSSH format
โ PEM format
๐ ๏ธ Development
Prerequisites
Node.js 18+ (check:
node --version)NPM 9+ (check:
npm --version)
Install Node.js
Windows:
Download from nodejs.org or use Chocolatey:
choco install nodejsLinux (Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejsLinux (CentOS/RHEL):
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
sudo yum install -y nodejsmacOS:
brew install nodeBuild from Source
# Clone repository
git clone https://github.com/idletoaster/ssh-mcp-server.git
cd ssh-mcp-server
# Install dependencies
npm install
# Run locally
npm start
# Development with auto-reload
npm run dev๐๏ธ Architecture
ssh-mcp-server/
โโโ package.json # NPM configuration & dependencies
โโโ index.js # Main MCP server (Official SDK)
โโโ lib/
โ โโโ ssh-client.js # SSH connection management
โโโ README.md # Documentation
โโโ LICENSE # MIT license
โโโ .gitignore # Node.js gitignoreTechnology Stack
Runtime: Node.js 18+ with ES Modules
MCP SDK: @modelcontextprotocol/sdk (Official)
SSH: ssh2 library for Node.js
Distribution: NPM with direct NPX execution
๐ Security
Best Practices
โ Private key authentication only (no passwords)
โ Configurable SSH algorithms and timeouts
โ No persistent connections (session-based)
โ Input validation and sanitization
โ Comprehensive error handling
Security Guidelines
๐ Store private keys with restrictive permissions (
chmod 600)๐ Use SSH key passphrases when possible
๐ก๏ธ Restrict SSH keys to specific hosts in
~/.ssh/config๐ Monitor SSH access logs
๐ซ Never run as root unless absolutely necessary
Network Security
# Example SSH config for restricted access
Host production-server
HostName 192.168.1.100
User deploy
IdentityFile ~/.ssh/production_key
IdentitiesOnly yes
StrictHostKeyChecking yes๐งช Testing
Local Testing
# Test the MCP server
echo '{"host":"test.server.com","user":"testuser","command":"whoami"}' | npm startIntegration Testing
# Verify Node.js installation
node --version # Should be 18+
npm --version # Should be 9+
# Test NPX execution
npx @idletoaster/ssh-mcp-server@latest --help๐ Compatibility
Operating Systems
โ Windows 10/11 (x64, ARM64)
โ macOS 12+ (Intel & Apple Silicon)
โ Linux (x64, ARM64) - All major distributions
AI Platforms
๐ค Claude Desktop (Primary target)
๐ค Cursor IDE
๐ค Any MCP-compatible application
Node.js Compatibility
โ Node.js 18.x (LTS)
โ Node.js 20.x (LTS)
โ Node.js 22.x (Current)
๐ Migration from v1.x (Go)
Upgrading from the Go version? The Node.js version offers:
โ Improvements
Zero compilation - No more binary builds
Better compatibility - Official MCP SDK
Faster development - Direct code changes
Simpler deployment - Pure NPX distribution
No protocol issues - Official Anthropic SDK
๐ Migration Steps
Uninstall old version: Remove Go-based installation
Install new version:
npx @idletoaster/ssh-mcp-server@latestUpdate Claude config: Same configuration works!
Test connection: Verify SSH functionality
๐ค Contributing
Development Workflow
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureMake your changes
Test thoroughly:
npm testSubmit a pull request
Code Style
Use ES6+ modern JavaScript
Follow Node.js best practices
Add JSDoc comments for functions
Validate with existing patterns
๐ License
MIT License - see LICENSE file for details.
๐ Acknowledgments
@modelcontextprotocol/sdk - Official MCP SDK
ssh2 - Node.js SSH client
Claude Desktop - Primary target platform
Model Context Protocol - Standard specification
๐ Support
๐ Issues: GitHub Issues
๐ฌ Discussions: GitHub Discussions
Built with โค๏ธ for the AI development community using Node.js and official MCP SDK
๐ NEW in v2.1.0: Token-Efficient File Operations
Enhanced with 4 powerful tools inspired by Desktop Commander for optimal token usage:
๐ฏ Token-Efficient Tools
ssh-edit-block - Edit specific text blocks (80-90% token reduction vs full rewrites)
ssh-read-lines - Read file sections by line numbers (massive savings for large files)
ssh-search-code - Pattern search without reading full files
ssh-write-chunk - Efficient content writing with append/rewrite modes
๐ก Benefits
80-90% fewer tokens for file operations
No more full file rewrites for small changes
Partial file reading for large codebases
Pattern searching without token overhead
๐ New Tool Usage
// Edit specific text blocks
{
"name": "ssh-edit-block",
"arguments": {
"host": "server.com",
"user": "username",
"filePath": "/path/to/file.js",
"oldText": "version: '2.0.0'",
"newText": "version: '2.1.0'"
}
}
// Read specific lines only
{
"name": "ssh-read-lines",
"arguments": {
"host": "server.com",
"user": "username",
"filePath": "/path/to/large-file.js",
"startLine": 100,
"endLine": 150
}
}
// Search patterns efficiently
{
"name": "ssh-search-code",
"arguments": {
"host": "server.com",
"user": "username",
"path": "/project",
"pattern": "function.*export",
"filePattern": "*.js"
}
}Available Tools
5 toolsremote-sshB
Execute SSH commands on remote servers with private key authentication
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote server hostname or IP address | |
| user | Yes | SSH username | |
| command | Yes | Command to execute on remote server | |
| privateKeyPath | No | Path to SSH private key (optional, falls back to SSH_PRIVATE_KEY env var) | |
| port | No | SSH port (default: 22) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must disclose behavioral traits. It only mentions authentication method but omits details on command execution behavior, such as whether it streams output, typical timeouts, exit code handling, or error responses.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that efficiently conveys the core purpose. However, it may be too brief to cover essential behavioral details, but for conciseness alone it performs well.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given there is no output schema and no annotations, the description fails to specify what the tool returns (e.g., stdout, exit code) or how it handles errors. It also does not mention runtime considerations like timeout or command chaining, leaving the agent underinformed for a potentially sensitive operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% so parameters are well-described in the schema. The description adds only the authentication context; it does not provide additional semantic nuance beyond what the schema already offers, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The tool name 'remote-ssh' and description 'Execute SSH commands on remote servers with private key authentication' clearly state the verb (execute) and resource (SSH commands on remote servers), and they distinguish from siblings like 'ssh-edit-block' which focus on file editing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for executing arbitrary commands versus the siblings that handle specific operations (edit, read, search, write), but it does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention prerequisites or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ssh-edit-blockB
Edit specific text blocks in remote files (token-efficient alternative to full rewrites)
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote server hostname or IP address | |
| user | Yes | SSH username | |
| filePath | Yes | Path to file on remote server | |
| oldText | Yes | Text to find and replace | |
| newText | Yes | Replacement text | |
| expectedReplacements | No | Expected number of replacements (default: 1) | |
| privateKeyPath | No | Path to SSH private key (optional) | |
| port | No | SSH port (default: 22) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description must disclose behavioral traits. It only states 'edit specific text blocks' without detailing whether the operation is destructive, requires permissions, handles missing oldText, or is idempotent. This is insufficient for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that efficiently conveys the core purpose and unique value proposition. While appropriately front-loaded, it could benefit from slight structural expansion for completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description is insufficiently complete. It does not cover prerequisites, error conditions, return behavior, or when to use alternatives. The tool has 8 parameters and potential side effects, yet the description provides minimal context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds no extra meaning beyond the schema; it simply repeats the idea of editing text blocks. No additional context for parameters like expectedReplacements or privateKeyPath is provided.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool edits specific text blocks in remote files, and positions itself as a token-efficient alternative to full rewrites. This effectively distinguishes it from sibling tools like ssh-read-lines, ssh-search-code, and ssh-write-chunk.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for small edits via 'token-efficient alternative to full rewrites', but lacks explicit guidance on when to use this tool versus siblings like ssh-write-chunk for full rewrites or remote-ssh for general commands. No when-not-to-use or alternative conditions are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ssh-read-linesA
Read specific lines from remote files (token-efficient for large files)
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote server hostname or IP address | |
| user | Yes | SSH username | |
| filePath | Yes | Path to file on remote server | |
| startLine | No | Starting line number (1-based) | |
| endLine | No | Ending line number (optional, reads to end if not specified) | |
| maxLines | No | Maximum lines to read (default: 100) | |
| privateKeyPath | No | Path to SSH private key (optional) | |
| port | No | SSH port (default: 22) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must cover behavioral traits. It states the tool reads lines and emphasizes token efficiency, but does not disclose auth requirements, error behavior, or confirm read-only nature. The name implies a safe operation, but more detail is needed for full transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that includes an important trait (token efficiency). It is front-loaded with the core purpose, though it could be slightly more structured with usage hints.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool with 8 parameters and no output schema or annotations, the description provides the basic purpose and a key benefit. However, it lacks details on prerequisites, error conditions, or when to use alternatives, leaving some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds a general note about token efficiency but does not clarify parameter meanings beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Read specific lines from remote files' clearly states the action and resource. The name and description together distinguish it from sibling tools like ssh-edit-block, ssh-write-chunk, etc., which perform different operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description hints at a use case ('token-efficient for large files') but does not explicitly state when to use this tool versus alternatives. It lacks guidance on when not to use it or direct comparisons to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ssh-search-codeA
Search for patterns in remote files without reading full content (token-efficient)
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote server hostname or IP address | |
| user | Yes | SSH username | |
| path | Yes | Directory path to search on remote server | |
| pattern | Yes | Text pattern to search for | |
| filePattern | No | File pattern (e.g., "*.js", "*.py") | |
| ignoreCase | No | Case-insensitive search | |
| maxResults | No | Maximum number of results | |
| contextLines | No | Lines of context around matches | |
| privateKeyPath | No | Path to SSH private key (optional) | |
| port | No | SSH port (default: 22) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden. It mentions token-efficiency but lacks details on read-only behavior, error handling, or security considerations. Adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, to the point, no extraneous information. Excellent conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite 10 parameters and no output schema, the description provides no guidance on result format, limits, or error conditions. Incomplete for a complex tool with many parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the description adds no new parameter-level meaning beyond the overall purpose. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'Search for patterns' and the resource 'remote files', and distinguishes it from siblings by emphasizing 'without reading full content (token-efficient)'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use (token-efficient search) and distinguishes from siblings like ssh-read-lines, but does not explicitly state when not to use or provide alternative tool names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ssh-write-chunkB
Write content to remote files with append/rewrite modes (token-efficient for large content)
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote server hostname or IP address | |
| user | Yes | SSH username | |
| filePath | Yes | Path to file on remote server | |
| content | Yes | Content to write | |
| mode | No | Write mode: "rewrite" or "append" | rewrite |
| privateKeyPath | No | Path to SSH private key (optional) | |
| port | No | SSH port (default: 22) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It notes append/rewrite modes and token efficiency but omits key details like connection handling, overwrite behavior, error semantics, or return value. For a write tool, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence front-loads the verb and resource, then adds mode and efficiency hint. It is efficient but sacrifices depth. No fluff, but missing needed details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 7 parameters and no output schema. The description does not explain return values, error handling, prerequisites (e.g., SSH key setup), or how multiple chunks interact. It is incomplete for a reliable agent invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already describes all parameters. The description adds only a general hint about token efficiency without enriching individual parameter semantics. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Write', the resource 'remote files', and specifies append/rewrite modes, distinguishing it from sibling tools like ssh-edit-block. The mention of token efficiency for large content adds further context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use for writing or updating remote files, especially large content, but does not explicitly compare with siblings like ssh-edit-block or provide when-not-to-use guidance. No prerequisites or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v2.1.8- First observed
remote-ssh - First observed
ssh-edit-block - First observed
ssh-read-lines - First observed
ssh-search-code - First observed
ssh-write-chunk
TDQS
Each tool has a clearly distinct purpose: remote-ssh for general command execution, and the four ssh-* tools for specific file operations (edit block, read lines, search code, write chunk). There is no overlap or ambiguity.
Four tools follow the consistent 'ssh-verb-noun' pattern (e.g., ssh-read-lines), but 'remote-ssh' breaks this pattern. Still, the naming is mostly consistent and predictable.
With 5 tools, the server is well-scoped for its purpose of SSH remote operations. It covers essential file manipulation and command execution without being too sparse or bloated.
The tool set covers command execution and core file operations (read, write, edit, search). However, it lacks file listing, deletion, or transfer capabilities, leaving minor gaps for a complete SSH toolkit.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโฆ
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Connect AI agents to Replynodes over the Model Context Protocol.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceProvides remote filesystem operations, git repository management, and process execution capabilities for AI agents through the Model Context Protocol.-
- AlicenseNot gradedqualityAmaintenanceEnables secure remote command execution and bidirectional file transfers on SSH servers through the Model Context Protocol. It features robust security controls including command whitelisting, credential isolation, and support for multiple SSH connection profiles.1,321830ISC
- AlicenseBqualityDmaintenanceEnables AI assistants to manage SSH connections, execute commands, and transfer files via SFTP over the Model Context Protocol.273MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to execute commands and transfer files on remote servers over SSH connections.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/idletoaster/ssh-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server