Skip to content

context-graph: single-command installer for Claude Code - #296

Merged
antejavor merged 3 commits into
mainfrom
context-graph-single-command-install
Aug 18, 2026
Merged

context-graph: single-command installer for Claude Code#296
antejavor merged 3 commits into
mainfrom
context-graph-single-command-install

Conversation

@antejavor

Copy link
Copy Markdown
Contributor

Summary

memgraph-platform PR #110's "wire it into a real harness" snippet (uv tool install + agent-context-graph bootstrap + config set identity.user_id) looks complete — doctor comes back all green — but it's missing the one step that actually wires hooks into Claude Code: claude plugin marketplace add + claude plugin install. Without it, the CLI is installed and Memgraph is reachable, but Claude Code never learns the plugin exists, so no real session writes anything.

  • context-graph/scripts/install.sh (new) — one idempotent script: starts a local Memgraph if none is reachable, registers the memgraph/ai-toolkit marketplace, installs the context-graph plugin (skipping steps already done), installs agent-context-graph with all three connectors, sets identity (git config user.name fallback), and verifies with doctor.
  • context-graph/README.md — leads with the one-liner; the old 5-step manual flow is preserved in a collapsed <details> for people who want to see/run it by hand, plus a note that Codex has no non-interactive plugin-install step today so it isn't covered end-to-end.
  • .github/workflows/test-context-graph-install.yaml (new) — manual-dispatch job that installs the Claude Code CLI and runs install.sh for real against the published marketplace/plugin (no ANTHROPIC_API_KEY needed — plugin management and the bootstrap hook smoke test are both local/no-LLM).

Bug found while testing

The initial version of install.sh gated "Memgraph is ready" on a plain TCP-accept check. That's not sufficient for the MAGE image: the socket opens well before Memgraph can actually complete a Bolt handshake (it's loading heavier ML query-module deps first), so the immediately-following bootstrap/doctor step failed with a real Could not connect to Memgraph database error. Fixed by gating readiness on an actual mgconsole query via docker exec, matching the pattern skills-graph's and actions-graph's own CI jobs already use for this same image.

Test plan

  • Ran install.sh end-to-end locally in a sandboxed $HOME/$CLAUDE_CONFIG_DIR (so it wouldn't touch my real Claude Code config): cold start (no Memgraph, no marketplace, no plugin) — hit the TCP-vs-Bolt-ready race above, fixed it, reran clean: every doctor line OK (uv, memgraph, agent-context-graph, all three connectors, runtime:claude-code strict hook smoke).
  • Reran a second time to confirm the idempotent "already registered" / "already installed" branches for the marketplace and plugin steps.
  • bash -n clean.
  • Not yet run in CI — the new test-context-graph-install.yaml workflow is workflow_dispatch-only (mirrors test-live-graph-model.yaml's convention: real external state, not something to run on every push); trigger it manually to verify on a fresh runner.

The Claude Code plugin registration step (claude plugin marketplace add +
claude plugin install) is what actually wires hooks into Claude Code --
running `agent-context-graph bootstrap` alone does not, even though its
`doctor` check comes back all green. That gap made the memgraph-platform
ai-memory.sh demo's "wire it into a real harness" snippet look complete
without actually capturing anything.

install.sh folds the whole flow (start Memgraph if none is reachable,
register the marketplace, install the plugin, install the CLI with all
three connectors, set identity, verify with doctor) into one idempotent
script. Verified locally end-to-end in a sandboxed $HOME/$CLAUDE_CONFIG_DIR
(cold start and already-installed paths) and added a manual-dispatch CI
job that runs it for real against the published marketplace/plugin.

Along the way, fixed a real readiness race the local run surfaced: a plain
TCP-accept check declares the MAGE image ready well before it can actually
serve a Bolt handshake, so the immediately-following bootstrap/doctor step
failed with a real connection error. Gated readiness on an actual mgconsole
query instead, matching the pattern skills-graph/actions-graph's own CI
jobs already use for the same image.
Turns out the docs' claim that Codex has "no non-interactive plugin-install
step" was stale: codex-cli 0.147.0 has `codex plugin add <plugin>@<marketplace>`,
which installs *and* enables the plugin in one non-interactive call (no auth
needed, verified locally with CODEX_HOME sandboxed and no OPENAI_API_KEY set,
same as the Claude Code path). Fixed that claim in the two READMEs that made
it and in the plugin's own README.

install.sh now branches on CONTEXT_GRAPH_RUNTIME (claude-code, the default,
or codex) for the marketplace/plugin step; the rest of the script (Memgraph,
uv, agent-context-graph bootstrap/doctor) was already runtime-agnostic.
Verified both runtimes end-to-end in isolated HOME/CLAUDE_CONFIG_DIR/
CODEX_HOME sandboxes, plus a regression run of the default claude-code path.

CI: test-context-graph-install.yaml now matrixes over both runtimes,
installing @anthropic-ai/claude-code or @openai/codex per leg. OPENAI_API_KEY
is wired in for the codex leg (already an available repo secret) even though
it isn't actually required -- doctor's hook smoke test calls the runtime
adapter in-process rather than shelling out to claude/codex, so it never
touches a model either way.
@antejavor
antejavor merged commit 2c13dc3 into main Aug 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant