Skip to main content
Glama

Shell MCP Server

by blazickjp
Apache 2.0
9
  • Linux
  • Apple

🖥️ シェル MCP サーバー

🚀 Shell MCP サーバーを使用して、AI アプリケーションに安全なシェル コマンド実行機能を追加します。モデル コンテキスト プロトコル用に構築されています。

✨ 特徴

  • 🔒セキュア実行- コマンドは指定されたディレクトリ内でのみ実行されます
  • 🐚複数のシェル- bash、sh、cmd、powershell をサポート
  • ⏱️タイムアウト制御- 長時間実行されるコマンドの自動終了
  • 🌍クロスプラットフォーム- Unix と Windows の両方のシステムで動作します
  • 🛡️デフォルトで安全- ディレクトリとシェルの検証が組み込まれています

🚀 クイックスタート

インストール

# Using pip pip install shell-mcp-server # Using uv (recommended) uv pip install shell-mcp-server

🔌 クロード デスクトップ統合

シェル コマンドの実行を有効にするには、Claude Desktop 構成にこれを追加します。

{ "mcpServers": { "shell-mcp-server": { "command": "uv", "args": [ "--directory", "/path/to/shell-mcp-server", "run", "shell-mcp-server", "/path/to/allowed/dir1", "/path/to/allowed/dir2", "--shell", "bash", "/bin/bash", "--shell", "zsh", "/bin/zsh" ] } } }

🎮 使用例

基本的なファイル操作

# List directory contents result = execute_command( command="ls -la", shell="bash", cwd="/path/to/project" ) # Find files by pattern result = execute_command( command="find . -name '*.py'", shell="bash", cwd="/path/to/project" )

プロジェクト管理

# Git operations result = execute_command( command="git status && git diff", shell="bash", cwd="/path/to/repo" ) # Package management result = execute_command( command="pip list --outdated", shell="bash", cwd="/path/to/python/project" )

システム情報

# Resource usage result = execute_command( command="df -h && free -h", shell="bash", cwd="/path/to/dir" ) # Process monitoring result = execute_command( command="ps aux | grep python", shell="bash", cwd="/path/to/dir" )

ファイル処理

# Search file content result = execute_command( command="grep -r 'TODO' .", shell="bash", cwd="/path/to/project" ) # File manipulation result = execute_command( command="awk '{print $1}' data.csv | sort | uniq -c", shell="bash", cwd="/path/to/data" )

Windows固有の例

# List processes result = execute_command( command="Get-Process | Where-Object {$_.CPU -gt 10}", shell="powershell", cwd="C:\\path\\to\\dir" ) # System information result = execute_command( command="systeminfo | findstr /B /C:'OS'", shell="cmd", cwd="C:\\path\\to\\dir" )

⚙️ 構成

コマンドライン引数を使用して動作を構成します。

口論説明
directories📁 許可されたディレクトリのリスト
--shell name path🐚 シェルの仕様(名前とパス)

環境変数:

  • COMMAND_TIMEOUT : ⏱️ 最大実行時間(秒)(デフォルト: 30)

🛡️ セキュリティ機能

  • 🔐ディレクトリ分離: コマンドは指定されたディレクトリ内でのみ実行できます
  • 🔒シェル制御: 設定されたシェルのみが許可されます
  • タイムアウト保護: すべてのコマンドには設定可能なタイムアウトがあります
  • 🛑パス検証: 作業ディレクトリの検証によりトラバーサル攻撃を防止
  • 👤権限分離: コマンドはサーバープロセスと同じ権限で実行されます

🛠️ 開発

開発環境をセットアップします。

# Create and activate virtual environment uv venv source .venv/bin/activate # Install development dependencies uv pip install -e ".[test]" # Run tests python -m pytest # Run tests with coverage python -m pytest --cov=shell_mcp_server

🤝 貢献する

貢献大歓迎!お気軽にどうぞ:

  • 🐛 バグを報告する
  • 💡 機能を提案する
  • 🔧 プルリクエストを送信する
  • 📚 ドキュメントの改善

📜 ライセンス

MIT ライセンス - 詳細についてはライセンスを参照してください。


🌟 セキュア シェル アクセスで AI を強化しましょう! 🌟

モデルコンテキストプロトコル向けに構築 | MCPコミュニティによって愛を込めて作成

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

AI アプリケーションが指定されたディレクトリでシェル コマンドを実行できるようにする安全なサーバーです。ディレクトリ分離やタイムアウト制御などのセキュリティ機能が組み込まれており、複数のシェル タイプ (bash、sh、cmd、powershell) をサポートします。

  1. ✨ 特徴
    1. 🚀 クイックスタート
      1. インストール
      2. 🔌 クロード デスクトップ統合
    2. 🎮 使用例
      1. 基本的なファイル操作
      2. プロジェクト管理
      3. システム情報
      4. ファイル処理
      5. Windows固有の例
    3. ⚙️ 構成
      1. 🛡️ セキュリティ機能
        1. 🛠️ 開発
          1. 🤝 貢献する
            1. 📜 ライセンス
              1. 🌟 セキュア シェル アクセスで AI を強化しましょう! 🌟

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A 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 -
              1
              74
              Python
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              A secure server for executing terminal commands within predefined paths, allowing safe interaction by Large Language Models with operating system environments.
              Last updated -
              1
              11
              3
              JavaScript
              MIT License
              • Apple
              • Linux
            • A
              security
              A
              license
              A
              quality
              A Node.js implementation of the Model Context Protocol that provides secure shell command execution capabilities, allowing AI models like Claude to run shell commands in a controlled environment with built-in security measures.
              Last updated -
              1
              110
              25
              JavaScript
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              A server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.
              Last updated -
              1
              76
              2
              TypeScript
              MIT License
              • Linux
              • Apple

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/blazickjp/shell-mcp-server'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server