Skip to main content
Glama
SSH-PowerShell MCP Server

SSH-PowerShell MCP Server

by GUEPARD98

SSH-PowerShell MCP Server

πŸš€ Enterprise-grade Model Context Protocol (MCP) server for secure SSH and PowerShell command execution with Claude Desktop.

License: MIT Node.js Version MCP SDK

✨ Features

  • οΏ½ Secure SSH command execution on remote servers

  • ⚑ Local PowerShell integration for Windows automation

  • πŸ›‘οΈ Enterprise security with SSH key authentication

  • 🌐 Network scanning and SSH port discovery

  • πŸ” SSH key verification and host key scanning

  • πŸ“Š Comprehensive logging and error handling

  • 🎯 Claude Desktop optimized for seamless AI integration

Related MCP server: SSH Read-Only MCP Server

οΏ½πŸš€ Quick Start

# Clone repository
git clone https://github.com/GUEPARD98/MCP-POWERSHELL.git
cd MCP-POWERSHELL

# Install dependencies
npm install

# Configure environment
Copy-Item config\.env.example config\.env
# Edit config\.env with your SSH settings

# Start server
npm start

πŸ“ Project Structure

MCP-POWERSHELL/
β”œβ”€β”€ πŸ“ config/           # Environment configurations
β”‚   β”œβ”€β”€ .env.example     # Configuration template
β”‚   β”œβ”€β”€ .env.development # Development settings
β”‚   β”œβ”€β”€ .env.production  # Production settings
β”‚   └── .env.test       # Test settings
β”œβ”€β”€ πŸ“ docs/            # Complete documentation
β”‚   β”œβ”€β”€ README.md       # Detailed guide
β”‚   β”œβ”€β”€ API.md          # API reference
β”‚   β”œβ”€β”€ ARCHITECTURE.md # Technical architecture
β”‚   └── SECURITY.md     # Security best practices
β”œβ”€β”€ πŸ“ scripts/         # PowerShell automation scripts
β”‚   β”œβ”€β”€ start.ps1       # Start server
β”‚   β”œβ”€β”€ stop.ps1        # Stop server
β”‚   β”œβ”€β”€ setup.ps1       # Initial setup
β”‚   └── test.ps1        # Run tests
β”œβ”€β”€ πŸ“ src/             # Source code
β”‚   └── index.js        # Main MCP server
└── πŸ“ tests/           # Automated tests

πŸ› οΈ Available Commands

Command

Description

npm start

Start MCP server

npm test

Run test suite

npm run dev

Development mode with PowerShell scripts

npm run setup

Initial configuration

⚑ MCP Tools

πŸ” ssh_execute

Execute commands on remote SSH servers

// Example: Run 'ls -la' on remote server
{
  "name": "ssh_execute",
  "arguments": {
    "command": "ls -la",
    "host": "192.168.1.100", 
    "user": "root"
  }
}

πŸ’» powershell_execute

Execute PowerShell commands locally

// Example: Get Windows processes
{
  "name": "powershell_execute",
  "arguments": {
    "command": "Get-Process | Select-Object -First 10"
  }
}

🌐 ssh_scan

Scan network for SSH services

// Example: Scan local network
{
  "name": "ssh_scan", 
  "arguments": {
    "target": "192.168.1.0/24"
  }
}

πŸ” ssh_keyscan

Verify SSH host keys

// Example: Get host key fingerprint
{
  "name": "ssh_keyscan",
  "arguments": {
    "host": "192.168.1.100"
  }
}

πŸ”§ Configuration

Environment Setup

  1. Copy config/.env.example to config/.env

  2. Configure your SSH settings:

# SSH Configuration
SSH_KEY_PATH=/path/to/your/ssh/key
SSH_DEFAULT_HOST=your.server.ip
SSH_DEFAULT_USER=your_username
SSH_DEFAULT_PORT=22

# Security Settings  
SSH_STRICT_HOST_KEY_CHECKING=no
COMMAND_TIMEOUT=30000
LOG_LEVEL=info

Claude Desktop Integration

The server automatically configures Claude Desktop. Manual setup:

{
  "mcpServers": {
    "ssh-powershell-mcp": {
      "command": "node",
      "args": ["path/to/MCP-POWERSHELL/src/index.js"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}

οΏ½ Security

  • βœ… SSH key authentication only (no passwords)

  • βœ… Command sanitization with shell-escape

  • βœ… Environment isolation for different configurations

  • βœ… Comprehensive input validation

  • βœ… Secure credential handling

See SECURITY.md for detailed security practices.

πŸ“š Documentation

πŸ§ͺ Testing

# Run all tests
npm test

# Run specific test types
.\scripts\test.ps1 -TestType unit
.\scripts\test.ps1 -TestType integration
.\scripts\test.ps1 -TestType ssh

🀝 Contributing

  1. Fork the repository

  2. Create feature branch (git checkout -b feature/amazing-feature)

  3. Commit changes (git commit -m 'Add amazing feature')

  4. Push to branch (git push origin feature/amazing-feature)

  5. Open Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™‹β€β™‚οΈ Support

πŸ† Acknowledgments


🏒 Enterprise Ready | πŸ”’ Secure by Design | ⚑ Claude Optimized

Made with ❀️ by GUEPARD98

Available Tools

4 tools
powershell_executeC

Ejecutar comandos PowerShell localmente

Inputs: command (required).

ssh_executeC

Ejecutar comandos en mΓ‘quinas remotas vΓ­a SSH usando clave SSH

Inputs: command (required), host (required), user (required), keyPath.

ssh_keyscanC

Obtener fingerprint de claves SSH de un host

Inputs: host (required).

ssh_scanC

Escanear red para encontrar hosts SSH disponibles

Inputs: network (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: powershell_execute is for local PowerShell commands, ssh_execute is for remote SSH command execution, ssh_keyscan retrieves SSH key fingerprints, and ssh_scan discovers SSH hosts on a network. There is no overlap or ambiguity between these functions.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with a clear verb_noun structure: powershell_execute, ssh_execute, ssh_keyscan, ssh_scan. The naming is uniform and predictable across all tools.

    Tool Count4/5

    With 4 tools, the count is reasonable for an SSH/PowerShell server, covering core remote execution and SSH management tasks. It might be slightly thin for advanced scenarios (e.g., missing file transfer or session management), but it's well-scoped for basic operations.

    Completeness4/5

    The toolset covers key SSH and PowerShell operations: remote command execution, host discovery, and key verification. Minor gaps exist, such as no file transfer (e.g., SCP/SFTP) or SSH configuration management, but agents can work around these with the provided tools for most workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables SSH remote access to servers through Claude, allowing users to execute commands, transfer files via SFTP, and manage multiple remote connections using natural language.
      12
      9
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables secure remote SSH command execution with strict read-only enforcement, allowing safe delegation of SSH access to Claude while preventing write operations. Supports connection pooling, command validation, and comprehensive logging for audit trails.
      5
      1
      -
    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables Claude Code to control remote servers via SSH for automated deployment, testing, and operations, including command execution and file transfer.
      4
      -