Problem
arctl mcp build (v0.3.3) fails with Error: build failed: failed to detect project type: unknown project type when the project directory contains a valid pyproject.toml.
Root Cause
The bug is in internal/cli/mcp/build/build.go:
-
detectProjectType() (line 59-73) checks for the existence of pyproject.toml, go.mod, etc. If the path argument is not resolved to absolute, or if the working directory differs from the project directory, the file check fails silently and returns "unknown project type".
-
runBuild() (line 46) in internal/cli/mcp/build.go passes args[0] directly to detectProjectType() without calling filepath.Abs(). When users run arctl mcp build ./my-project from a different working directory, the relative path may not resolve correctly.
-
Error message (line 73) only says "unknown project type" without listing which files were searched, making it hard to diagnose.
Affected Version
arctl version v0.3.3 (release date: 2026-03-27)
Steps to Reproduce
arctl mcp init python my-mcp-server
cd my-mcp-server
arctl mcp build . --image my-mcp:latest
# or from parent directory:
arctl mcp build my-mcp-server --image my-mcp:latest
Expected Behavior
The command should detect pyproject.toml and successfully build the Docker image.
Suggested Fix
- Resolve
buildDirectory with filepath.Abs() in runBuild() before passing to Builder.Build().
- Improve error message in
detectProjectType() to list the files that were searched.
- Consider using
arctl.yaml (framework + language fields) for project type detection instead of file heuristics, as the main branch already does.
Additional Issue: Docker socket detection on macOS
The checkDockerAvailable() function (line 124-129) calls docker version --format '{{.Server.Version}}' which fails when Docker Desktop uses a non-default context (e.g., desktop-linux) on macOS. The socket path ~/.docker/run/docker.sock may differ from the default. Consider also checking the DOCKER_HOST environment variable.
Problem
arctl mcp build(v0.3.3) fails withError: build failed: failed to detect project type: unknown project typewhen the project directory contains a validpyproject.toml.Root Cause
The bug is in
internal/cli/mcp/build/build.go:detectProjectType()(line 59-73) checks for the existence ofpyproject.toml,go.mod, etc. If the path argument is not resolved to absolute, or if the working directory differs from the project directory, the file check fails silently and returns"unknown project type".runBuild()(line 46) ininternal/cli/mcp/build.gopassesargs[0]directly todetectProjectType()without callingfilepath.Abs(). When users runarctl mcp build ./my-projectfrom a different working directory, the relative path may not resolve correctly.Error message (line 73) only says
"unknown project type"without listing which files were searched, making it hard to diagnose.Affected Version
arctl version v0.3.3(release date: 2026-03-27)Steps to Reproduce
Expected Behavior
The command should detect
pyproject.tomland successfully build the Docker image.Suggested Fix
buildDirectorywithfilepath.Abs()inrunBuild()before passing toBuilder.Build().detectProjectType()to list the files that were searched.arctl.yaml(framework + language fields) for project type detection instead of file heuristics, as the main branch already does.Additional Issue: Docker socket detection on macOS
The
checkDockerAvailable()function (line 124-129) callsdocker version --format '{{.Server.Version}}'which fails when Docker Desktop uses a non-default context (e.g.,desktop-linux) on macOS. The socket path~/.docker/run/docker.sockmay differ from the default. Consider also checking theDOCKER_HOSTenvironment variable.