Correction de la migration MCP - Utilisation correcte des transports

- Ajout de l'import client/transport pour accéder aux transports
- Correction de initMCPActions pour utiliser NewStreamableHTTP avec support des headers d'autorisation
- Correction de la partie STDIO pour utiliser NewStdio avec transport.NewStdio()
- Ajout de l'appel Start() sur les clients avant utilisation (requis par la nouvelle API)
- Correction des types: utilisation de *client.Client au lieu de client.MCPClient
- La migration corrige l'erreur 'transport not started yet' observée dans les logs
This commit is contained in:
2025-06-13 22:42:59 +02:00
parent 863c6f3dcb
commit 6c6f6fe35a
7 changed files with 694 additions and 213 deletions

View File

@@ -25,7 +25,41 @@ FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies
RUN apt-get update && apt-get install -y ca-certificates tzdata docker.io bash wget curl
RUN apt-get update && apt-get install -y \
ca-certificates \
tzdata \
docker.io \
bash \
wget \
curl \
jq \
python3 \
unzip \
python3-pip \
python3-venv \
pipx \
nodejs \
npm \
netcat-openbsd \
dnsutils \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app/data/.npm
RUN mkdir -p /app/data/.cache
RUN mkdir -p /app/data/.local
ENV NPM_CONFIG_CACHE=/app/data/.npm
ENV UV_CACHE_DIR=/app/data/.cache/uv
# Install uv
ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
RUN ln -sf /root/.local/bin/uv /usr/local/bin/uv
RUN npm install -g bun
RUN uv tool install git+https://github.com/sparfenyuk/mcp-proxy
# Create non-root user
#RUN adduser -D -g '' appuser
@@ -46,4 +80,4 @@ EXPOSE 8080
ENTRYPOINT ["/app/mcpbox"]
# Default command
CMD ["-addr", ":8080"]
CMD ["-addr", ":8080"]