MCP Integration

LogMark runs as an MCP (Model Context Protocol) server, exposing your vault to AI coding tools. Claude Code, Cursor, and other MCP-compatible tools can query your decisions, create entries, and track work sessions.

What This Enables

Your AI tools gain persistent memory across sessions. Instead of re-explaining project context every time, agents can:

  • Load previous decisions: "What did we decide about the database schema?"
  • Check open blocks: "What's currently stuck?"
  • Review recent work: "What was done on +backend this week?"
  • Create structured entries: decisions, tasks, ideas captured as the agent works
  • Track sessions: what was done, when, by which agent

Setup

Build and Run

# Build
dotnet build src/LogMark.Mcp --configuration Debug
# Run with vault path
dotnet run --project src/LogMark.Mcp -- --vault "C:\path\to\vault"
# Or via environment variable
$env:LOGMARK_VAULT = "C:\path\to\vault"
dotnet run --project src/LogMark.Mcp

Configure in Claude Code

Add to your MCP settings:

{
  "mcpServers": {
    "logmark": {
      "command": "dotnet",
      "args": ["run", "--project", "path/to/LogMark.Mcp"],
      "env": {
        "LOGMARK_VAULT": "C:\\path\\to\\vault"
      }
    }
  }
}

Available Tools

create_entry

Create a new entry with full notation support.

{
  "content": "d: using connection pooling for database access",
  "route": "+backend"
}

The entry is parsed, routed, and saved exactly like a human capture. Entry type, tags, routes, and deadlines are all extracted from the content.

list_recent

Query recent entries with optional filters.

{
  "days": 7,
  "route": "backend",
  "entry_type": "decision"
}

Returns entries from the specified time window, filtered by route and type.

search_entries

Full-text and tag search across the vault.

{
  "query": "rate limiting",
  "route": "backend"
}

get_routes

List available routes (projects and domains) in the vault.

{}

Returns all configured routes with their paths and metadata.

Entry Attribution

Entries created via MCP include source attribution:

---

## 2026-02-04 14:32

d: using connection pooling for database access

context: Claude Code, logmark session
source: agent
session: 2026-02-04-a1b2c3

The source: agent field distinguishes agent captures from human captures. The session field links the entry to a tracked work session.

Session Tracking

Each MCP connection can start a session:

  • Sessions track start/end time, entry count, and work summary
  • Session entries appear in the native viewer's session summary view
  • Multiple sessions from different agents are tracked independently

Cross-Entry References

Entries can reference other entries via block IDs:

{
  "content": "t: implement the caching layer",
  "refs": ["abc123"]
}

The refs field links to the block ID of a related entry (e.g., the decision that informed this task). References are bidirectional - the referenced entry shows backlinks.

Human Review

Agent-created entries surface in the native viewer's review queue:

  • Approve - Accept the entry as-is into your vault
  • Edit - Modify the entry before accepting
  • Reject - Remove the entry

This keeps your vault under your control even when agents are creating entries autonomously.

Transport Protocol

MCP uses newline-delimited JSON (NDJSON) over STDIO:

  • Each message is a JSON object followed by \n
  • No Content-Length headers
  • Flush after each write

This is the standard MCP STDIO transport. No special configuration needed for compatible tools.