local-mcp-with-docker
基于 Docker 的本地(stdio)MCP 服务器
本项目是一个最小的本地 MCP 服务器,通过 stdio 暴露 run_command 工具。
设置
cd ~path-to-directory/local-mcp-with-docker
uv sync使用以下命令启动脚本:
uv run main.py注意:从 MCP 2.0 开始,服务器启动后控制台将不再有任何输出。进程保持活动状态,并等待来自 MCP 客户端的 stdio 消息。您可以在新的终端会话中使用调试器进行检查。
启动检查器:
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 .这会创建 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 截图

Available Tools
1 toolrun_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
Scored across 1 tool
With only one tool, there is no possibility of confusion with other tools. The tool has a clear and singular purpose: running terminal commands.
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.
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.
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
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA basic MCP server implementation for testing purposes. Communicates via stdio and is designed to work with MCP-compliant clients.-
- AlicenseNot gradedqualityDmaintenanceA minimal, zero-dependency MCP server that enables defining and running tools over stdio transport, without extra features like HTTP or resources.18 npm1MIT
- FlicenseAqualityDmaintenanceA minimal MCP server that provides a single 'hello' tool returning 'Hello, world!'.2-
- AlicenseAqualityFmaintenanceA minimal MCP server that exposes a single bash tool to execute commands inside a devcontainer, returning real output and exit codes.1MIT