chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Glama MCP directory (glama.ai) check image — NOT required to run the tool.
|
||||
#
|
||||
# codebase-memory-mcp needs NO Docker to run. This image exists only so Glama
|
||||
# can build a sandbox, launch the stdio MCP server, and run its introspection
|
||||
# checks, which power the directory's score badge. The same image is exercised
|
||||
# locally and in CI by pkg/glama/verify.sh to guard against drift.
|
||||
#
|
||||
# We pull the "-portable" release asset, which is fully statically linked
|
||||
# (gcc -static) — unlike the standard asset, which dynamically links glibc/
|
||||
# libstdc++ and would fail on an older base. Because it's static, the runtime
|
||||
# base image is arbitrary. TARGETARCH is amd64 / arm64, matching the asset names.
|
||||
|
||||
FROM debian:bookworm-slim AS fetch
|
||||
ARG TARGETARCH
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl ca-certificates \
|
||||
&& curl -fsSL "https://github.com/DeusData/codebase-memory-mcp/releases/latest/download/codebase-memory-mcp-linux-${TARGETARCH}-portable.tar.gz" \
|
||||
| tar -xz -C /tmp codebase-memory-mcp LICENSE THIRD_PARTY_NOTICES.md \
|
||||
&& chmod +x /tmp/codebase-memory-mcp \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=fetch /tmp/codebase-memory-mcp /usr/local/bin/codebase-memory-mcp
|
||||
COPY --from=fetch /tmp/LICENSE /tmp/THIRD_PARTY_NOTICES.md /usr/share/doc/codebase-memory-mcp/
|
||||
ENV CBM_CACHE_DIR=/tmp/cbm
|
||||
ENTRYPOINT ["codebase-memory-mcp"]
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the Glama check image and confirm the MCP stdio server starts and
|
||||
# answers initialize + tools/list with no project indexed — exactly what
|
||||
# Glama's directory check does. Used locally and by the CI smoke suite.
|
||||
#
|
||||
# Env:
|
||||
# IMAGE image tag to build (default: cbm-glama-check)
|
||||
# DOCKER_BUILD_ARGS extra args for `docker build` (e.g. --platform linux/amd64)
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE="${IMAGE:-cbm-glama-check}"
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
run_with_timeout() {
|
||||
local t="$1"; shift
|
||||
if command -v timeout >/dev/null 2>&1; then timeout "$t" "$@"
|
||||
elif command -v gtimeout >/dev/null 2>&1; then gtimeout "$t" "$@"
|
||||
else "$@"; fi
|
||||
}
|
||||
|
||||
echo "==> building ${IMAGE} (${DIR}/Dockerfile)"
|
||||
# shellcheck disable=SC2086
|
||||
docker build ${DOCKER_BUILD_ARGS:-} -f "${DIR}/Dockerfile" -t "${IMAGE}" "${DIR}"
|
||||
|
||||
echo "==> MCP introspection handshake (initialize -> initialized -> tools/list)"
|
||||
REQ="$(printf '%s\n%s\n%s\n' \
|
||||
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"glama-verify","version":"1"}}}' \
|
||||
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
|
||||
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}')"
|
||||
OUT="$(printf '%s' "${REQ}" | run_with_timeout 60 docker run -i --rm "${IMAGE}" || true)"
|
||||
|
||||
printf '%s\n' "${OUT}"
|
||||
|
||||
echo "==> assertions"
|
||||
printf '%s' "${OUT}" | grep -q '"result"' || { echo "FAIL: no JSON-RPC result (server did not respond)"; exit 1; }
|
||||
printf '%s' "${OUT}" | grep -q 'search_graph' || { echo "FAIL: tools/list missing expected tool 'search_graph'"; exit 1; }
|
||||
COUNT="$(printf '%s' "${OUT}" | grep -o '"name"' | wc -l | tr -d ' ')"
|
||||
echo "PASS: server started and introspected; ~${COUNT} name entries (>=14 tools expected)"
|
||||
Reference in New Issue
Block a user