MCP Container Tools
Provides tools for managing Docker containers and Docker Compose services, including reading logs with advanced filtering, inspecting container details, listing containers, and executing commands within containers.
Enables interaction with Kubernetes clusters to manage pods and deployments, providing capabilities to read logs, list pods, describe resources, fetch events, and execute commands within pods across different namespaces and contexts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Container Toolsshow me the last 50 error logs from the api pod in the production namespace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🐳 MCP Container Tools
A Model Context Protocol (MCP) server for Docker, Kubernetes, and Azure Application Insights with advanced log filtering and monitoring capabilities.
✨ Features
🐳 Docker — Container logs, inspect, exec, list containers
🐙 Docker Compose — Service logs, start/stop/restart services
☸️ Kubernetes — Pod logs, deployment logs, events, exec into pods
☁️ Azure Application Insights — Exceptions, traces, requests, metrics
🔍 Log Filtering — Filter by log level, regex patterns, exclude patterns
🌐 Remote Support — Connect to remote Docker hosts via SSH or TCP
Related MCP server: Docker MCP Server
📋 Requirements
Requirement | Version | Required For |
🐍 Python | 3.11+ | All |
🐳 Docker | Latest | Docker tools |
☸️ kubectl | Latest | Kubernetes tools |
☁️ Azure CLI | Latest | Azure tools (optional) |
🚀 Installation
📦 Quick Install (recommended)
# Basic installation
pip install mcp-container-tools
# With Azure Application Insights support
pip install mcp-container-tools[azure]🐙 Install from GitHub
# Latest version from GitHub
pip install git+https://github.com/simseksem/mcp-container-tools.git
# With Azure support
pip install "mcp-container-tools[azure] @ git+https://github.com/simseksem/mcp-container-tools.git"🔧 Install from source (for development)
git clone https://github.com/simseksem/mcp-container-tools.git
cd mcp-container-tools
pip install -e ".[all]"✅ Verify installation
mcp-server --help⚙️ Configuration
🖥️ Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"container-tools": {
"command": "/path/to/mcp-container-tools/.venv/bin/python",
"args": ["-m", "mcp_server.server"],
"env": {
"AZURE_LOG_ANALYTICS_WORKSPACE_ID": "your-workspace-id",
"AZURE_APP_INSIGHTS_RESOURCE_ID": "/subscriptions/.../resourceGroups/.../providers/microsoft.insights/components/..."
}
}
}
}💻 Claude Code
Add to ~/.claude/settings.json or create .mcp.json in your project:
{
"mcpServers": {
"container-tools": {
"command": "/path/to/mcp-container-tools/.venv/bin/python",
"args": ["-m", "mcp_server.server"]
}
}
}☁️ Azure Authentication
Azure tools use DefaultAzureCredential which supports:
Azure CLI (
az login)Environment variables
Managed Identity
Visual Studio Code
# Easiest: Login with Azure CLI
az login📖 Usage Examples
🐳 Docker
# Read container logs
docker_logs(container="my-app", tail=100)
# Read logs from last 30 minutes
docker_logs(container="my-app", since="30m")
# Filter by log level (only errors and above)
docker_logs(container="my-app", min_level="error")
# Search for patterns
docker_logs(container="my-app", pattern="timeout|connection refused")
# Exclude health checks
docker_logs(container="my-app", exclude_pattern="GET /health")
# Remote Docker host via SSH
docker_logs(container="my-app", host="ssh://user@server.com")
# List containers
docker_ps(all=True)🐙 Docker Compose
# Read service logs
compose_logs(service="api", tail=200)
# Read all services logs
compose_logs(project_dir="/path/to/project")
# Service management
compose_up(service="api", project_dir="/path/to/project")
compose_down(project_dir="/path/to/project")
compose_restart(service="api")☸️ Kubernetes
# Read pod logs
k8s_logs(pod="api-7d4b8c6f9-x2k4m", namespace="production")
# Read logs from all pods in a deployment
k8s_deployment_logs(deployment="api", namespace="production")
# Filter logs
k8s_logs(pod="api-*", min_level="warn", pattern="database")
# Use different context
k8s_logs(pod="my-pod", context="production-cluster", namespace="backend")
# List pods
k8s_pods(namespace="all", selector="app=api")
# Get events
k8s_events(namespace="production")
# Execute command in pod
k8s_exec(pod="api-xyz", command="printenv", namespace="production")☁️ Azure Application Insights
# Query exceptions from last hour
azure_exceptions(timespan="PT1H", limit=50)
# Get only critical exceptions
azure_exceptions(severity="critical", search="NullReference")
# Query application traces
azure_traces(timespan="PT1H", severity="error")
# Query HTTP requests
azure_requests(timespan="PT1H", failed_only=True)
# Get slow requests (>1 second)
azure_requests(min_duration_ms=1000, limit=20)
# Query external dependencies (SQL, HTTP, etc.)
azure_dependencies(timespan="PT1H", failed_only=True, type_filter="SQL")
# Get metrics
azure_metrics(metric_name="requests/count", timespan="P1D", interval="PT1H")
# Query availability test results
azure_availability(timespan="P1D", failed_only=True)
# Run custom Kusto query
azure_query(query="""
requests
| where success == false
| summarize count() by bin(timestamp, 1h), resultCode
| order by timestamp desc
""", timespan="P1D")🔍 Log Filtering Options
All log tools support these filtering options:
Option | Description | Example |
| Minimum log level |
|
| Regex to include |
|
| Regex to exclude |
|
| Lines around matches |
|
Supported log levels: trace → debug → info → warn → error → fatal
⏱️ Timespan Format (Azure)
Azure tools use ISO 8601 duration format:
Format | Duration |
| 1 hour |
| 30 minutes |
| 1 day |
| 7 days |
🛠️ Available Tools
🐳 Docker Tools
Tool | Description |
| 📄 Read container logs with filtering |
| 📋 List containers |
| 🔎 Get container details |
| ⚡ Execute command in container |
🐙 Docker Compose Tools
Tool | Description |
| 📄 Read service logs |
| 📋 List services |
| ▶️ Start services |
| ⏹️ Stop services |
| 🔄 Restart services |
☸️ Kubernetes Tools
Tool | Description |
| 📄 Read pod logs |
| 📚 Read deployment logs |
| 📋 List pods |
| 🔎 Describe pod |
| ⚡ Execute in pod |
| 📢 Get events |
| 🌐 List contexts |
☁️ Azure Application Insights Tools
Tool | Description |
| 🔍 Run custom Kusto queries |
| ❌ Query application exceptions |
| 📝 Query application traces |
| 🌐 Query HTTP requests |
| 🔗 Query external dependencies |
| 📊 Query metrics |
| ✅ Query availability tests |
👨💻 Development
Install dev dependencies
pip install -e ".[all]"Run tests
pytestLinting and type checking
ruff check .
mypy src/📁 Project Structure
mcp-container-tools/
├── 📂 src/mcp_server/
│ ├── 📄 __init__.py
│ ├── 📄 server.py # Main server entry point
│ ├── 📂 tools/
│ │ ├── 🐳 docker.py # Docker tools
│ │ ├── 🐙 docker_compose.py # Compose tools
│ │ ├── ☸️ kubernetes.py # K8s tools
│ │ ├── ☁️ azure_insights.py # Azure App Insights
│ │ └── 📁 file_operations.py # File tools
│ ├── 📂 resources/
│ │ ├── ⚙️ config.py # Config resources
│ │ └── 📊 data.py # Data resources
│ ├── 📂 prompts/
│ │ └── 📝 templates.py # Prompt templates
│ └── 📂 utils/
│ └── 🔍 log_filter.py # Log filtering
├── 📂 tests/
├── 📄 pyproject.toml
└── 📄 README.md🔐 Environment Variables
Variable | Description |
| Azure Log Analytics workspace ID |
| Azure Application Insights resource ID |
📄 License
MIT License - see LICENSE for details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceAn MCP server that allows managing Docker containers through natural language, enabling users to compose, introspect, and debug containers without running commands themselves.Last updated731GPL 3.0
- Alicense-qualityDmaintenanceAn MCP server that enables managing Docker containers through natural language commands, allowing users to create, list, and delete containers. It facilitates automated container orchestration and integrates with VS Code via the Cline extension.Last updated82MIT
- FlicenseDqualityDmaintenanceAn MCP server that enables agents to attach debugpy to running Python processes inside Docker containers for enhanced debugging and inspection. It provides tools for container autodiscovery, process injection, and generating breakpoint plans based on logs and metadata.Last updated8
- Alicense-qualityFmaintenanceA comprehensive MCP server that provides advanced Docker operations through a unified interface with 16 MCP tools and 25+ CLI aliases, enabling secure container lifecycle management, multi-container orchestration, registry publishing, and system maintenance.Last updated7215ISC
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
MCP server for Appcircle mobile CI/CD platform.
A MCP server built for developers enabling Git based project management with project and personal…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/simseksem/mcp-container-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server