MCP Server SSH Server

by Machine-To-Machine

11 156 downloads Not rated yet MIT
GitHub

About

# MCP Server SSH Server [![PyPI version](https://img.shields.io/pypi/v/m2m-mcp-server-ssh-server.svg)](https://pypi.org/project/m2m-mcp-server-ssh-server/) [![Python Versions](https://img.shields.io/pypi/pyversions/m2m-mcp-server-ssh-server.svg)](https://pypi.org/project/m2m-mcp-server-ssh-server/) [![License…

Details

License
MIT

Explore

- Secure Remote Access: Access MCP tools remotely over SSH
- Key-Based Authentication: Support for key-based authentication
- Key Management API: Optional HTTP API for managing SSH keys
- Server Aggregation: Proxy and merge multiple MCP servers into a unified interface
- MCP Support: Compatible with MCP capabilities including:
- Prompts
- Resources
- Tools
- Logging
- Dynamic Configuration: Configure available MCP servers through a simple JSON configuration

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Server SSH Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

In a uv managed python project, add to dependencies by:

uv add m2m-mcp-server-ssh-server

mermaid
%%{init: {'theme':'default', 'themeVariables': { 'primaryColor': '#5D8AA8', 'primaryTextColor': '#fff', 'primaryBorderColor': '#1F456E', 'lineColor': '#5D8AA8', 'secondaryColor': '#006400', 'tertiaryColor': '#fff' }}}%%

sequenceDiagram
participant Host as MCP Host<br>(Claude/Cursor)
participant Client as MCP SSH Client
participant KeySrv as Key Server<br>(HTTP API)
participant SSHSrv as MCP SSH Server
participant MCP as MCP Servers

Note over Client,SSHSrv: Initial Key Exchange & Authentication

Client->>Client: Generate SSH key pair<br>if does not exist
Client->>KeySrv: GET /server_pub_key
KeySrv->>Client: Return server's public key
Client->>Client: Store server key in<br>temporary known_hosts
Client->>KeySrv: POST /register<br>{client_pub_key: "ssh-ed25519 AAAA..."}
KeySrv->>SSHSrv: Store client public key<br>in authorized keys
KeySrv->>Client: {status: "success"}

Note over Client,SSHSrv: Secure SSH Connection

Client->>SSHSrv: SSH handshake with<br>client key authentication
SSHSrv->>SSHSrv: Verify client key<br>against authorized keys
SSHSrv->>Client: Authentication successful

Note over Client,SSHSrv: MCP Communication

Host->>Client: JSONRPC request
Client->>SSHSrv: Forward request<br>over SSH tunnel
SSHSrv->>MCP: Route request to<br>appropriate MCP server
MCP->>SSHSrv: Process and return results
SSHSrv->>Client: Send response over SSH
Client->>Host: Return JSONRPC response

Note over Client,SSHSrv: Session Management

alt Session Termination
Host->>Client: Close connection
Client->>SSHSrv: Terminate SSH session
SSHSrv->>SSHSrv: Clean up resources
end


Quickly set up a local server with your preferred MCP tools:

1. Create a configuration file (servers_config.json):

json
{
"mcpServers": {
"HackerNews": {
"command": "uvx",
"args": ["mcp-hn"]
},
"major-league-baseball": {
"command": "uvx",
"args": ["mcp_mlb_statsapi"]
}
}
}

2. Start the server with the key management API for easier client connection:

bash
uv run m2m-mcp-server-ssh-server --run-key-server

3. Connect using the client:

bash
uv run m2m-mcp-server-ssh-client --host localhost --port 8022 --use-key-server

To make your MCP tools available remotely:

1. Install on your server:

bash
uv add m2m-mcp-server-ssh-server[key-server]

2. Create your configuration file with desired MCP tools

3. Start the server binding to all interfaces:

bash
uv run m2m-mcp-server-ssh-server --host 0.0.0.0 --run-key-server --key-server-host 0.0.0.0

4. Connect from client machines:

bash
uv run m2m-mcp-server-ssh-client --host your-server.example.com --port 8022 --use-key-server

For more detailed deployment instructions, see Cloud Deployment Guide.

bash
git clone https://github.com/Machine-To-Machine/m2m-mcp-server-ssh-server.git
cd m2m-mcp-server-ssh-server
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
```

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp server ssh server": {
            "m2m-mcp-server-ssh-server": {
                "command": "uv",
                "args": [
                    "run",
                    "m2m-mcp-server-ssh-server",
                    "--run-key-server"
                ]
            }
        }
    }
}

McpServers

{
    "m2m-mcp-server-ssh-server": {
        "command": "uv",
        "args": [
            "run",
            "m2m-mcp-server-ssh-server",
            "--run-key-server"
        ]
    }
}

PyPI version
Python Versions
License: MIT

A secure SSH server for accessing and interacting with MCP (Model Context Protocol) tools installed remotely. This server allows clients to connect to multiple MCP tool providers through a unified secure interface.

Features

- Secure Remote Access: Access MCP tools remotely over SSH
- Key-Based Authentication: Support for key-based authentication
- Key Management API: Optional HTTP API for managing SSH keys
- Server Aggregation: Proxy and merge multiple MCP servers into a unified interface
- MCP Support: Compatible with MCP capabilities including:
- Prompts
- Resources
- Tools
- Logging
- Dynamic Configuration: Configure available MCP servers through a simple JSON configuration

Authentication Flow

%%{init: {'theme':'default', 'themeVariables': { 'primaryColor': '#5D8AA8', 'primaryTextColor': '#fff', 'primaryBorderColor': '#1F456E', 'lineColor': '#5D8AA8', 'secondaryColor': '#006400', 'tertiaryColor': '#fff' }}}%%

sequenceDiagram
participant Host as MCP Host<br>(Claude/Cursor)
participant Client as MCP SSH Client
participant KeySrv as Key Server<br>(HTTP API)
participant SSHSrv as MCP SSH Server
participant MCP as MCP Servers

Note over Client,SSHSrv: Initial Key Exchange & Authentication

Client->>Client: Generate SSH key pair<br>if does not exist
Client->>KeySrv: GET /server_pub_key
KeySrv->>Client: Return server's public key
Client->>Client: Store server key in<br>temporary known_hosts
Client->>KeySrv: POST /register<br>{client_pub_key: "ssh-ed25519 AAAA..."}
KeySrv->>SSHSrv: Store client public key<br>in authorized keys
KeySrv->>Client: {status: "success"}

Note over Client,SSHSrv: Secure SSH Connection

Client->>SSHSrv: SSH handshake with<br>client key authentication
SSHSrv->>SSHSrv: Verify client key<br>against authorized keys
SSHSrv->>Client: Authentication successful

Note over Client,SSHSrv: MCP Communication

Host->>Client: JSONRPC request
Client->>SSHSrv: Forward request<br>over SSH tunnel
SSHSrv->>MCP: Route request to<br>appropriate MCP server
MCP->>SSHSrv: Process and return results
SSHSrv->>Client: Send response over SSH
Client->>Host: Return JSONRPC response

Note over Client,SSHSrv: Session Management

alt Session Termination
Host->>Client: Close connection
Client->>SSHSrv: Terminate SSH session
SSHSrv->>SSHSrv: Clean up resources
end

Installation

In a uv managed python project, add to dependencies by:

```bash
uv add m2m-mcp-server-ssh-server

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.