Az
azops-mcp

Docker

Run azops-mcp with Docker Compose.


Overview

The project includes a docker-compose.yml with the MCP server as a Docker service:

ServiceTypeDescription
mcp-serverInteractive (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 .env file 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-server

Running the MCP Server

The MCP server uses stdio transport, so it must be started with docker compose run:

docker compose run --rm mcp-server

This 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

~/.cursor/mcp.jsonjson
{
  "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

claude_desktop_config.jsonjson
{
  "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 build

The 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:

VariableSource
AZURE_SUBSCRIPTION_IDFrom .env
AZURE_TENANT_IDFrom .env
AZURE_CLIENT_IDFrom .env
AZURE_CLIENT_SECRETFrom .env
AZURE_DEFAULT_LOCATIONFrom .env
LOG_LEVELFrom .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 show

If using a Service Principal, verify all three variables are set: AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET.