MCPShell is an MCP server that provides a bridge for large language models to execute command-line tools and operating system shell commands under strict security controls. Designed for developers, systems administrators, and platform engineers, it exposes terminal operations as standard Model Context Protocol tools. Instead of granting models unconstrained shell access, MCPShell relies on YAML configuration files where operators declare specific commands, input parameter schemas, and output formatting. The server enforces Common Expression Language (CEL) constraints to evaluate incoming parameters, preventing path traversal, unintended flag injection, or unsafe characters before any process runs. Commands can execute directly through shells like Bash or inside sandboxed runner environments. This allows AI coding assistants and agents to query infrastructure states, run diagnostic CLI utilities such as kubectl or AWS CLI, and inspect local filesystems while ensuring operations remain strictly bounded and predominantly read-only.
Category: Cloud & Infrastructure
Tags: automation, bash, cli, shell, terminal
/my/example.yaml) defining the commands, parameter constraints, and execution settings. 3. Open your MCP client configuration file (such as .cursor/mcp.json in Cursor). 4. Register the server under mcpServers using the Go execution command: json { "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" ] } } } 5. Restart or refresh your MCP client so it loads the configured command-line tools.Part of MCP Servers
You can run MCPShell using the Go runtime without manual compilation. Add a configuration entry to your client configuration file, such as Cursor mcp.json, calling go run with the repository package github.com/inercia/MCPShell@v0.1.8 and passing your tool configuration YAML file via the --tools argument.
MCPShell converts standard terminal commands and scripts into callable MCP tools. It evaluates parameters against CEL validation rules to prevent command injection, substitutes approved inputs into command templates, runs the processes via shells like Bash or sandboxed runners, and returns formatted outputs back to the AI client.
MCPShell works with any AI client or editor that implements the Model Context Protocol. Supported environments include Cursor, Visual Studio Code, and Witsy, as well as custom multi-agent frameworks like the Don project.
Yes, MCPShell is open source software. It is distributed under the terms of the MIT License on GitHub, allowing users to freely modify, deploy, and contribute to the codebase.