MCP ターミナルサーバー
モデルコンテキストプロトコル(MCP)を実装した安全なターミナル実行サーバー。このサーバーは、セキュリティ機能とリソース制限を備えた制御されたコマンド実行機能を提供します。
特徴
コマンド実行: 出力キャプチャとエラー処理を備えたシェルコマンドを実行します。
セキュリティ制御: 許可されたコマンドを制限し、コマンドインジェクションを防止する
リソース制御:
コマンドタイムアウト
最大出力サイズの制限
MCP プロトコルサポート:
標準MCPメッセージ形式
機能広告
ストリーミング出力のサポート
発達
ローカルセットアップ
PyPIへの公開
MCP Inspectorによるテスト
MCP Inspector ツールを使用して、サーバーの実装をテストできます。
テストの実行
Claude Desktopでの使用
パッケージが PyPI に公開されたら:
UV をインストールします(まだインストールされていない場合)。
pip install uvUV を使用してパッケージをインストールします。
uv pip install mcp-terminalClaude Desktop を構成する: Claude Desktop 構成ファイルを編集します (通常、macOS では
~/Library/Application Support/Claude/claude_desktop_config.jsonにあります)。{ "mcpServers": { "terminal": { "command": "uv", "args": [ "pip", "run", "mcp-terminal", "--allowed-commands", "python,pip,git,ls,cd", "--timeout-ms", "30000", "--max-output-size", "1048576" ] } } }
プロトコルの実装
サーバーは、次の機能を備えたモデル コンテキスト プロトコル (MCP) を実装します。
機能広告
メッセージ形式
リクエスト:
応答:
エラー:
セキュリティに関する考慮事項
コマンド検証:
許可されたコマンドのみ実行できます
シェル演算子はブロックされています
コマンドインジェクションの試みは阻止される
資源保護:
コマンドタイムアウトによりハングアップを防止
出力サイズの制限によりメモリ不足を防止
すべての失敗ケースに対するエラー処理
ベストプラクティス:
本番環境では常に
allowed-commandsを設定する控えめなタイムアウトとサイズ制限を使用する
コマンド実行ログを監視する
貢献
リポジトリをフォークする
機能ブランチを作成します(
git checkout -b feature/amazing-feature)変更をコミットします (
git commit -m 'Add some amazing feature')ブランチにプッシュする (
git push origin feature/amazing-feature)プルリクエストを開く
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
モデル コンテキスト プロトコル (MCP) を介してセキュリティ機能とリソース制限を備えた制御されたコマンド実行を可能にする安全なターミナル実行サーバー。
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityA secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.Last updated -1141MIT License
- Asecurity-licenseAqualityAn MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.Last updated -1084MIT License
- Asecurity-licenseAqualityAn MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.Last updated -94297MIT License
- Asecurity-licenseAqualityA secure server that implements the Model Context Protocol (MCP) to enable controlled execution of authorized shell commands with stdin support.Last updated -1