container-mcp
MCP server for Apple container to manage, build, inspect, and diagnose Linux containers on macOS directly from AI agents.
README
container-mcp
MCP server for Apple container — manage, build, inspect, and diagnose Linux containers on macOS directly from AI agents like Claude Desktop, Claude Code, and Cursor.
Built on Apple's container CLI for native Linux container support on Apple Silicon Macs.
Prerequisites
- macOS 26+ (Tahoe) on Apple Silicon (M1/M2/M3/M4)
- Apple container CLI installed — github.com/apple/container
- Node.js 18+
Installation
npm install -g container-mcp
You can run the server directly via npx using the published npm package:
npx -y @arxndev/container-mcp
Or, if you prefer to build from source:
Configuration
For Claude Desktop
Add this to your claude_desktop_config.json file:
{
"mcpServers": {
"container-mcp": {
"command": "npx",
"args": [
"-y",
"@arxndev/container-mcp"
]
}
}
}
Claude Code
claude mcp add container-mcp -- npx -y container-mcp
Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"container": {
"command": "npx",
"args": ["-y", "container-mcp"]
}
}
}
Environment Variables
| Variable | Default | Description |
|---|---|---|
CONTAINER_CLI_PATH |
container |
Path to the container CLI binary |
CONTAINER_MCP_LOG_LEVEL |
info |
Log level: debug, info, warn, error |
CONTAINER_MCP_VOLUME_ROOT |
$HOME |
Restricts host paths for volume mounts and file copies. Paths outside this root are rejected. |
CONTAINER_MCP_CONTEXT_ROOT |
$HOME |
Restricts the build context path for build_image. Paths outside this root are rejected. |
Tool Reference
🐳 Container Lifecycle (14 tools)
| Tool | Description | Key Parameters |
|---|---|---|
list_containers |
List all containers | all, format |
run_container |
Create & run a new container | image, name, ports, env, volumes, detach, command |
stop_container |
Stop running containers | names, timeout |
start_container |
Start stopped containers | names |
delete_container |
Remove containers | names, force |
inspect_container |
Get detailed container info | name |
exec_in_container |
Execute command in container | name, command, interactive |
container_commit |
Commit container to new image | container, image, message |
copy_to_container |
Copy file/dir from host to container | hostPath, containerName, containerPath |
copy_from_container |
Copy file/dir from container to host | containerName, containerPath, hostPath |
wait_container |
Wait for container stop, get exit code | name, timeout |
rename_container |
Rename an existing container | container, newName |
pause_container |
Pause processes in containers | names |
unpause_container |
Unpause processes in containers | names |
📦 Image Management (7 tools)
| Tool | Description | Key Parameters |
|---|---|---|
list_images |
List local images | format |
pull_image |
Pull image from registry | reference |
build_image |
Build image from Dockerfile | context, tag, dockerfile, buildArgs, platform |
remove_image |
Remove images | references, force |
inspect_image |
Get detailed image info | reference |
tag_image |
Tag an existing local image | source, target |
push_image |
Push image to registry | image |
📋 Logs & Monitoring (3 tools)
| Tool | Description | Key Parameters |
|---|---|---|
get_logs |
Get container logs | name, tail, since |
get_container_stats |
Get CPU/memory/network stats | name |
get_container_processes |
List processes in container | name |
💾 Volumes (3 tools)
| Tool | Description | Key Parameters |
|---|---|---|
list_volumes |
List all volumes | format |
create_volume |
Create a new volume | name, size |
delete_volume |
Remove volumes | names, force |
🌐 Networks (3 tools)
| Tool | Description | Key Parameters |
|---|---|---|
create_network |
Create a container network | name, driver, options |
delete_network |
Remove one or more networks | networks |
list_networks |
List all networks | format |
⚙️ System (2 tools)
| Tool | Description | Key Parameters |
|---|---|---|
system_info |
Get system info & version | — |
system_prune |
Remove all unused resources | confirm (must be true) |
🤖 AI-Powered Diagnostics (2 tools)
| Tool | Description | Key Parameters |
|---|---|---|
diagnose_container |
Analyze logs & inspect data for issues | name |
explain_container |
Human-readable container summary | name |
Example Prompts
Here are natural language prompts you can use with Claude or any MCP-compatible AI:
"List all my running containers"
"Run an nginx container named web-server on port 8080"
"Why is my database container crashing?"
"Show me the logs from the api container"
"Pull the latest Ubuntu image and run a container with it"
"What's the memory usage of all running containers?"
"Explain what the postgres container is doing"
"Build a Docker image from the current directory and tag it myapp:latest"
"Stop all containers and clean up unused images"
"Diagnose why the redis container keeps restarting"
Development
Setup
git clone https://github.com/your-org/container-mcp.git
cd container-mcp
npm install
Build
npm run build
Test
npm test
npm run test:coverage
Run locally
npm run dev
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Write code and tests
- Ensure tests pass:
npm test - Ensure the build works:
npm run build - Submit a Pull Request
Code Style
- TypeScript strict mode
- ESM modules
- Prettier + ESLint for formatting
- Zod schemas for all input validation
- JSDoc comments on all exported functions
Architecture
container-mcp
├── MCP Server (stdio transport)
│ ├── Container Tools (8) ── container CLI
│ ├── Image Tools (5) ────── container CLI
│ ├── Log Tools (3) ──────── container CLI
│ ├── Volume Tools (3) ───── container CLI
│ ├── Network Tools (1) ──── container CLI
│ ├── System Tools (2) ───── container CLI
│ └── AI Tools (2) ──────── combines multiple CLI calls
│ ├── diagnose_container → logs + inspect → pattern analysis
│ └── explain_container → inspect + stats + top → summary
└── Utilities
├── CLI Executor (execa, safe args)
├── Output Parsers (JSON, table)
└── Logger (structured, stderr)
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。