This repository was archived by the owner on Oct 28, 2025. It is now read-only.
chore(docker): factorize semgrep version #81
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
This PR makes it so that our Docker build is factorized on the version of Semgrep we use.
Why:
Previously, our base image was just a Python image with
uv, for convenience. We allowed the version of Semgrep to be decided by thesemgrepdependency installed byuv.For our purposes, however, it's actually quite important that we give people the option of using the MCP with more recent versions of Semgrep. If our Semgrep version lags behind, we will not be able to use new features introduced by the engine-dependent
semgrep mcp, which means people will not be able to try new features of our MCP as quickly.How:
This PR just makes it so our Dockerfile uses our
semgrepDocker images as a baseline, with the particular flavor left as an argument (to be used later). My ideal is that we can establish some release-specific Docker images forsemgrep-mcp, or at the very least, maintain a singlesemgrep-mcp:developimage which has all the latest features.This PR pins our version of Semgrep in the MCP to
semgrep/semgrep:latest(currently1.128.1), but lays the groundwork which allows us to buildsemgrep-mcpwith specific versions of Semgrep.Note that this PR removes
semgrepas a dependency of the MCP in terms of theuvproject. This is not strictly true, you still needsemgrepto make the MCP work, but we will simply enforce that it must exist in the Docker images (which are how people will typically interact with the MCP).Future work:
It would be cool if we could use these Docker images, which
mcp-internaldepends on, to establish adevelop.mcp.semgrep.ai/developor something which people can optionally use to get the latest features without needing a release of Semgrep.Test plan:
docker buildintodocker run -itallows me to see that I can control the output ofsemgrep --versionbased on the number we install.