home / mcp / mcp container tools mcp server
Provides a MCP server to read and filter container logs, Kubernetes events, and Azure telemetry across Docker, Kubernetes, and Azure Application Insights.
Configuration
View docs{
"mcpServers": {
"simseksem-mcp-container-tools": {
"command": "python",
"args": [
"-m",
"mcp_server.server"
],
"env": {
"AZURE_APP_INSIGHTS_RESOURCE_ID": "/subscriptions/.../resourceGroups/.../providers/microsoft.insights/components/...",
"AZURE_LOG_ANALYTICS_WORKSPACE_ID": "your-workspace-id"
}
}
}
}You can run an MCP server to interact with Docker, Kubernetes, and Azure Application Insights from a single, extensible toolset. It provides advanced log filtering, remote access, and a unified interface to query logs, events, and metrics across multiple environments. This guide shows you how to install, run, and use the server effectively from your workstation or CI environment.
You will run the MCP server locally or in a container and connect to it with your MCP client or scripts. Start the server with Python, then use the available tools to read logs, deploy services, query Azure Application Insights data, and filter results using log levels, patterns, and exclusions. For remote hosts, you can point your client at the server and execute commands or fetch logs as if you were directly connected.
Prerequisites: you need Python 3.11 or newer, and Docker and kubectl for full functionality. If you plan to use Azure features, ensure the Azure CLI is installed.
# Basic installation
pip install mcp-container-tools
# With Azure Application Insights support
pip install mcp-container-tools[azure]Install from GitHub if you want the latest version and optional Azure support.
# 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 work.
git clone https://github.com/simseksem/mcp-container-tools.git
cd mcp-container-tools
pip install -e ".[all]"Verify the installation and inspect available commands.
mcp-server --helpConfigure how the MCP server runs and how it authenticates with Azure if you use Azure features. The configuration supports embedding the Python runtime invoked as a module and setting environment variables for Azure services.
{
"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/..."
}
}
}
}Azure tools use DefaultAzureCredential supporting multiple login methods. The simplest approach is to log in with the Azure CLI so you can access Azure resources directly.
az loginOnce the server is running, you can use the client tools to fetch and filter logs from Docker containers, Docker Compose services, Kubernetes pods and deployments, and Azure Application Insights data. Apply min_level, pattern, and exclude_pattern filters to narrow results, and use context options to target specific clusters, namespaces, or contexts.
- Ensure you have the required tooling (Docker, kubectl) installed to access the corresponding environments.
- Use the Azure-related configuration and credentials only if you intend to query Azure Application Insights data.
Read container logs with filtering including min_level, patterns, and excludes.
List Docker containers and their statuses.
Get details for a specific container.
Execute a command inside a running container.
Read service logs from Docker Compose projects.
List services in a Docker Compose setup.
Start services defined in a Compose file.
Stop services defined in a Compose setup.
Restart services in a Compose project.
Read pod logs in a Kubernetes namespace.
Read logs for all pods in a deployment.
List pods in a namespace or cluster.
Execute commands inside a pod.
Get cluster events.
Query Azure Application Insights exceptions.
Query Azure traces.
Query Azure HTTP requests.
Query external dependencies like SQL or HTTP calls.
Query metrics from Azure Monitor.
Query Azure availability test results.
Run custom Kusto queries against Azure data.