m2m -ssh
MCP server from Machine-To-Machine/m2m-mcp-server-ssh-server
claude mcp add --transport stdio machine-to-machine-m2m-mcp-server-ssh-server uvx m2m-mcp-server-ssh-server
How to use
This MCP server provides a secure SSH gateway to access and orchestrate MCP tools that are installed remotely. It aggregates multiple MCP tool providers behind a single SSH interface, enabling clients to perform MCP activities such as prompts, resource access, and tool execution through a unified secure connection. Optionally, a key management HTTP API can be enabled to register client keys and retrieve the server’s public key, simplifying onboarding for clients that will connect via SSH.
To use the server, install it in your Python environment, run the SSH server, and (optionally) start the key management API. Clients connect using an SSH tunnel configured for MCP JSON-RPC communication. Once connected, clients can route JSON-RPC requests to the appropriate MCP server, which processes the request and returns results over the SSH channel. You can configure which MCP tool providers are exposed by editing the servers_config.json (or equivalent) to list the available MCP tools and their corresponding uvx commands.
How to install
Prerequisites:
- Python 3.8+ and a Python environment manager (virtualenv, venv, etc.).
- uv (Python's Micro Community) tooling available via your project’s packaging.
Install from PyPI (recommended):
# In your uv-managed Python project
uv add m2m-mcp-server-ssh-server
# Optional: include key server functionality
uv add m2m-mcp-server-ssh-server[key-server]
Or install directly with pip (if you prefer standard Python tooling):
pip install m2m-mcp-server-ssh-server
# Optional: include key server functionality
pip install m2m-mcp-server-ssh-server[key-server]
Install from source (if you need to modify the code):
git clone https://github.com/Machine-To-Machine/m2m-mcp-server-ssh-server.git
cd m2m-mcp-server-ssh-server
pip install -e .
Run the server within your project:
uv run m2m-mcp-server-ssh-server
Optional steps for key management API:
uv run m2m-mcp-server-ssh-server --run-key-server
Additional notes
Tips and notes:
- Security: By default, the SSH server binds to localhost (127.0.0.1). If you bind to all interfaces (0.0.0.0), ensure you have strong authentication and consider firewalls or VPNs.
- Key management: The optional HTTP key management API provides endpoints to register client public keys and fetch the server’s public key, simplifying client onboarding.
- Configuration: Use the servers-config.json (or your preferred path via --servers-config) to specify which MCP tools are exposed and how they are invoked (e.g., via uvx commands).
- Dependencies: Ensure required packages (anyio, asyncssh, mcp, pydantic, aiohttp) are installed; aiohttp is optional when not using the key server feature.
- Development: Use the provided commands to lint and test (ruff, bandit) during development.
- Networking: When running the key server, the default port is 8000 (localhost by default). Adjust via --key-server-port and --key-server-host as needed.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP