MCP服务器SSH服务器のロゴ

MCP服务器SSH服务器

組織
Machine-To-Machine

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…

公開者Machine-To-Machine
リポジトリm2m-mcp-server-ssh-server
言語Python
フォーク
3
スター
11
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    MCP服务器SSH服务器は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには11件のスターと3件のフォークがあります。

MCP Server SSH 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

Installation

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

bash
uv add m2m-mcp-server-ssh-server
# For key server functionality, include the optional dependency:
uv add m2m-mcp-server-ssh-server[key-server]

Alternatively, for projects using pip for dependencies:

bash
pip install m2m-mcp-server-ssh-server
# Or with key server functionality
pip install m2m-mcp-server-ssh-server[key-server]

To install directly from the source:

bash
git clone https://github.com/Machine-To-Machine/m2m-mcp-server-ssh-server.git
cd m2m-mcp-server-ssh-server
pip install -e .

To run the server inside your project:

uv run m2m-mcp-server-ssh-server

Common Use Cases

1. Local Development Environment

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"]
    }
  }
}
  1. Start the server with the key management API for easier client connection:
bash
uv run m2m-mcp-server-ssh-server --run-key-server
  1. Connect using the client:
bash
uv run m2m-mcp-server-ssh-client --host localhost --port 8022 --use-key-server

2. Remote Hosting (Quick Setup)

To make your MCP tools available remotely:

  1. Install on your server:
bash
uv add m2m-mcp-server-ssh-server[key-server]
  1. Create your configuration file with desired MCP tools

  2. 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
  1. 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.

Usage

Command Line Options

  • --host: SSH server host address to bind to (default: 127.0.0.1)
  • --port: SSH server port to listen on (default: 8022)
  • --authorized-clients: Path to authorized keys file (default: ~/.ssh/authorized_keys)
  • --server-key: Path to server private key file (default: ~/.ssh/m2m_mcp_server_ssh_server)
  • --passphrase: Passphrase for the private key (optional)
  • --servers-config: Path to server configurations JSON (default: servers_config.json)
  • --log-level: Set logging level (default: INFO)
  • --run-key-server: Run the HTTP key management server
  • --key-server-port: Port for the HTTP key management server (default: 8000)
  • --key-server-host: Host for the HTTP key management server (default: 127.0.0.1)
  • --version: Show version information and exit

Security Note: When binding to all interfaces (0.0.0.0), your server will be accessible from any machine that can reach your system. Make sure to use strong authentication and consider additional security measures like firewalls.

Key Management Server

You can optionally run a key management HTTP server alongside the SSH server to simplify client key registration:

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

This starts:

  • SSH server on port 8022
  • Key management HTTP server on port 8000 (localhost only by default)

Key Management API

The key management server provides the following endpoints:

  1. POST /register - Register a client's public key

    • Request body: {"client_pub_key": "ssh-rsa AAAA..."}
    • Response: {"status": "success"} or error message
  2. GET /server_pub_key - Get the server's public key

    • Response: {"server_pub_key": "ssh-ed25519 AAAA..."}
  3. GET /health - Check server health status

    • Response: {"status": "healthy"}

Example client key registration:

bash
curl -X POST -H "Content-Type: application/json" \
  -d '{"client_pub_key": "ssh-rsa AAAA..."}' \
  http://localhost:8000/register

Security Considerations

  • Default binding is to localhost (127.0.0.1) for improved security
  • Keys are automatically generated with secure permissions if not provided
  • Default key location is ~/.ssh/m2m_mcp_server_ssh_server
  • Private keys use 0o600 permissions (readable only by owner)
  • Public keys use 0o644 permissions (readable by all, writable by owner)
  • Key server uses rate limiting for API endpoints
  • Input validation protects against malicious inputs

Dependencies

  • anyio (>=4.5.0)
  • asyncssh (>=2.20.0)
  • mcp (>=1.1.3)
  • pydantic (>=2.0.0)
  • aiohttp (>=3.11.16) - Optional, for key server functionality

Development

Setup Development Environment

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]"

Code Quality

bash
# Run linting
uv run ruff check .

# Run formatting check
uv run ruff format --check .

# Run security checks
uv run bandit -r src/

Contributing

We welcome contributions to help expand and improve m2m-mcp-server-ssh-server. Whether you want to add new features, enhance existing functionality, or improve documentation, your input is valuable.

Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements.

Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

License

MIT License - See LICENSE file for details.

Authors

  • Machine To Machine

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "machine-to-machine-m2m-mcp-server-ssh-server": {
      "command": "uvx",
      "args": [
        "m2m-mcp-server-ssh-server"
      ]
    }
  }
}

MCP服务器SSH服务器のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度MCP服务器SSH服务器に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

MCP服务器SSH服务器をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. MCP服务器SSH服务器のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "machine-to-machine-m2m-mcp-server-ssh-server": {
      "command": "npx",
      "args": [
        "-y",
        "m2m-mcp-server-ssh-server"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMCP服务器SSH服务器のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. MCP服务器SSH服务器のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
MCP服务器SSH服务器を使ってこのタスクを手伝ってもらえますか?
MCP服务器SSH服务器
はい、読みました。
MCP服务器SSH服务器で調べた結果をお伝えします。

よくある質問

MCP服务器SSH服务器 MCPサーバーは何に使いますか?

MCP服务器SSH服务器は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMCP服务器SSH服务器 MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMCP服务器SSH服务器を利用できます。

TypingMindでMCP服务器SSH服务器 MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。MCP服务器SSH服务器を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

MCP服务器SSH服务器 MCPをTypingMindに接続するにはどうすればよいですか?

MCP服务器SSH服务器はTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMCP服务器SSH服务器 MCPのどのようなツールを利用できますか?

MCP服务器SSH服务器はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

MCP服务器SSH服务器 MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。MCP服务器SSH服务器で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇