Cairntir logo

Cairntir

Local SQLite memory for AI coding agents, with cross-session recall, handoffs, semantic search, and file-anchored retrieval over MCP.

Install Cairntir

Run the project’s own setup commands, in order.

Setup steps from the project

cairntir installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    pip install --upgrade cairntir
    
  2. 2. Configure
    cairntir setup
    

Overview

cairntir MCP server gives AI coding agents persistent, project-scoped memory through a 22-tool stdio MCP interface. It stores verbatim decisions, facts, unfinished work, and outcomes in a local SQLite database, with local embeddings for semantic retrieval and file-based recall. Use it when multiple sessions or agents need to share project history, recover bounded context, or trace memories to source files. Supported setup surfaces include Claude Code, Cline, Codex CLI, Cursor, Gemini CLI, and other MCP clients that can run its stdio command.

Use cases

  • Share project decisions across coding-agent sessions
  • Restore bounded task context with a handoff
  • Find memories related to a source file
  • Recover selected transcript requests into memory
  • Review outcomes linked to earlier predictions

Key features

  • Local SQLite memory with sqlite-vec
  • Cross-agent and cross-session handoffs
  • Semantic and file-anchored recall
  • Opt-in transcript recovery
  • Portable JSONL evidence with hashes
  • Scoped sharing and evaluated procedures

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

6/6 checks healthy over the last 21d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars7Stargazers on the source repository.
Last commit7d agoMost recent push to the default branch.

How Cairntir works

What cairntir does

cairntir gives coding agents a persistent memory store that remains available across chats, sessions, and supported hosts. Memories are organized into wings, rooms, and drawers: a wing represents a project, a room represents a topic, and a drawer holds one verbatim memory. The store can contain decisions, facts, unfinished work, predictions, and observed outcomes.

The authoritative data store is local SQLite using sqlite-vec. Embeddings are generated locally, so semantic retrieval can work without sending memory content to an external service. The first embedding operation may download the selected embedding model. Cairntir is a memory system, not an execution sandbox for the agent.

How it works

The MCP server communicates over stdio and exposes 22 tools. Agents can save project knowledge, request a budgeted handoff, search by meaning, retrieve memories associated with a file, recover bounded transcript context, and inspect memory cost. A handoff returns complete drawers when they fit the requested character budget and identifies drawers left out when they do not. It also includes recent default-layer writes, open predictions, and optional code anchors.

Settlements add observed outcomes to existing predictions rather than rewriting the original prediction. Transcript recovery is opt-in, read-only, separately budgeted, and limited to bounded tails that a host has actually persisted. Recovered requests require explicit selection before being written to memory.

Cairntir supports portable JSONL evidence with content hashes and optional HMAC signatures through its Python API. Scoped sharing can restrict access through owner-issued grants, while evaluated procedures use holdout evidence and local approval.

Setup and configuration

Install the package with Python 3.11 or newer, then initialize it:

Terminal
pip install --upgrade cairntir
cairntir setup

Setup initializes the local store and configures supported hosts it detects. Restart the agent after setup. Use cairntir version and cairntir doctor to inspect the installation and configuration. For a single host or project, cairntir init --host codex can create configuration at project scope; add --user for user scope.

Cursor’s global User Rule requires a manual paste of the rule printed by setup. A configured MCP entry does not by itself confirm a live connection, so verify operation with an actual save receipt and retrieval in a fresh chat. The CLI also provides commands such as handoff, recall, recall-for-change, recover, and cost.

Tools and capabilities

  • Save and retrieve cross-session project memories.
  • Create budgeted handoffs containing whole memory drawers.
  • Search semantically and by file or code anchor.
  • Recover bounded transcript tails from supported hosts.
  • Append observed outcomes to predictions.
  • Export and import portable evidence formats.
  • Apply scoped sharing and inspect memory cost.

Host setup covers Claude Code, Cline, Codex CLI, Copilot CLI, Cursor, Gemini CLI, OpenCode, and Qwen Code. Transcript recovery is supported for Claude Code, Codex, and Qwen Code. Other MCP clients can use the cairntir-mcp stdio command manually.

Limitations and notes

Cursor transcript recovery is unsupported, although Cursor can use the MCP server and its setup flow. Transcript data is untrusted and cannot restore text that the host never saved. Cairntir does not automatically treat imported files or recovered transcript content as authoritative.

Optional update checks contact PyPI, and explicitly selected LLM adapters may contact their provider. Version 1 cannot safely import source-local history references; a database backup is recommended for linked history. The CLI treats imported JSONL as untrusted and does not verify signatures, while export and import enforce restrictions on external URLs.

After upgrading from an earlier release, semantic search and saving may require a reindex operation before they work again. The project’s upgrade documentation should be followed before relying on those features.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Cairntir

cairntir is an MCP server that connects AI coding agents to a local SQLite memory store with sqlite-vec. Its main tools save and recall project memories, create budgeted handoffs, recover selected transcript context, search by meaning or file, append outcomes, and inspect memory cost across sessions and agents.

Install it with `pip install --upgrade cairntir`, then run `cairntir setup`. Python 3.11 or newer is required. Setup initializes the local store and configures detected supported hosts; restart the agent afterward and use `cairntir doctor` to inspect configuration.

Use a project wing as the shared memory scope, save decisions or other project information, then request `cairntir_handoff(wing="myproject")` in a later session. Handoff returns complete drawers within the requested character budget and identifies memories omitted by that limit.

Yes, Cursor can use cairntir through MCP configuration, and setup reports the manual step needed for Cursor’s global User Rule. Cursor transcript recovery is unsupported, so use the server’s memory and recall features rather than relying on Cursor transcript import.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCairntir AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/cairntir?style=directory)](https://allmcps.com/mcp/cairntir)
HTML Embed
<a href="https://allmcps.com/mcp/cairntir"><img src="https://allmcps.com/api/badge/cairntir?style=directory" alt="Cairntir on AllMCPs" /></a>