From 10ed48d24d5e68b8e31cccba5cfcc8a92303df4f Mon Sep 17 00:00:00 2001 From: Damien Arnodo Date: Sun, 15 Mar 2026 09:37:46 +0000 Subject: [PATCH 1/3] feat: add infrahub-mcp Dockerfile Packages the OpsMill infrahub-mcp-server into a Docker container running fastmcp in SSE mode on port 8001. --- images/infrahub-mcp/Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 images/infrahub-mcp/Dockerfile diff --git a/images/infrahub-mcp/Dockerfile b/images/infrahub-mcp/Dockerfile new file mode 100644 index 0000000..90c2aee --- /dev/null +++ b/images/infrahub-mcp/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3.13-slim + +# Dépendances système pour uv et build éventuel de wheels +RUN apt-get update && \ + apt-get install -y --no-install-recommends git ca-certificates curl && \ + rm -rf /var/lib/apt/lists/* + +# Installer uv +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv + +# Cloner le repo MCP server upstream +ARG INFRAHUB_MCP_VERSION=main +RUN git clone --depth 1 --branch ${INFRAHUB_MCP_VERSION} \ + https://github.com/opsmill/infrahub-mcp-server.git /app + +WORKDIR /app + +# Installer les dépendances Python via uv +RUN uv sync --frozen --no-dev + +# Variables d'environnement par défaut +ENV INFRAHUB_ADDRESS=http://localhost:8000 +ENV INFRAHUB_API_TOKEN="" +ENV MCP_HOST=0.0.0.0 +ENV MCP_PORT=8001 + +EXPOSE 8001 + +# Lancer le serveur MCP en mode SSE (accessible via réseau) +ENTRYPOINT ["uv", "run", "fastmcp", "run", "src/infrahub_mcp/server.py:mcp", "--transport", "sse"] From b992e5756090770349e9f02d7f39078cb56bc28a Mon Sep 17 00:00:00 2001 From: Damien Arnodo Date: Sun, 15 Mar 2026 09:37:58 +0000 Subject: [PATCH 2/3] docs: add README for infrahub-mcp image --- images/infrahub-mcp/README.md | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 images/infrahub-mcp/README.md diff --git a/images/infrahub-mcp/README.md b/images/infrahub-mcp/README.md new file mode 100644 index 0000000..3fd5122 --- /dev/null +++ b/images/infrahub-mcp/README.md @@ -0,0 +1,52 @@ +# infrahub-mcp + +Image Docker pour le serveur MCP Infrahub ([OpsMill](https://github.com/opsmill/infrahub-mcp-server)). + +Empaquette le serveur infrahub-mcp dans un conteneur prêt à l'emploi, +exposant le serveur en mode SSE sur le port 8001. + +## Variables d'environnement + +| Variable | Description | Default | +|----------------------|----------------------------------|--------------------------| +| `INFRAHUB_ADDRESS` | URL de l'instance Infrahub | `http://localhost:8000` | +| `INFRAHUB_API_TOKEN` | Token API Infrahub | (vide) | +| `MCP_HOST` | Adresse d'écoute | `0.0.0.0` | +| `MCP_PORT` | Port d'écoute | `8001` | + +## Build + +```bash +docker build -t gitea.arnodo.fr/damien/infrahub-mcp:latest images/infrahub-mcp/ +``` + +### Avec une version spécifique + +```bash +docker build --build-arg INFRAHUB_MCP_VERSION=v1.0.0 \ + -t gitea.arnodo.fr/damien/infrahub-mcp:v1.0.0 images/infrahub-mcp/ +``` + +## Utilisation + +```bash +docker run -d --name infrahub-mcp \ + -e INFRAHUB_ADDRESS=http://infrahub.local:8000 \ + -e INFRAHUB_API_TOKEN=mon-token-api \ + -p 8001:8001 \ + gitea.arnodo.fr/damien/infrahub-mcp:latest +``` + +## Configuration MCP client (Claude Desktop, Cursor, etc.) + +Pointer le client vers le endpoint SSE du conteneur : + +```json +{ + "mcpServers": { + "infrahub_mcp": { + "url": "http://localhost:8001/sse" + } + } +} +``` From 9a007ddf69c9aa51b3e100ebbfc8cdcf026392d5 Mon Sep 17 00:00:00 2001 From: Damien Arnodo Date: Sun, 15 Mar 2026 10:06:30 +0000 Subject: [PATCH 3/3] docs: rewrite README in English --- images/infrahub-mcp/README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/images/infrahub-mcp/README.md b/images/infrahub-mcp/README.md index 3fd5122..c9b7211 100644 --- a/images/infrahub-mcp/README.md +++ b/images/infrahub-mcp/README.md @@ -1,18 +1,18 @@ # infrahub-mcp -Image Docker pour le serveur MCP Infrahub ([OpsMill](https://github.com/opsmill/infrahub-mcp-server)). +Docker image for the Infrahub MCP server ([OpsMill](https://github.com/opsmill/infrahub-mcp-server)). -Empaquette le serveur infrahub-mcp dans un conteneur prêt à l'emploi, -exposant le serveur en mode SSE sur le port 8001. +Packages the infrahub-mcp-server into a ready-to-use container, +running the server in SSE mode on port 8001. -## Variables d'environnement +## Environment variables | Variable | Description | Default | |----------------------|----------------------------------|--------------------------| -| `INFRAHUB_ADDRESS` | URL de l'instance Infrahub | `http://localhost:8000` | -| `INFRAHUB_API_TOKEN` | Token API Infrahub | (vide) | -| `MCP_HOST` | Adresse d'écoute | `0.0.0.0` | -| `MCP_PORT` | Port d'écoute | `8001` | +| `INFRAHUB_ADDRESS` | Infrahub instance URL | `http://localhost:8000` | +| `INFRAHUB_API_TOKEN` | Infrahub API token | (empty) | +| `MCP_HOST` | Listen address | `0.0.0.0` | +| `MCP_PORT` | Listen port | `8001` | ## Build @@ -20,26 +20,26 @@ exposant le serveur en mode SSE sur le port 8001. docker build -t gitea.arnodo.fr/damien/infrahub-mcp:latest images/infrahub-mcp/ ``` -### Avec une version spécifique +### Pin a specific upstream version ```bash docker build --build-arg INFRAHUB_MCP_VERSION=v1.0.0 \ -t gitea.arnodo.fr/damien/infrahub-mcp:v1.0.0 images/infrahub-mcp/ ``` -## Utilisation +## Usage ```bash docker run -d --name infrahub-mcp \ -e INFRAHUB_ADDRESS=http://infrahub.local:8000 \ - -e INFRAHUB_API_TOKEN=mon-token-api \ + -e INFRAHUB_API_TOKEN=my-api-token \ -p 8001:8001 \ gitea.arnodo.fr/damien/infrahub-mcp:latest ``` -## Configuration MCP client (Claude Desktop, Cursor, etc.) +## MCP client configuration (Claude Desktop, Cursor, etc.) -Pointer le client vers le endpoint SSE du conteneur : +Point your client to the container's SSE endpoint: ```json {