Cairn / Docs / MCP Server

MCP Server

Cairn ships a bundled stdio MCP server. Connect Claude Desktop, OpenCode, Cursor, or any MCP-compatible client and give it direct read/write access to your workspace. Changes appear in the Cairn UI instantly.

What is MCP?

Model Context Protocol (MCP) is an open standard published by Anthropic for exposing structured tools to AI clients. An MCP server runs as a local process alongside your AI client; the client calls tools from the server to read and write data. Cairn's MCP server exposes your entire workspace — notes, tasks, projects — to any compatible client.

Where the server binary lives

The MCP server is a self-contained binary bundled inside the installed Cairn app. No Node.js required, no separate install.

macOS

/Applications/Cairn.app/Contents/Resources/app.asar.unpacked/dist-mcp/cairn-mcp

Windows

C:\Users\<user>\AppData\Local\Programs\Cairn\resources\app.asar.unpacked\dist-mcp\cairn-mcp.exe

Linux

/opt/Cairn/resources/app.asar.unpacked/dist-mcp/cairn-mcp

AppImage installs may use a different path. If unsure, run find / -name cairn-mcp 2>/dev/null to locate the binary.

Running from source

/path/to/cairn/dist-mcp/cairn-mcp

Configuring Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on your platform:

{
  "mcpServers": {
    "cairn": {
      "command": "/Applications/Cairn.app/Contents/Resources/app.asar.unpacked/dist-mcp/cairn-mcp"
    }
  }
}

On Windows, use the Windows binary path and ensure the .exe extension is included. Forward slashes work in JSON on Windows. Restart Claude Desktop after saving.

Configuring Cursor

Cursor uses the same mcpServers format as Claude Desktop. Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "cairn": {
      "command": "/Applications/Cairn.app/Contents/Resources/app.asar.unpacked/dist-mcp/cairn-mcp"
    }
  }
}

Configuring Cline

Cline (VS Code extension) uses the same format. Add via the Cline settings UI or directly in your VS Code settings.json:

{
  "mcpServers": {
    "cairn": {
      "command": "/Applications/Cairn.app/Contents/Resources/app.asar.unpacked/dist-mcp/cairn-mcp"
    }
  }
}

Configuring OpenCode

In your project repo, create .opencode/config.json:

{
  "mcp": {
    "cairn": {
      "type": "local",
      "command": ["/Applications/Cairn.app/Contents/Resources/app.asar.unpacked/dist-mcp/cairn-mcp"],
      "enabled": true
    }
  }
}

How writes appear instantly

The Cairn app polls the SQLite database using WAL (Write-Ahead Logging) change detection. When the MCP server writes a note or task, the change is committed to the database and the app detects it within milliseconds — no restart required, no manual refresh. The UI updates in place.

MCP notifications

When an MCP tool writes to your workspace, Cairn fires a native OS notification within one second — visible even when the app is minimised. The menu bar tray icon shows a badge count for unread MCP updates. Clicking it brings Cairn to front and clears the badge.

All write operations trigger a notification — this includes notes, tasks, projects, dashboards, and Idea Flow tools.

Tool reference

All 46 tools exposed by the Cairn MCP server, grouped by category.

Context

ToolRead / WriteDescription
get_cairn_contextReadFull orientation: workspaces, projects, column IDs, tool list, conventions. Call once at session start.
get_project_context_packReadSingle-call bundle: project metadata + pinned notes + open tasks + recent activity
resolve_projectReadFind a project by name (fuzzy, case-insensitive) and return its ID and column IDs
get_project_summaryReadColumn breakdown, card counts, pinned notes, recent activity
list_recent_activityReadRecently created or updated notes and tasks, sorted newest first

Notes

ToolRead / WriteDescription
get_noteReadFull markdown content, linked IDs, and metadata of a note by ID
list_notesReadList all notes in a project
search_notesReadFull-text search across notes
create_noteWriteCreate a markdown note
import_note_from_fileWriteImport a local file as a note — server reads from disk, no need to inline content
ensure_noteWriteIdempotent create-or-update by title — prevents duplicate notes on re-run
append_to_noteWriteAppend content to a note without re-sending the full body
patch_noteWriteSurgically replace a string inside a note — no need to re-send the full content
update_noteWriteUpdate a note's title, content, or pinned state
move_noteWriteMove a note to a different project
delete_noteDeletePermanently delete a note. Cannot be undone.

Tasks

ToolRead / WriteDescription
get_taskReadFull task detail by ID — includes blockedByIds
list_tasksReadAll tasks in a project grouped by column
list_ready_tasksReadOnly unblocked, active tasks — use this instead of list_tasks to find work that can start now
search_tasksReadFull-text search across task cards
create_taskWriteCreate a task card in a column
update_taskWriteUpdate a task's title, description, priority, due date, column, or assignee
update_task_statusWriteMove a single task to a different column
bulk_update_task_statusWriteMove multiple tasks to the same column in one call
link_note_to_taskWriteBidirectionally link a note and a task card
block_taskWriteMark a task as blocked by another task in the same project. Circular dependencies are rejected.
unblock_taskWriteRemove a blocking dependency between two tasks
delete_taskDeletePermanently delete a task card. Cannot be undone.

Projects

ToolRead / WriteDescription
create_projectWriteCreate a project with default board columns (Backlog, Todo, In Progress, Review, Done)
update_projectWriteUpdate a project's name, description, icon, status, or priority
delete_projectDeletePermanently delete a project and all its contents. Cannot be undone.

Dashboards

ToolRead / WriteDescription
get_dashboard_constantsReadReturns the window.cairn API reference for writing dashboard HTML. Call before create_dashboard.
create_dashboardWriteCreate a live HTML dashboard in a project. HTML must be self-contained with inline CSS/JS.
update_dashboardWriteUpdate an existing dashboard's title or HTML

Idea Flow

ToolRead / WriteDescription
get_idea_flowReadFull canvas graph — all nodes and edges — with note and task content resolved inline
get_idea_flow_rulesReadNode type data shapes, group conventions, and positioning rules. Call before creating nodes.
create_idea_flow_nodeWriteAdd a node to the canvas (idea, note_ref, task_ref, group, url, ai_summary)
update_idea_flow_nodeWriteUpdate a node's data fields or canvas position; data is merged, not replaced
create_idea_flow_edgeWriteConnect two nodes with an optional label
layout_idea_flowWriteAuto-arrange all nodes in the canvas using dagre (LR or TB direction)
delete_idea_flow_nodeDeleteRemove a node and all its connected edges
delete_idea_flow_edgeDeleteRemove a connection between two nodes

Knowledge Graph

ToolRead / WriteDescription
get_knowledge_graphReadFull workspace relationship graph; scope by projectIds; includeAuto flag for auto-discovered relationships
get_neighborsReadN-hop neighbourhood around any node (depth 1–3). More efficient than loading the full graph.

Tags

ToolRead / WriteDescription
create_tagWriteCreate a workspace tag with a name and hex colour
Agent workflow tip

Call get_cairn_context once at session start — it returns all workspace/project/column IDs and conventions in one call. When sequencing work, use list_ready_tasks instead of list_tasks to get only tasks with no pending blockers.

Task dependencies

Use block_task to mark a task as blocked by another in the same project. Circular dependencies are rejected automatically. A blocker is treated as resolved as soon as it is moved to a done column or archived — no manual unblocking needed.

IDs are stable

Note and task IDs are stable across sessions. Fetch them once and reuse them for subsequent tool calls within the same session.