Library core, conformance test, and cross-platform CI - #1
Merged
Conversation
Scaffold the stackql_mcp Hex package: the embedded StackQL MCP server for Gleam / BEAM. Erlang target only for v1 (the strategic thesis is the BEAM; the JS target would just be a worse npm wrapper). Library core: - platform: shared cache path + platform-key resolution (the cross-family contract: ~/.stackql/mcp-server-bin/<version>/<platform-key>/) - launch: canonical, cwd-independent argv (--approot is mandatory) - mode: ReadOnly default; safe/delete_safe/full_access are explicit opt-ins - auth: provider auth descriptors incl. the github null_auth fixture - stackql_mcp: Config/default_config, resolve_command, start/list_tools/ call_tool/stop, and child_spec for the BEAM-native supervised path - mcp_client (0.1.x) owns the subprocess and JSON-RPC framing; this module builds the argv and wires the session Tests (gleeunit): - unit: launch-arg shape, cache-path layout, platform keys, resolve_command env precedence, auth rendering - all run with no stackql binary present - conformance: the family handshake (initialize -> tools/list -> pull github null_auth -> list_services), self-gated on STACKQL_MCP_BIN so it logs and passes when no binary is available and runs for real in CI CI: GitHub Actions matrix (ubuntu + macos + windows) running gleam format --check, gleam check, gleam test. Triggers on pull_request to main (PR raise/update) and push to main (merge). Windows is in the matrix deliberately - Erlang ports there have sharp edges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
First CI run surfaced two issues:
- mcp_client 0.1.x requires gleam_json >= 3.0.0; the previous < 3.0.0 pin
made dependency resolution unsatisfiable. Track the 3.x major.
- erlef/setup-beam@v1 could not map the new win25-vs2026 runner image
("Tried to map a target OS from env. variable 'ImageOS'... but failed").
Pin to @v1.24.0, which supports win25.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Second CI run surfaced: - gleam format --check failed: canonicalize all src/test with gleam format. - setup-beam still could not map the windows-latest ImageOS (win25-vs2026). Pin the Windows matrix leg to windows-2022 (ImageOS win22), which the action maps. Revisit when setup-beam supports win25. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Third CI run surfaced: - Type check failed: `mcp_client.ServerConfig is a type constructor, it cannot be used as a value`. The value constructor lives in mcp_client/manager (mcp_client only re-exports the type alias). Construct manager.ServerConfig with manager.NoRetry. - Windows format --check failed because the runner checks out CRLF (core.autocrlf=true) while gleam format emits LF. Add .gitattributes pinning .gleam/.erl/.toml/.yml/.md to eol=lf so the check is stable cross-platform. Verified locally with gleam 1.17.0: gleam format --check passes; deps resolve to gleam_json 3.1.0 / mcp_client 0.1.0 / envoy 1.2.0. (gleam check needs Erlang, which is not installed locally - CI compiles.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gleam generated the lockfile pinning the resolved versions (gleam_json 3.1.0, mcp_client 0.1.0, envoy 1.2.0, gleam_stdlib 1.0.3, etc.). The file itself instructs that it be checked in; doing so keeps CI from re-resolving and matches the family stance of pinning every dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Scaffolds the
stackql_mcpHex package (the Gleam / BEAM member of the StackQL embedded-MCP family) and stands up CI.What this adds
Library core (Erlang target only for v1 - the strategic thesis is the BEAM):
platform- shared family cache path + platform-key resolution (~/.stackql/mcp-server-bin/<version>/<platform-key>/)launch- canonical, cwd-independent argv (mandatory--approot)mode-ReadOnlydefault;safe/delete_safe/full_accessare explicit opt-insauth- provider auth descriptors incl. thegithubnull_authfixturestackql_mcp-Config/default_config,resolve_command,start/list_tools/call_tool/stop, andchild_specfor the BEAM-native supervised path (mcp_client0.1.x owns the subprocess and JSON-RPC framing)Tests (gleeunit):
resolve_commandenv precedence, auth rendering - all run with no stackql binary presentinitialize->tools/list->pull github null_auth->list_services), self-gated onSTACKQL_MCP_BINso it logs+passes with no binary and runs for real in CICI: GitHub Actions matrix (ubuntu + macos + windows) running
gleam format --check,gleam check,gleam test. Triggers onpull_requesttomain(this PR) andpushtomain(merge). Windows is in the matrix deliberately - Erlang ports there have sharp edges.Notes
pipewatchdemo and the extracted minimal Anthropic client are follow-up milestones.[Generated with Claude Code]