
sonirico/mcp-shell
Deployment & DevOpsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
sonirico/mcp-shell — это кандидат-сервер MCP, импортированный из https://github.com/sonirico/mcp-shell.
Обзор
sonirico/mcp-shell — это кандидат-сервер MCP, импортированный из https://github.com/sonirico/mcp-shell.
Обзор (машинный перевод)
MCP-сервер, который запускает команды shell. Ваш LLM получает инструмент; вы контролируете, что и как выполняется.
Построено на mark3labs/mcp-go. Написано на Go.
Запусти
Docker (самый лёгкий):
Из источника:
Настрой его
Безопасный режим — по умолчанию. Без конфигурационного файла mcp-shell загружается в защищённом режиме
режим и регистрирует только типизированные инструменты: чтение файлов, grep/glob, проверка git,
и (opt-in) записи файлов/git и скриптов, определяемых операторами. Raw не существует.
Команду shell. Вам нужен только конфигурационный файл, чтобы изменить параметры по умолчанию ниже. В
Если вы работаете полностью без ограничений, вы должны явно согласиться:
Чтобы настроить политику, укажите на конфигурацию YAML:
Безопасный режим (по умолчанию) — только типизированные инструменты, каждый путь ограничен working_directory:
Подключи это
Claude Desktop — добавить в вашу конфигурацию MCP:
Для пользовательской конфигурации смонтировать файл и настроить окружение:
Инструменты
Безопасный режим (по умолчанию) регистрирует эти типизированные инструменты. * отмечает обязательный
параметр.
| Инструмент | Параметры | Доступно |
|---|---|---|
read_file |
путь*, смещение, предел, хвост | всегда |
list_dir |
путь, глубина, include_hidden | всегда |
glob |
паттерн*, путь, newer_than, max_results | всегда |
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
mcp-shell
MCP server that runs shell commands. Your LLM gets a tool; you get control over what runs and how.
Built on mark3labs/mcp-go. Written in Go.
Run it
Docker (easiest):
docker run -it --rm -v /tmp/mcp-workspace:/tmp/mcp-workspace sonirico/mcp-shell:latest
From source:
git clone https://github.com/sonirico/mcp-shell && cd mcp-shell
make install
mcp-shell
Configure it
Secure mode is the default. With no config file, mcp-shell boots in secure
mode and registers only typed tools: file reads, grep/glob, git inspection,
and (opt-in) file/git writes and operator-defined scripts. There is no raw
shell command. You only need a config file to change the defaults below. To
run fully unrestricted you must opt in explicitly:
MCP_SHELL_ALLOW_UNSAFE=1 mcp-shell # disables secure mode; the only tool is shell_exec
To customize the policy, point to a YAML config:
export MCP_SHELL_SEC_CONFIG_FILE=/path/to/security.yaml
mcp-shell
Secure mode (default) — typed tools only, every path confined to working_directory:
security:
enabled: true
working_directory: /tmp/mcp-workspace
max_execution_time: 30s
max_output_size: 1048576
run_as_user: ""
audit_log: true
# Expose file and git write tools (write_file, edit_file, mkdir, move,
# delete, git_add, git_commit, git_switch, git_restore, git_stash). Off by
# default.
writes_enabled: false
# Operator-defined scripts exposed through the run_script tool. The client
# picks a name; the argv is yours and cannot be altered.
# scripts:
# test: ["go", "test", "./..."]
# lint: ["golangci-lint", "run"]
Wire it up
Claude Desktop — add to your MCP config:
{
"mcpServers": {
"shell": {
"command": "docker",
"args": ["run", "--rm", "-i", "sonirico/mcp-shell:latest"],
"env": { "MCP_SHELL_LOG_LEVEL": "info" }
}
}
}
For custom config, mount the file and set the env:
{
"command": "docker",
"args": ["run", "--rm", "-i", "-v", "/path/to/security.yaml:/etc/mcp-shell/security.yaml", "-e", "MCP_SHELL_SEC_CONFIG_FILE=/etc/mcp-shell/security.yaml", "sonirico/mcp-shell:latest"]
}
Tools
Secure mode (the default) registers these typed tools. * marks a required
parameter.
| Tool | Parameters | Available |
|---|---|---|
read_file |
path*, offset, limit, tail | always |
list_dir |
path, depth, include_hidden | always |
glob |
pattern*, path, newer_than, max_results | always |
grep |
pattern*, path, glob, ignore_case, context, files_only, count, max_results | always |
Установка
docker run --rm -i sonirico/mcp-shell:latestКонфигурация
{
"mcpServers": {
"shell": {
"command": "docker",
"args": ["run", "--rm", "-i", "sonirico/mcp-shell:latest"],
"env": { "MCP_SHELL_LOG_LEVEL": "info" }
}
}
}