Docker
Run azops-mcp with Docker Compose.
Overview
The project includes a docker-compose.yml with the MCP server as a Docker service:
| Service | Type | Description |
|---|---|---|
mcp-server | Interactive (stdio) | The MCP server, run on demand |
The MCP server uses stdio transport, so it cannot run as a long-lived daemon — it is spawned on demand with docker compose run.
Prerequisites
- A
.envfile in the project root (copy from.env.example) - Docker (or Podman) with Compose v2
Quick Start
# 1. Clone and enter the project
git clone https://github.com/artemkozlenkov/azops-mcp.git
cd azops-mcp
# 2. Create your .env
cp .env.example .env
# Edit .env with your Azure credentials
# 3. Build the image
docker compose build
# 4. Run the MCP server interactively
docker compose run --rm mcp-serverRunning the MCP Server
The MCP server uses stdio transport, so it must be started with docker compose run:
docker compose run --rm mcp-serverThis removes the container when done, runs interactively with stdin/stdout attached, and reads Azure credentials from .env.
Note: docker compose up does not start the MCP server. Use docker compose run instead.
Connecting an AI Client to the Docker MCP Server
Cursor
{
"mcpServers": {
"azops-mcp": {
"command": "docker",
"args": [
"compose", "-f", "/full/path/to/azops-mcp/docker-compose.yml",
"run", "--rm", "-T", "mcp-server"
]
}
}
}The -T flag disables pseudo-TTY allocation, which is needed for stdio transport with some clients.
Claude Desktop
{
"mcpServers": {
"azops-mcp": {
"command": "docker",
"args": [
"compose", "-f", "/full/path/to/azops-mcp/docker-compose.yml",
"run", "--rm", "-T", "mcp-server"
]
}
}
}Building Images
docker compose buildThe MCP server image uses uv for fast dependency installation.
Environment Variables in Docker
The mcp-server service loads your .env file via the env_file directive:
| Variable | Source |
|---|---|
AZURE_SUBSCRIPTION_ID | From .env |
AZURE_TENANT_ID | From .env |
AZURE_CLIENT_ID | From .env |
AZURE_CLIENT_SECRET | From .env |
AZURE_DEFAULT_LOCATION | From .env |
LOG_LEVEL | From .env |
Troubleshooting
MCP server exits immediately
The MCP server expects stdio input. If run without an MCP client attached, it will exit. Use docker compose run (not docker compose up) and connect an AI client.
Azure authentication errors
Make sure your .env file has valid Azure credentials:
# Check your credentials work locally first
az login
az account showIf using a Service Principal, verify all three variables are set: AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET.