# ContextLayer

> Local-first reasoning graph for investigations. Tauri desktop app + optional MCP

- **Type:** MCP server
- **Install:** `agentstack add mcp-sstanley-yelnatss-contextlayer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [sstanley-yelnatss](https://agentstack.voostack.com/s/sstanley-yelnatss)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [sstanley-yelnatss](https://github.com/sstanley-yelnatss)
- **Source:** https://github.com/sstanley-yelnatss/ContextLayer

## Install

```sh
agentstack add mcp-sstanley-yelnatss-contextlayer
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# ContextLayer

**Local reasoning timelines for serious questions.**

ContextLayer is a desktop app for structured investigation. You open a **workspace** for a question you are working through (a product bet, a strategic call, a security assessment, a debugging rabbit hole). Each **block** on the timeline records what you believe, what you tried, what you observed, and what you concluded.

A **health panel** flags open loops, stale threads, and dead ends so unfinished reasoning does not disappear into scattered notes.

Data stays on your machine in SQLite (`%USERPROFILE%\.contextlayer\graph.db`).

### MCP (recommended if you use Cursor or Claude)

ContextLayer ships with an optional **MCP server** that reads and writes the **same database** as the desktop app. While you investigate in chat, you can ask the agent to **log blocks**, **update evidence on a block by title**, **list what is in a workspace**, or **check hygiene** (orphans, stale items, dead ends). Less copy-paste from chat into the app; your reasoning graph stays current as you work.

Setup: [docs/MCP-SETUP.md](./docs/MCP-SETUP.md) · **Commands:** [docs/COMMANDS-CHEATSHEET.md](./docs/COMMANDS-CHEATSHEET.md) · MCP tools: [docs/MCP-TOOLS.md](./docs/MCP-TOOLS.md) · Agent prompts: [docs/mcp-cursor-cheatsheet.md](./docs/mcp-cursor-cheatsheet.md)

> **Not a notes app.** Typed hypothesis / action / evidence / conclusion fields, not a freeform vault. Cloud sync is not in this release.

**Friends beta (source only):** build from source; see [docs/BETA-LAUNCH-CHECKLIST.md](./docs/BETA-LAUNCH-CHECKLIST.md), [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md), and [CONTRIBUTING.md](./CONTRIBUTING.md).

### Documentation (start here)

| Doc | Use when |
|-----|----------|
| **[COMMANDS-CHEATSHEET.md](./docs/COMMANDS-CHEATSHEET.md)** | Quick reference — desktop, recorder CLI, capture gate, MCP essentials |
| [MCP-SETUP.md](./docs/MCP-SETUP.md) | Wire MCP into Cursor / Claude Desktop |
| [MCP-TOOLS.md](./docs/MCP-TOOLS.md) | Full MCP tool list + params |
| [mcp-cursor-cheatsheet.md](./docs/mcp-cursor-cheatsheet.md) | Example prompts + `save_block` fields |
| [TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) | Something broke |

- [ContextLayerPRD.md](./ContextLayerPRD.md) — locked v1.0 spec
- [docs/PRD-addendum-blocks.md](./docs/PRD-addendum-blocks.md) — blocks, belief states, hygiene roadmap
- [docs/FUTURE-IMPLEMENTATION.md](./docs/FUTURE-IMPLEMENTATION.md) — post-beta backlog (PR export, collaboration, Graphify/Linear inspo)
- [docs/B1-PR-EXPORT-SPEC.md](./docs/B1-PR-EXPORT-SPEC.md) — Phase 1 PR export (multi-select → markdown)
- [docs/PITCH.md](./docs/PITCH.md) — concise read-off pitch
- [docs/DESIGN-PARTNER-OUTREACH.md](./docs/DESIGN-PARTNER-OUTREACH.md) — 30-day design partner ops (Twitter, DMs, metrics)
- [docs/PRD-addendum-merged-vision.md](./docs/PRD-addendum-merged-vision.md) — merged product scope (ContextLayer × GitLLM)

## Prerequisites

1. **Rust** — [rustup.rs](https://rustup.rs/) (required for Tauri)
2. **Node.js 20+**
3. **Tauri prerequisites (Windows)** — [tauri.app/start/prerequisites](https://tauri.app/start/prerequisites/)

### Windows: `cargo` not found after install

If `npm run tauri dev` says `program not found` for `cargo`, Rust is installed but your terminal session does not have it on `PATH` yet. Either **close and reopen the terminal** (or restart Cursor), or run once in that session:

```powershell
$env:Path = "$env:USERPROFILE\.cargo\bin;" + $env:Path
```

### Build fails with `E0119` / `cookie` / `tauri-utils` (Jun 2026)

Rust 1.89+ plus `time` 0.3.48 triggers blanket-impl conflicts in Tauri’s dependency tree. This repo pins `time` to **0.3.47** in `Cargo.lock`. If you regenerate the lockfile, run:

```powershell
cargo update -p time --precise 0.3.47
```

Track upstream: [time-rs/time#783](https://github.com/time-rs/time/issues/783), [tauri-apps/tauri#15525](https://github.com/tauri-apps/tauri/issues/15525).

## Development

Clone from GitHub (**Code** → copy URL), then:

```powershell
cd ContextLayer
npm run desktop:install   # once
npm run dev
```

Use the **Tauri desktop window**, not the Vite browser tab.

Alternative from `apps/desktop`:

```powershell
cd apps/desktop
npm install
npm run tauri dev
```

Database path: `%USERPROFILE%\.contextlayer\graph.db`

### MCP build

See the [MCP section](#mcp-recommended-if-you-use-cursor-or-claude) above. Build the binary from repo root:

```powershell
cargo build -p contextlayer-mcp --release
```

Copy [`.cursor/mcp.json.example`](./.cursor/mcp.json.example) → `.cursor/mcp.json` and set the absolute path to `target/release/contextlayer-mcp.exe` (or a stable copy elsewhere). Full steps: [docs/MCP-SETUP.md](./docs/MCP-SETUP.md).

The desktop app does not need to be running while MCP is in use.

## Workspace layout

```
ContextLayer/
├── apps/
│   ├── desktop/        # Tauri 2 + React UI
│   ├── mcp-server/     # stdio MCP read/write lane
│   ├── recorder/       # opt-in Cursor transcript capture
│   └── trace-cli/      # trace CI for PRs
├── crates/
│   ├── core/           # domain types + admission validation
│   ├── db/             # SQLite migrations
│   ├── export/         # compile + import
│   └── trace/          # capture log, recorder, trace CI
├── migrations/
└── fixtures/workspaces/
```

## What is (and is not) in this repo

**Shipped with the product:** source, migrations, `docs/`, [ContextLayerPRD.md](./ContextLayerPRD.md), and [`.cursor/mcp.json.example`](./.cursor/mcp.json.example) for MCP setup.

**Local only (gitignored):** `.taskmaster/` (internal task planning), `.cursor/mcp.json` and other Cursor IDE files, `.env`, `target/`, `node_modules/`, and `*.db` under your user profile. See [`.env.example`](./.env.example) for optional MCP env vars.

## Locked invariants (do not drift)

- Four stored types only — **Constraint is not first-class**
- Conclusions require ≥1 hypothesis + ≥1 evidence link
- Phase 1 UI: blocks are manual or MCP-logged; **opt-in** live capture via `start_capture` + recorder (not always-on)
- Compile outputs are views over the graph, never shadow schema

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [sstanley-yelnatss](https://github.com/sstanley-yelnatss)
- **Source:** [sstanley-yelnatss/ContextLayer](https://github.com/sstanley-yelnatss/ContextLayer)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-sstanley-yelnatss-contextlayer
- Seller: https://agentstack.voostack.com/s/sstanley-yelnatss
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
