LoreKitLoreKit docs

Remote storage

Sync lore to the hosted LoreKit MCP server so your memories are available on every machine, from every agent, without any extra setup on each device.

Tip:

You can use the hosted instance at lorekit.io or self-host your own. This tutorial uses the hosted instance. For self-hosting see the Installation Guide.

Generate an API token

Go to Settings → API keys and click Generate new token. Enter a name (e.g. claude-local, ci-prod) and choose a permission tier:

  • lk_rw_… — read + write (agents that learn)
  • lk_ro_… — read only (CI context injection)
  • lk_wo_… — write only (one-way memory feeders)

The token is shown once only — copy it before closing the modal.

Point your agent at the MCP server

The fastest path is npx @lorekit/cli install — it scaffolds the skills, wires the MCP server, and installs the lifecycle hooks in one command. Or add the endpoint manually to your agent's MCP config:

// .mcp.json (Claude Code / Cursor / opencode — project-local)
{
  "mcpServers": {
    "lorekit": {
      "command": "npx",
      "args": ["-y", "mcp-remote",
               "https://pqokxlhvnosogizsjztg.supabase.co/functions/v1/mcp",
               "--header", "Authorization:Bearer lk_rw_<your-token>"]
    }
  }
}
Tip:

Keep .mcp.json out of version control — it contains your token. Commit a .lorekit.json instead to set the team default mode (e.g. { "mode": "remote" }).

Verify the connection

npx @lorekit/cli doctor

The doctor command checks connectivity, token permissions, and scope health. Look for the Remote section in the output — it should show a green ok status.

Two of those checks answer different questions, and both must be green:

  • connectivity probes the public /health function. It proves the network path only — it stays green for a token that no longer works.
  • authentication makes one authenticated request and reports what the server said about the token. A revoked or deleted token fails here with HTTP 401, and doctor exits non-zero. A write-only lk_wo_* token passes with a note that it has no read permission.
Tip:

Seeing authentication — token REJECTED? The token was revoked or deleted. Generate a new one at lorekit.io, then run npx @lorekit/cli install --force — it asks whether to keep, replace, or remove the token already in your config.

Write and read a memory

Write a test memory via the MCP endpoint:

memory.write {
  scope: "global",
  key:   "hello-remote",
  value: "Remote lore is working."
}

Read it back from any machine:

memory.read {
  scope: "global",
  key:   "hello-remote"
}
// → { "value": "Remote lore is working.", "updated_at": "…" }

Use in CI / GitHub Actions

Store a read-only token as LOREKIT_TOKEN in your repo secrets, then inject global memories before any AI step:

- name: Inject LoreKit context
  run: |
    curl -s -X POST "$LOREKIT_MCP_URL" \
      -H "Authorization: Bearer $LOREKIT_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "tools/call",
        "params": {
          "name": "memory.list",
          "arguments": { "scope": "global", "limit": 20 }
        }
      }'
  env:
    LOREKIT_MCP_URL: https://pqokxlhvnosogizsjztg.supabase.co/functions/v1/mcp
    LOREKIT_TOKEN: ${{ secrets.LOREKIT_TOKEN }}

(Optional) Install the GitHub App

To have LoreKit automatically learn from PR review comments, go to Settings → Integrations and install the LoreKit GitHub App. Every repository you grant it is covered instantly — there is no per-repo secret to copy and no webhook to configure on GitHub:

  • Covers: every repo you grant the App, as you add or remove them on GitHub
  • Learns from: resolved pull request review comments and reviews
  • Tags each memory: source::pr-webhook
Note:

Next steps: share memories with your whole team by setting up an organization. See the Team sharing tutorial.