Lifeline v0.3.0

Integration

Wire Lifeline into Claude Code, Cursor, Claude Desktop, and Gemini CLI via MCP — with auto-connect.

Lifeline has two sides, and the AI drives both:

MCP client (any of them)

Point the client at the stdio server. The server command is lifeline-mcp (installed by pip install lifeline-context); it reads the DB from LIFELINE_DB (default .lifeline/ledger.db). Set the env var the way your client config does — e.g. an "env" block in the JSON snippets below. At a shell directly:

LIFELINE_DB=.lifeline/ledger.db lifeline-mcp        # bash/zsh
$env:LIFELINE_DB=".lifeline/ledger.db"; lifeline-mcp    # PowerShell

Per-client snippets (copy-and-paste)

Claude Code — already reads the project's .mcp.json automatically. Without it: claude mcp add lifeline -- lifeline-mcp.

Cursor.cursor/mcp.json (at the project root):

{ "mcpServers": { "lifeline": { "command": "lifeline-mcp", "env": { "LIFELINE_DB": ".lifeline/ledger.db" } } } }

Claude Desktopclaude_desktop_config.json (use an ABSOLUTE path — the cwd differs):

{ "mcpServers": { "lifeline": { "command": "lifeline-mcp", "env": { "LIFELINE_DB": "C:/path/to/project/.lifeline/ledger.db" } } } }

Gemini CLI~/.gemini/settings.json:

{ "mcpServers": { "lifeline": { "command": "lifeline-mcp", "env": { "LIFELINE_DB": ".lifeline/ledger.db" } } } }

WEB chat apps (claude.ai, ChatGPT) do not belong here — they require a remote server + OAuth (see docs/MCP_REMOTE.md). These snippets are for dev/CLI/IDE clients (stdio, local).

Verification status (honest): Claude Code (stdio, .mcp.json, named lines) and the remote path (claude.ai connector via OAuth RS mode: 401 without a token, 200 with a valid JWT, consent page) are validated live on this very repo. The Cursor / Claude Desktop / Gemini CLI snippets follow each client's documented config format but haven't been exercised end-to-end by us yet — if you run one, tell us what happened (works-fine reports are as valuable as bugs).

Capture while you work (close the loop automatically)

Auto-connect in Claude Code (SessionStart hook)

Inject the context at the start of each session via the project's .claude/settings.json (the hook's stdout enters the context). Example — adjust to your version's hook schema:

{
  "hooks": {
    "SessionStart": [
      { "hooks": [ { "type": "command", "command": "python -m lifeline context" } ] }
    ]
  }
}

Without a hook, the minimal convention (in CLAUDE.md) is: on opening, run python -m lifeline context and read it before acting. When making any decision/feature/fix, append — that way the next AI (or you tomorrow) connects and already knows.

Lifeline — MIT licensed · Edit on GitHub ← Back to the lifeline