Wraps the official gitea-mcp server (binary copied from docker.gitea.com/gitea-mcp-server:1.7.0) and serves it two ways from one container: - :8000 mcpo (OpenAPI) for Open WebUI, using the container's service token and guarded by MCPO_API_KEY. - :8080 native streamable-HTTP MCP at /mcp for coding agents, with the service token stripped so each client must send its own Gitea token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Pinned release of the official Gitea MCP server
|
||||
# (https://gitea.com/gitea/gitea-mcp), taken from its published image rather
|
||||
# than built from source. Note the registry's tags have no "v" prefix. Bump
|
||||
# by checking the new release's `gitea-mcp --help` still accepts the flags
|
||||
# and env vars entrypoint.sh relies on (-t stdio|http, -p, GITEA_HOST,
|
||||
# GITEA_ACCESS_TOKEN[_FILE], MCP_MODE).
|
||||
ARG GITEA_MCP_VERSION=1.7.0
|
||||
|
||||
# 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
|
||||
|
||||
FROM docker.gitea.com/gitea-mcp-server:${GITEA_MCP_VERSION} AS gitea-mcp
|
||||
|
||||
FROM python:3.12-slim-bookworm
|
||||
ARG MCPO_VERSION
|
||||
ARG MCP_SDK_VERSION
|
||||
|
||||
# tini as PID 1: entrypoint.sh supervises two long-running processes, so
|
||||
# something needs to reap zombies and deliver signals properly.
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends tini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --no-cache-dir "mcpo==${MCPO_VERSION}" "mcp==${MCP_SDK_VERSION}"
|
||||
|
||||
# gitea-mcp is a static Go binary (CGO_ENABLED=0), so it runs fine outside
|
||||
# its distroless origin image.
|
||||
COPY --from=gitea-mcp /app/gitea-mcp /usr/local/bin/gitea-mcp
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
RUN useradd --system --no-create-home --shell /usr/sbin/nologin app
|
||||
USER app
|
||||
|
||||
EXPOSE 8000 8080
|
||||
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user