Cairn MCP
Cairn distills skill documents into a knowledge graph and serves it to agents over MCP, saving their context.
- 99 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The builder sends document text to an external language model with your key.
- The HTTP mode serves a REST endpoint without authentication and must not be exposed to an open network.
Install
- Works in
Manual install
./bin/cairn-mcp --config configs/mcp-local.yamlFrom step 3 of the README after `make build` (Go 1.22+ needed) and copying `configs/mcp-local.example.yaml`. Stdio transport.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The builder sends document text to an external language model with your key.
- The HTTP mode serves a REST endpoint without authentication and must not be exposed to an open network.
This is third-party code. Review the repository files before installing.
What it does
Cairn is an open-source set of three parts: a graph builder, a query server and a viewer. The builder reads a repository of `SKILL.md` and `references/*.md` files, uses a language model to extract domains, subdomains, entities and relations, and stores the graph in SQLite with full-text search. Updates run in parts: only affected subdomains are recomputed and manual edits are kept. The `cairn-mcp` server gives the graph to an agent over stdio, SSE or REST and never calls a language model: it only reads the database. Search is the `domain_search` tool, and the `cairn` console utility offers `find`, `impact` and `status`. The graph is packed into an immutable bundle and distributed through GitHub releases with hot updates for clients.
Who it is for. Teams with large knowledge bases in the form of skills and documentation, where the agent burns context reading everything.
Good fit when
- A skill catalog has grown past what fits into context.
- You need to see which entities a payment gateway change touches.
- A team must share one knowledge graph and update it without restarting clients.
- People edit documents and the graph should pick up their changes.
Not a fit when
- There are few documents and they fit into the agent context.
- There is no access to a language model with a compatible API for building the graph.
- Vector semantic search is needed: Cairn builds a graph and searches through SQLite FTS5.
Example request
Find entities about the payment gateway in the Cairn graph and show which domains its change affects.MCP
- Transport
- stdio, http, sse
- Authentication
- not required
Environment variables
CAIRN_LLM_API_KEYsecret- A model key for building the graph with `cairn-ingest`. The query server does not need it.
Limitations
The project is built from source: Go 1.22 or newer is needed, and Node 22 or newer for the viewer. Building a graph needs a model endpoint compatible with OpenAI or Anthropic and a key in `CAIRN_LLM_API_KEY`, with DeepSeek configured by default. The query server runs without a model. For Chinese text search uses the `unicode61` tokenizer, where a run of characters counts as one token, so a short fragment may not match. The REST mode over HTTP is open without authentication.
How to disable. Remove the `cairn-mcp` entry from the MCP client settings and stop the process. The `knowledge.db` file can be deleted: it does not change the source documents.
FAQ
How do I run the MCP server?
Build with `make build`, copy `configs/mcp-local.example.yaml` to `configs/mcp-local.yaml`, set the database path and run `./bin/cairn-mcp --config configs/mcp-local.yaml` for stdio.
How do I share the graph with a team?
Run `./bin/cairn-mcp --config configs/mcp-http.yaml --listen :8080`: the server offers MCP over HTTP and SSE and a REST `/api/search` endpoint.
Is a model key needed for queries?
No. `CAIRN_LLM_API_KEY` is needed only for building the graph; the query server only reads the database and does not call a model.
How do I check that MCP works?
Run `scripts/dev/smoke-mcp.sh configs/mcp-local.yaml my-skills`.
How do I build a graph from my own skills?
Run `./bin/cairn-ingest --repo /path/to/your-skills-repo --db ./knowledge.db`: the command creates `knowledge.db` with the graph and the search index.
Discussion
No questions or reviews yet.
Related
MCP serversShared memory for fleets of AI agents with access scopes, an audit trail and a knowledge graph: an MCP server, Docker and a cloud
agentcairn keeps Claude Code, Codex and Cursor memory in Markdown files for Obsidian and hands an agent only what it needs
BrainAPI turns text into a knowledge graph on your server and serves agents over MCP, REST and a console with fact-path answers
An MCP server that keeps domain knowledge in a graph: the agent searches entities and relations and can add or update them itself.
Claude Skills MCP: semantic search for skills
Claude Skills MCP
An MCP server with vector search: the agent describes a task and gets matching skills from the Anthropic and K-Dense collections
A skill registry for teams with security scanning and versioning; the MCP server finds and installs skills on request.
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Cairn (this card) | no | not required | 99 | |
| MCP Knowledge Graph | no | not required | 888 | agent memory as a graph; Cairn builds a graph from skill documents and distributes it to teams |
| Project Cairn | no | 252 | another project with a similar name; this one builds a knowledge graph from skills |
README in short
The idea is a third way between full text in context and vector search: build a structure first, then hand the agent the relevant subgraph. The query server is separated from the builder, and `make verify` enforces that.