
A secure SSH server for accessing and interacting with MCP (Model Context Protocol) tools installed remotely.
概览
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. - : Access MCP tools remotely over SSH - : Support for key-based authentication - : Optional HTTP API for managing SSH keys - : Proxy and merge multiple MCP servers into a unified interface - : Compatible with MCP capabilities including: - Prompts - Resources - Tools - Logging - : Configure available MCP servers through a simple JSON configuration In a uv managed python project, add to dependencies by: Alternatively, for projects using pip for dependencies: Quickly set up a local server with your preferred MCP tools: 1. Create a configuration file (servers_config.json): 2. Start the server with the key management API for easier client connection: To make your MCP tools available remotely:
README
以下为原文 README 节选,完整内容请查看原文。
MCP Server SSH Server
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(Claude/Cursor)
participant Client as MCP SSH Client
participant KeySrv as Key Server(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 pairif does not exist
Client->>KeySrv: GET /server_pub_key
KeySrv->>Client: Return server's public key
Client->>Client: Store server key intemporary known_hosts
Client->>KeySrv: POST /register{client_pub_key: "ssh-ed25519 AAAA..."}
KeySrv->>SSHSrv: Store client public keyin authorized keys
KeySrv->>Client: {status: "success"}
Note over Client,SSHSrv: Secure SSH Connection
Client->>SSHSrv: SSH handshake withclient key authentication
SSHSrv->>SSHSrv: Verify client keyagainst authorized keys
SSHSrv->>Client: Authentication successful
Note over Client,SSHSrv: MCP Communication
Host->>Client: JSONRPC request
Client->>SSHSrv: Forward requestover SSH tunnel
SSHSrv->>MCP: Route request toappropriate 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:
安装
uvx mcp-hn配置
{
"mcpServers": {
"HackerNews": {
"command": "uvx",
"args": ["mcp-hn"]
},
"major-league-baseball": {
"command": "uvx",
"args": ["mcp_mlb_statsapi"]
}
}
}