Skip to main content
Glama
praveen-radakirouchenane

local-mcp-with-docker

Dockerを使用したローカル(stdio) MCPサーバー

このプロジェクトは、stdio上でrun_commandツールを公開する最小限のローカルMCPサーバーです。

セットアップ

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

以下のコマンドでスクリプトを起動します:

uv run main.py

注意: MCP 2.0以降、サーバー起動後はコンソールに出力はありません。プロセスは生き続け、MCPクライアントからのstdioメッセージを待ちます。新しいターミナルセッションでデバッガを使用して確認できます。

インスペクターを起動:

npx -y @modelcontextprotocol/inspector

次にインスペクターUIで:

  • トランスポート: 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 .

これにより、Claude Desktop MCP設定で使用されるローカルDockerイメージが作成されます。

Claude Desktopの設定

これをClaude DesktopのMCP設定ファイルに追加します:

{
  "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のスクリーンショット

alt text

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It transparently notes that the tool is a workaround for the AI's inability to run commands directly ('even though you cannot directly do it'). However, it fails to disclose potential risks like destructive side effects, sandboxing, or timeouts, which are critical for a command execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The main description is three sentences long, with the core action stated first. The second sentence about user interaction could be integrated elsewhere but does not bloat the description. The Args section is sufficiently compact. No unnecessary filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of annotations and sibling tools, the description covers the basic purpose, location, return value, and a usage hint. However, it omits important details like synchronous execution, shell environment, restriction on interactive commands, or error behavior beyond a simple error message. The output schema is marked as existing but not shown, so the return description is a placeholder.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal meaning beyond the input schema. The schema only provides a title 'Command', while the description says 'The shell command to run.' This clarifies it is a shell command but does not elaborate on syntax, quoting rules, or environment details. With 0% schema coverage, the description compensates only slightly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence clearly states the tool's primary action: 'Run a terminal command inside the workspace directory.' This is specific and unambiguous. The additional instruction about telling the user clarifies the tool's role but is more about usage than purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: '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.' This gives the agent a scripted interaction pattern. However, it lacks any mention of preconditions, security considerations, or alternative approaches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev0.1.0
    • First observedrun_command

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

ActivitySlowing
ResponsivenessNo 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
    C
    maintenance
    A minimal, zero-dependency MCP server that enables defining and running tools over stdio transport, without extra features like HTTP or resources.
    37 npm
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A minimal MCP server that provides a single 'hello' tool returning 'Hello, world!'.
    2
    6 npm
    MIT