Skip to main content
Glama
local-mcp-with-docker

local-mcp-with-docker

Локальный MCP-сервер (stdio) с Docker

Этот проект представляет собой минимальный локальный MCP-сервер, который предоставляет инструмент run_command через stdio.

Настройка

cd ~path-to-directory/local-mcp-with-docker
uv sync

Запустите скрипт с помощью:

uv run main.py

Примечание: начиная с MCP 2.0, после запуска сервера в консоли не будет вывода. Процесс остаётся активным и ожидает сообщений stdio от MCP-клиента. Вы можете проверить его с помощью отладчика в новом сеансе терминала.

Запустите инспектор:

npx -y @modelcontextprotocol/inspector

Затем в интерфейсе инспектора:

  • Транспорт: stdio

  • Команда: uv

  • Аргументы: run, python, main.py

  • Рабочая директория: ~path-to-directory/local-mcp-with-docker

Инспектор должен показать зарегистрированный инструмент run_command и позволить вам вызвать его напрямую.

Related MCP server: mcp-stdio

Сборка Docker-образа

docker build -t terminal_tool_docker .

Это создаёт локальный Docker-образ, используемый конфигурацией MCP в Claude Desktop.

Конфигурация Claude Desktop

Добавьте это в файл конфигурации MCP вашего Claude Desktop:

{
  "mcpServers": {
    "local-mcp-with-docker": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "-e",
        "DOCKER_CONTAINER=true",
        "-e",
        "WORKSPACE_DIR=/root/mcp/workspace",
        "-v",
        "path-to-directory/local-mcp-with-docker:/root/mcp/workspace",
        "terminal_tool_docker"
      ]
    }
  }
}

Это монтирует вашу рабочую область в контейнер и указывает серверу правильную рабочую директорию внутри контейнера.

Скриншот Claude

альтернативный текст

Available Tools

1 tool
run_commandA

Run a terminal command inside the workspace directory. If a terminal command can accomplish a task, tell the user you'll use this tool to accomplish it, even though you cannot directly do it

Args: command: The shell command to run.

Returns: The command output or an error message.

Inputs: command (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion with other tools. The tool has a clear and singular purpose: running terminal commands.

    Naming Consistency3/5

    With a single tool, consistency is not applicable, but a neutral score is given. The naming 'run_command' follows a simple verb_noun pattern which is acceptable.

    Tool Count1/5

    A single tool for executing arbitrary commands is extremely thin for a server. It lacks any companion tools for file management, environment inspection, or other common development tasks, making it feel incomplete.

    Completeness2/5

    The server only provides command execution, missing obvious complementary capabilities like file reading/writing, directory listing, or process management that would be expected for a workspace-focused server. Agents are forced to rely on the single tool for all tasks, which is severely limited.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A basic MCP server implementation for testing purposes. Communicates via stdio and is designed to work with MCP-compliant clients.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A minimal, zero-dependency MCP server that enables defining and running tools over stdio transport, without extra features like HTTP or resources.
      18 npm
      1
      MIT