Skip to content

Integrations

AEndrix edited this page May 20, 2026 · 3 revisions

Integrations

graft ships adapters for two families of AI tooling.

Family 1 — CLI assistants (Skills, optional Hooks)

Targets: Claude Code, Codex, Open Code, Gemini CLI.

What ships

Six skills (slash commands the model can invoke):

Skill Purpose
/graft Master skill — model decides search/save based on context.
/graft-init One-time configurator: writes a <!-- graft:start --> block in CLAUDE.md.
/recall Escalating search (query → retrieve → explore).
/memoryze Distill the conversation into 1–5 nodes and save them.
/learn Batch ingest from an external corpus (folder, docs tree).
/memory-audit Health-check the graph (hit rate, hoarding ratio, duplicates).

Three hooks (deterministic, no model decision needed):

Hook Trigger What it does
query_inject.js UserPromptSubmit Runs graft query on the user's message; if STRONG, injects the cached answer as context.
mark_candidate.js PostToolUse Flags interesting tool results as save candidates.
propose_memoryze.js Stop If the session solved a non-trivial problem, proposes /memoryze.

Setup

graft setup claudecode   # ~/.claude/skills/
graft setup codex        # ~/.codex/skills/
graft setup opencode     # ~/.config/opencode/skills/

The command is idempotent - re-run it to refresh after upgrading graft. It installs only the skills package; hooks, agent settings, and AGENTS.md remain manual wiring.

Customizing the cache prompt

Skills live in ~/.claude/skills/graft/ after setup. Edit SKILL.md to tune wording.

Family 2 — Chat clients (MCP)

Targets: Claude Desktop, ChatGPT, any MCP-compatible client.

Modes

  • Stdio — local dev. Best for personal use, single user.
  • HTTP + OAuth — production. Use the OAuth gateway in integrations/mcp-server/ to expose graft to web-hosted clients.

Tools exposed

Scope Tool Calls
graft:read graft_query GET /v1/match
graft:read graft_retrieve GET /v1/search
graft:read graft_explore GET /v1/explore
graft:read graft_classify GET /v1/classify
graft:read graft_get GET /v1/nodes/{id}
graft:read graft_stats local
graft:read graft_analytics local
graft:write graft_insert POST /v1/insert
graft:admin graft_delete DELETE /v1/nodes/{id}

OAuth scope mapping is enforced at the gateway, not in graft itself. The gateway terminates HTTPS, validates the bearer, mints a per-request graft token if needed.

Setup

See integrations/mcp-server/README.md for end-to-end instructions on running the stdio server locally and the HTTP+OAuth gateway behind a reverse proxy.

The pattern, in one diagram

┌─────────────────────────────┐
│  Claude Code / Codex / ...  │  ← Skills/Hooks family
└──────────────┬──────────────┘
               │
               │ subprocess: graft query / insert / retrieve / ...
               ▼
┌─────────────────────────────┐         ┌──────────────────────────────┐
│         graftd              │ ◀────── │  MCP gateway (HTTP + OAuth)  │
│  AF_UNIX + optional HTTP    │         │  optional, production only    │
└─────────────────────────────┘         └──────────────┬───────────────┘
                                                       │
                                       Claude Desktop / ChatGPT ← MCP family

Clone this wiki locally