Build and push image / build (push) Successful in 3m59s
Run supergateway on port 8080 (streamable HTTP at /mcp) next to mcpo on 8000, each spawning its own webfetch-mcp child. Supervise both under tini. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
69 lines
2.7 KiB
Docker
69 lines
2.7 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# Pinned revision of https://code.aneur.in/mirrors/webfetch-mcp (mirror of
|
|
# https://github.com/manooll/webfetch-mcp). Bump by updating this SHA once
|
|
# the mirror has synced past it; verify server.mjs still only reads
|
|
# SEARXNG_BASE / DEBUG / DETAILED_LOG from its environment before bumping.
|
|
ARG WEBFETCH_MCP_COMMIT=28135553531780c2a35c65e7c972f114f5e1baa4
|
|
|
|
# Pinned mcpo release (PyPI). Bump by checking the new version's CLI flags
|
|
# still match what entrypoint.sh assumes (--host/--port/--api-key/--).
|
|
ARG MCPO_VERSION=0.0.20
|
|
|
|
# mcpo's own pyproject.toml only requires "mcp>=1.17.0" (unbounded), but its
|
|
# lockfile shows it's built/tested against exactly this version. Pinning it
|
|
# ourselves avoids pip resolving a newer mcp SDK release whose API mcpo
|
|
# doesn't yet support (observed: mcp 2.2.0 renamed an import mcpo 0.0.20
|
|
# depends on, breaking startup). When bumping MCPO_VERSION, check the new
|
|
# release's uv.lock for its actual tested "mcp" version and update this too.
|
|
ARG MCP_SDK_VERSION=1.17.0
|
|
|
|
# Pinned supergateway release (npm). It serves a stdio MCP server as a native
|
|
# streamable-HTTP endpoint. Bump by checking the new version's CLI flags still
|
|
# match what entrypoint.sh assumes (--stdio/--outputTransport/--port/
|
|
# --healthEndpoint).
|
|
ARG SUPERGATEWAY_VERSION=4.1.0
|
|
|
|
FROM python:3.12-slim-bookworm AS vendor
|
|
ARG WEBFETCH_MCP_COMMIT
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
RUN git clone https://code.aneur.in/mirrors/webfetch-mcp.git /src \
|
|
&& cd /src \
|
|
&& git checkout "${WEBFETCH_MCP_COMMIT}"
|
|
RUN mkdir /vendored \
|
|
&& cp /src/server.mjs /src/package.json /src/package-lock.json /src/LICENSE /vendored/
|
|
|
|
FROM python:3.12-slim-bookworm
|
|
ARG MCPO_VERSION
|
|
ARG MCP_SDK_VERSION
|
|
ARG SUPERGATEWAY_VERSION
|
|
|
|
# tini is PID 1: entrypoint.sh supervises two long-running processes, so
|
|
# something needs to reap zombies and deliver signals properly.
|
|
# Node.js 22, matching the version mcpo's own official image is built and
|
|
# tested against (webfetch-mcp only requires >=18).
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
ca-certificates \
|
|
gnupg \
|
|
tini \
|
|
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
|
&& apt-get install -y --no-install-recommends nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --no-cache-dir "mcpo==${MCPO_VERSION}" "mcp==${MCP_SDK_VERSION}"
|
|
|
|
RUN npm install -g --omit=dev "supergateway@${SUPERGATEWAY_VERSION}" \
|
|
&& npm cache clean --force
|
|
|
|
COPY --from=vendor /vendored /app/webfetch-mcp
|
|
WORKDIR /app/webfetch-mcp
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
EXPOSE 8000 8080
|
|
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
|