Repository avatar
Other Tools
v0.1.1
active

ctxpane

io.github.bigwalkdoe/ctxpane

Local-first context daemon for MCP coding agents on Linux, macOS, and Windows.

Documentation

ctxpane

Local-first context daemon for MCP coding agents

CI License: MIT Built With Rust MCP Compatible SQLite FTS5 Linux macOS Windows

Stop copy-pasting terminal output, window titles, and scratch notes into your AI chat.
ctxpane passively captures recent local context and exposes it to MCP clients over a local stdio bridge.

Quickstart • MCP Setup • CLI • Configuration • Privacy & Security

MCP Registry: mcp-name: io.github.bigwalkdoe/ctxpane


Why ctxpane?

AI coding agents work better when they can see what you just copied, which window you were in, and the scratch notes you left behind. ctxpane keeps that context local, ephemeral, and queryable:

  • Clipboard history: Captures clipboard text and image metadata with privacy filtering, dedupe, TTL, and size limits.
  • Window focus trail: Tracks active app/window transitions with debounce, so agents can see recent working context.
  • Ephemeral scratchpads: Watches ~/.local/share/ctxpane/scratchpads/*.md and exposes named notes through CLI and MCP.
  • MCP-native bridge: ctxpane mcp runs a stdio MCP server that talks to the local daemon over a user-owned Unix socket.
  • Privacy by default: Local-only storage, denylisted apps, concealed clipboard handling, secret redaction/masking, and retention limits.
  • Multi-platform adapters: KDE Plasma (primary), wlroots (Sway/Hyprland/Niri), generic Wayland (Mutter/GNOME), generic X11, macOS, and Windows behind a common adapter interface with honest capability reporting.

Status: Milestones 1, 2, and 3 are implemented. All platform adapters (Linux, macOS, Windows) are complete. CI, release, and hardening are done.


Quickstart

Install from source

git clone https://github.com/bigwalkdoe/ctxpane.git
cd ctxpane
cargo install --path .

This installs both ctxpane and ctxpane.

Start the daemon

ctxpane daemon

Check status

ctxpane status

Push a scratchpad note

echo "Investigate borrow checker error in parser" | ctxpane pad push parser-notes

ctxpane status, ctxpane clear, and ctxpane mcp require a running daemon. ctxpane pad push writes the scratchpad file directly.


MCP Setup

ctxpane mcp is a stdio MCP bridge. It connects to the local CtxPane daemon over $XDG_RUNTIME_DIR/ctxpane.sock (or CTXPANE_SOCKET).

Claude Desktop / generic stdio MCP config

{
  "mcpServers": {
    "ctxpane": {
      "command": "ctxpane",
      "args": ["mcp"]
    }
  }
}

Cursor / OpenCode-style stdio config

{
  "mcp": {
    "servers": {
      "ctxpane": {
        "type": "stdio",
        "command": "ctxpane",
        "args": ["mcp"]
      }
    }
  }
}

Adjust the config shape to your host's MCP schema; the important part is running ctxpane mcp as a stdio server.

MCP Resources

ResourcePurpose
ctxpane://nowCurrent context snapshot (JSON)
ctxpane://clipboard/recentRecent clipboard items (JSON)
ctxpane://windows/trailRecent window focus trail (JSON)
ctxpane://scratchpad/{name}Named scratchpad content

MCP Tools

ToolPurposeKey arguments
search_contextFull-text search across clipboard, window, and scratchpad contextquery, source_type?, since_minutes?
get_clipboard_itemFetch a clipboard item by ID; image metadata always, bytes only when cachedid
write_scratchpadCreate or replace a named scratchpadname, content
clear_contextClear selected context scopescope? (all | clipboard | windows | scratchpads)

See docs/mcp-host-config.md for host configuration details.


CLI

ctxpane daemon                 # start local daemon
ctxpane mcp                    # start stdio MCP bridge (requires daemon)
ctxpane status                 # show store/capability status (requires daemon)
ctxpane clear                  # clear all context (requires daemon)
ctxpane clear --clipboard      # clear clipboard items
ctxpane clear --windows        # clear window events
ctxpane clear --scratchpads    # clear scratchpad index entries
ctxpane pad push <name>        # write stdin to a scratchpad markdown file

Both ctxpane and ctxpane point to the same binary.


Configuration

CtxPane loads ~/.config/ctxpane/config.toml by default. Missing config uses defaults; invalid config fails startup with a clear error.

[storage]
mode = "ephemeral_sqlite" # "ephemeral_sqlite" | "memory"
ttl_minutes = 240
max_clipboard_items = 100
max_item_bytes = 524288

[privacy]
redact_secrets = true
redaction_action = "mask" # "mask" | "drop"
ignore_incognito = true
excluded_apps = [
  "org.keepassxc.KeePassXC",
  "com.bitwarden.desktop",
  "com.1password.1password",
  "com.apple.keychainaccess"
]

[window_tracker]
enabled = true
min_focus_duration_ms = 1500
max_trail_length = 25

[scratchpad]
directory = "~/.local/share/ctxpane/scratchpads"
auto_expire_hours = 24
delete_files_on_expiry = false

Runtime paths

PathPurpose
~/.config/ctxpane/config.tomlConfig file (platform config dir)
$XDG_RUNTIME_DIR/ctxpane.sockDaemon IPC socket (CTXPANE_SOCKET overrides)
~/.local/share/ctxpane/scratchpads/Scratchpad markdown files
~/.local/share/ctxpane/ctxpane.dbSQLite DB in ephemeral-sqlite mode (platform data dir)

Privacy & Security

  • Local-only: No telemetry, no cloud sync, no remote endpoints.
  • User-owned IPC: The MCP bridge talks to the daemon over a local Unix domain socket under the user runtime directory.
  • Denylist & concealed handling: Excluded apps and concealed clipboard signals are filtered before indexing.
  • Incognito detection: Best-effort heuristic detects private/incognito browsing windows; configurable via ignore_incognito.
  • Secret redaction: High-confidence secrets can be masked ([REDACTED_SECRET]) or dropped based on config.
  • Ephemeral retention: TTL and item limits cap stored context; mode = "memory" keeps the store in-memory.
  • Image safety: Image bytes are not persisted in SQLite; image retrieval follows in-memory cache/metadata rules.

See the design spec for the full threat model and guardrails: docs/superpowers/specs/2026-11-29-ctxpane-design.md.


Architecture

                  ┌──────────────────────────────┐
                  │     MCP client / AI agent    │
                  └──────────────┬───────────────┘
                                 │ stdio JSON-RPC
                                 ▼
                  ┌──────────────────────────────┐
                  │        `ctxpane mcp` bridge       │
                  └──────────────┬───────────────┘
                                 │ Unix domain socket
                                 ▼
┌────────────────────────────────────────────────────────────────┐
│                      `ctxpane daemon` / CtxPane                    │
│  • Clipboard/focus adapters   • Privacy & redaction pipeline   │
│  • Scratchpad watcher         • SQLite/FTS5 or in-memory store │
└────────────────────────────────────────────────────────────────┘

Service Templates

Linux (systemd user service)

A systemd user unit template is provided at contrib/systemd/user/ctxpane.service.

See docs/linux-service.md for installation and hardening notes.

macOS (launchd LaunchAgent)

A launchd LaunchAgent template is provided at contrib/launchd/io.ctxpane.daemon.plist.

See docs/macos-service.md for installation and security notes.

The macOS template is provided for service coverage; validate it on your macOS version before relying on it.


Development

cargo test -q
cargo fmt --check
cargo clippy --all-targets -- -D warnings

CI runs fmt, clippy, and tests on GitHub Actions. Tagged v* releases publish Linux x86_64 artifacts. See docs/releasing.md.


Docs

License

MIT