feat/infrahub-mcp #6
30
images/infrahub-mcp/Dockerfile
Normal file
30
images/infrahub-mcp/Dockerfile
Normal file
@@ -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"]
|
||||||
52
images/infrahub-mcp/README.md
Normal file
52
images/infrahub-mcp/README.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# infrahub-mcp
|
||||||
|
|
||||||
|
Docker image for the Infrahub MCP server ([OpsMill](https://github.com/opsmill/infrahub-mcp-server)).
|
||||||
|
|
||||||
|
Packages the infrahub-mcp-server into a ready-to-use container,
|
||||||
|
running the server in SSE mode on port 8001.
|
||||||
|
|
||||||
|
## Environment variables
|
||||||
|
|
||||||
|
| Variable | Description | Default |
|
||||||
|
|----------------------|----------------------------------|--------------------------|
|
||||||
|
| `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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t gitea.arnodo.fr/damien/infrahub-mcp:latest images/infrahub-mcp/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d --name infrahub-mcp \
|
||||||
|
-e INFRAHUB_ADDRESS=http://infrahub.local:8000 \
|
||||||
|
-e INFRAHUB_API_TOKEN=my-api-token \
|
||||||
|
-p 8001:8001 \
|
||||||
|
gitea.arnodo.fr/damien/infrahub-mcp:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## MCP client configuration (Claude Desktop, Cursor, etc.)
|
||||||
|
|
||||||
|
Point your client to the container's SSE endpoint:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"infrahub_mcp": {
|
||||||
|
"url": "http://localhost:8001/sse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user