MCP Server LogoMCP Server
MCPsカテゴリディレクトリ投稿する
投稿する
MCPsカテゴリディレクトリ投稿する
投稿する

MCPサーバー

MCPサーバーのリスト、Awesome MCPサーバーとClaude MCP統合を含む。AIの能力を強化するためのMCPサーバーを検索して発見します。

お問い合わせ

[email protected]

MCPサーバーについて

プライバシーポリシー利用規約

リソース

モデルコンテキストプロトコルMCPスターターガイドClaude MCPサーバー

コミュニティ

GitHub

© 2025 mcpserver.cc © 2025 MCPサーバー. 全著作権所有.

プライバシーポリシー利用規約
  1. Home
  2. /Categories
  3. /Automation & Scripting
  4. /Mcp Cli Adapter
Mcp Cli Adapter

Mcp Cli Adapter

作成者 inercia•9 days ago
サイトを訪問する

Use shell scripts as MCP tools

Automation & Scripting
shellscriptstools

MCPShell

banner

The MCPShell is a tool that allows LLMs to safely execute command-line tools through the Model Context Protocol (MCP). It provides a secure bridge between LLMs and operating system commands.

Features

  • Flexible command execution: Run any shell commands as MCP tools, with parameter substitution through templates.
  • Configuration-based tool definitions: Define tools in YAML with parameters, constraints, and output formatting.
  • Security through constraints: Validate tool parameters using CEL expressions before execution, as well as optional sanboxed environments{:target=“_blank”} for running commands.
  • Quick proptotyping of MCP tools: just add some shell code and use it as a MCP tool in your LLM.
  • Simple integration: Works with any LLM client supporting the MCP protocol (ie, Cursor, VSCode, Witsy…)

Quick Start

Imagine you want Cursor (or some other MCP client) help you with your space problems in your hard disk.

  1. Create a configuration file /my/example.yaml defining your tools:

    mcp:
      description: |
        Tool for analyzing disk usage to help identify what's consuming space.
      run:
        shell: bash
      tools:
        - name: "disk_usage"
          description: "Check disk usage for a directory"
          params:
            directory:
              type: string
              description: "Directory to analyze"
              required: true
            max_depth:
              type: number
              description: "Maximum depth to analyze (1-3)"
              default: 2
          constraints:
            - "directory.startsWith('/')"  # Must be absolute path
            - "!directory.contains('..')"  # Prevent directory traversal
            - "max_depth >= 1 && max_depth <= 3"  # Limit recursion depth
            - "directory.matches('^[\w\s./\-_]+$')"  # Only allow safe path characters, prevent command injection
          run:
            command: |
              du -h --max-depth={{ .max_depth }} {{ .directory }} | sort -hr | head -20
          output:
            prefix: |
              Disk Usage Analysis (Top 20 largest directories):
    

    Take a look at the examples directory{:target=“_blank”} for more sophisticated and useful examples. Maybe you prefer to let the LLM know about your Kubernetes cluster with kubectl{:target=“_blank”}? Or let it run some AWS CLI{:target=“_blank”} commands?

  2. Configure the MCP server in Cursor (or in any other LLM client with support for MCP)

    For example, for Cursor, create .cursor/mcp.json:

    {
        // you need the "go" command available
        "mcpServers": {
            "mcp-cli-examples": {
                "command": "go",
                "args": [
                   "run", "github.com/inercia/[email protected]",
                   "mcp", "--config", "/my/example.yaml",
                   "--logfile", "/some/path/mcpshell/example.log"
                ]
            }
        }
    }
    

    See more details on how to configure Cursor{:target=“_blank”} or Visual Studio Code{:target=“_blank”}. Other LLMs with support for MCPs should be configured in a similar way.

  3. Make sure your MCP client is refreshed (Cursor should recognize it automatically the firt time, but any change in the config file will require a refresh).

  4. Ask your LLM some questions it should be able to answer with the new tool. For example: “I’m running out of space in my hard disk. Could you help me finding the problem?”.

Usage and Configuration

Take a look at all the command in this document{:target=“_blank”}.

Configuration files use a YAML format defined here{:target=“_blank”}. See the this directory{:target=“_blank”} for some examples.

Agent Mode

MCPShell can also be run in agent mode, providing direct connectivity between Large Language Models (LLMs) and your command-line tools without requiring a separate MCP client. In this mode, MCPShell connects to an OpenAI-compatible API (including local LLMs like Ollama), makes your tools available to the model, executes requested tool operations, and manages the conversation flow. This enables the creation of specialized AI assistants that can autonomously perform system tasks using the tools you define in your configuration. The agent mode supports both interactive conversations and one-shot executions, and allows you to define system and user prompts directly in your configuration files.

For detailed information on using agent mode, see the Agent Mode documentation{:target=“_blank”}.

Security Considerations

So you will probably thing “this AI has helped me finding all those big files. What if I create another tool for removing files?”. Don’t do that!.

  • Limit the scope of these tools to read-only actions, do not give the LLM the power to change things.
  • Use constraints to limit command execution to safe parameters
  • Consider using a sanboxed environment{:target=“_blank”} for running commands.
  • Review all command templates for potential injection vulnerabilities
  • Only expose tools that are safe for external use
  • All of the above!

Please read the Security Considerations{:target=“_blank”} document before using this software.

Contributing

Contributions are welcome! Take a look at the development guide{:target=“_blank”}. Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

前提条件

  • •サーバーのドメインに精通している
  • •関連技術の基本的な理解
  • •Automation & Scriptingの知識

おすすめのサーバー

Mcp Guide

Mcp Guide

A beginner-friendly guide server that helps users understand MCP concepts, provides interactive examples, and demonstrates best practices for building MCP integrations. Features tools for exploring MCP capabilities, resources for learning core concepts, and prompts for guided tutorials.

Gitlab Mcp

Gitlab Mcp

gitlab mcp

Mcp

Mcp

The registry mcp server updates your resume while you code

もっと見る → →

詳細

作成日

June 11, 2025

最終更新日

June 11, 2025

カテゴリー

Automation & Scripting

作成者

inercia

シェアする

もっと見る

Face Generator

Face Generator

MCP server for generating human face images with various shapes and sizes

Mcp Server Ragdocs

Mcp Server Ragdocs

An MCP server that provides tools for retrieving and processing documentation through vector search, both locally or hosted. Enabling AI assistants to augment their responses with relevant documentation context.

Mcp Selenium

Mcp Selenium

An MCP implementation for Selenium WebDriver

Obsidian Mcp Server

Obsidian Mcp Server

Obsidian Knowledge-Management MCP (Model Context Protocol) server that enables AI agents and development tools to interact with an Obsidian vault. It provides a comprehensive suite of tools for reading, writing, searching, and managing notes, tags, and frontmatter, acting as a bridge to the Obsidian Local REST API plugin.