Logo vun MCPShell

MCPShell

Communautéit
inercia

Use shell scripts as MCP tools

Editeurinercia
RepositoryMCPShell
SproochGo
Forks
15
Stären
70
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    MCPShell stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    70 Stären an 15 Forks aus dem verlinkte Repository.

MCPShell

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 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:

    yaml
    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 for more sophisticated and useful examples. Maybe you prefer to let the LLM know about your Kubernetes cluster with kubectl? Or let it run some AWS CLI 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:

    json
    {
        // you need the "go" command available
        "mcpServers": {
            "mcp-cli-examples": {
                "command": "go",
                "args": [
                   "run", "github.com/inercia/MCPShell@v0.1.8",
                   "mcp", "--tools", "/my/example.yaml",
                   "--logfile", "/some/path/mcpshell/example.log"
                ]
            }
        }
    }

    You can also use relative paths and omit the .yaml extension:

    json
    {
        "mcpServers": {
            "mcp-cli-examples": {
                "command": "go",
                "args": [
                   "run", "github.com/inercia/MCPShell@v0.1.8",
                   "mcp", "--tools", "example",
                   "--logfile", "/some/path/mcpshell/example.log"
                ]
            }
        }
    }

    This will look for example.yaml in the tools directory (~/.mcpshell/tools/ by default).

    See more details on how to configure Cursor or Visual Studio Code. 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.

Configuration files use a YAML format defined here. See the this directory for some examples.

For deploying MCPShell in containers and Kubernetes, see the Container Deployment Guide.

Agent Mode

For AI agent functionality that connects LLMs directly to tools, see the Don project. Don provides:

  • Direct LLM connectivity without requiring a separate MCP client
  • RAG (Retrieval-Augmented Generation) support
  • Multi-agent architecture
  • Uses MCPShell's tool configuration format

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 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 document before using this software.

Contributing

Contributions are welcome! Take a look at the development guide. 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.

Installatioun

TypingMind
{
  "mcpServers": {
    "mcpshell": {
      "command": "go",
      "args": [
        "run",
        "github.com/inercia/MCPShell@v0.1.5",
        "mcp",
        "--config",
        "{{config.CONFIG_PATH}}",
        "--logfile",
        "{{config.LOGFILE_PATH}}"
      ],
      "env": {
        "CONFIG_PATH": "<CONFIG_PATH>",
        "LOGFILE_PATH": "<LOGFILE_PATH>"
      }
    }
  }
}

MCPShell MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal MCPShell verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

MCPShell als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu MCPShell an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "mcpshell": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu MCPShell. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu MCPShell.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat MCPShell?
MCPShell
Jo. Ech hunn et gelies.
Dat hunn ech mat MCPShell fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server MCPShell benotzt?

MCPShell ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech MCPShell MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir MCPShell mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat MCPShell MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann MCPShell verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech MCPShell MCP mat TypingMind?

MCPShell leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt MCPShell MCP an TypingMind zur Verfügung?

MCPShell stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir MCPShell MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann MCPShell eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇