My container build of the https://codeberg.org/goern/forgejo-mcp which is intended to include no fixable critical/high vulnerabilities.
  • Dockerfile 100%
Find a file
Paul Git ebadf8bbe8
All checks were successful
Build / Check for new version (push) Successful in 6s
Build / Build, Scan, and Push Docker Image (push) Successful in 2m59s
Build / Notify (push) Successful in 5s
Patch golang.org/x/text to v0.39.0 (fixes CVE-2026-56852)
Added go get golang.org/x/text@v0.39.0 to the build process to address
the HIGH severity vulnerability CVE-2026-56852 in the norm.Iter function.
2026-07-30 21:14:59 +08:00
.forgejo/workflows Fix shell syntax error in workflow version resolution 2026-07-30 21:06:28 +08:00
.env.example Migrate from local shell scripts to Forgejo Actions CI pipeline 2026-06-02 13:05:05 +07:00
.gitignore Refactor build and scan scripts to follow project style guide 2026-05-21 22:33:01 +08:00
.gitmodules Update source to git.b4mad.industries and update distroless base image 2026-07-30 21:03:02 +08:00
.yamllint.yml Harden CI: split into lint/build/notify jobs and fix Forgejo contexts 2026-06-07 14:15:08 +07:00
AGENTS.md Update source to git.b4mad.industries and update distroless base image 2026-07-30 21:03:02 +08:00
Containerfile Patch golang.org/x/text to v0.39.0 (fixes CVE-2026-56852) 2026-07-30 21:14:59 +08:00
docker-compose.yaml Update source to git.b4mad.industries and update distroless base image 2026-07-30 21:03:02 +08:00
LICENSE Add container build tooling for forgejo-mcp 2026-05-21 21:42:52 +08:00
README.md Update source to git.b4mad.industries and update distroless base image 2026-07-30 21:03:02 +08:00

foregejo-mcp-container

Container image for forgejo-mcp, a Model Context Protocol (MCP) server for Forgejo.

Overview

This repository contains the Containerfile and CI pipeline to build, scan, and publish a container image that packages the upstream forgejo-mcp binary. The upstream source is compiled inside the container build using a current Go toolchain — no local Go installation is required.

Build pipeline

Builds are handled by the Forgejo Actions workflow at .forgejo/workflows/build.yml. The pipeline runs on every push and can also be triggered manually from the Forgejo UI.

What the pipeline does

  1. Lint — runs bash -n and shellcheck against any shell scripts in the repository.
  2. Resolve version — auto-detects the latest forgejo-mcp release from the Forgejo API. A specific release can be pinned when triggering the workflow manually, which is useful for reproducible builds.
  3. Build — compiles the upstream source inside a multi-stage container build and loads the image into the local Docker daemon. BuildKit layer caching keeps repeat builds fast.
  4. Scan — runs a Trivy vulnerability scan against the locally loaded image. The pipeline fails here if any HIGH or CRITICAL findings are present; nothing is pushed to the registry until the image is clean.
  5. Push — pushes the image to code.paulg.it/paulgit/forgejo-mcp on merges to main only. Auto-detected builds receive both a versioned tag and :latest; manually pinned builds receive a versioned tag only.

Containerfile

Two-stage build:

  1. Build stage — downloads the forgejo-mcp source archive for the target release, compiles it with Go, and applies any dependency patches needed to address known CVEs.
  2. Final stage — copies the compiled binary into a minimal distroless image.

Running the MCP server

Copy .env.example to .env, fill in your Forgejo instance URL and access token, then start the server in stdio mode:

cp .env.example .env
docker compose run --rm forgejo-mcp

To wire the server into an MCP client such as Claude Desktop, point it at the Compose stack rather than a URL:

{
  "mcpServers": {
    "forgejo": {
      "command": "docker",
      "args": [
        "compose",
        "-f", "/absolute/path/to/docker-compose.yaml",
        "run", "--rm", "forgejo-mcp"
      ]
    }
  }
}

Prerequisites

  • Docker with Buildx (local use)
  • A Forgejo personal access token with repo and issue scopes