ctxfile/ctxfile

๐Ÿง  Knowledge & Memory๐ŸŸข Verified Active
0 Views
0 Installs

๐Ÿ“‡ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Local-first MCP server that snapshots your project's working state โ€” files, git, plan, and decisions โ€” into one structured context object and hands it to any MCP client in a single call. Save a session in one agent, continue it in another. Zero network calls by default; read-only over your project. Works with Claude Code, Cursor, and any MCP client. npx -y ctxfile

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "ctxfile-ctxfile": {
      "command": "npx",
      "args": [
        "-y",
        "ctxfile-ctxfile"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

ctxfile

ctxfile

One context, every agent, all local.

CI npm Apache-2.0 MCP GitHub stars

Website ยท Docs ยท Quickstart ยท Clients ยท The .ctxfile convention ยท Security


You work with more than one AI agent. Claude Code in the terminal, Cursor in the editor, a chat tab for thinking. Each one starts cold, because your working state (the plan, the key files, the git state, what you decided an hour ago) lives in your head and in scrollback.

ctxfile is a local-first MCP server that snapshots your project's working state into one structured context object, and hands it to any MCP agent in a single call. Save a session in one agent, continue it in another. Nothing leaves your machine.

you โ†’ ctxfile โ†’ the same context, in every agent

30-second quickstart

Claude Code

claude mcp add ctxfile -- npx -y ctxfile

Cursor (.cursor/mcp.json in your project, or ~/.cursor/mcp.json globally)

{
  "mcpServers": {
    "ctxfile": { "command": "npx", "args": ["-y", "ctxfile"] }
  }
}

Codex CLI

codex mcp add ctxfile -- npx -y ctxfile --root .

Claude Desktop (no terminal needed): download ctxfile-macos-arm64.mcpb and drag it into Settings โ†’ Extensions. The bundle carries a compiled native module, so it is macOS (Apple Silicon) only for now; on Windows or an Intel Mac, add the stdio JSON above to claude_desktop_config.json instead.

Every other client: ctxfile is a standard stdio server, so npx -y ctxfile is the whole command. Copy-paste setup for OpenCode, Gemini CLI, OpenClaw, Hermes, Aider, and more is on the per-client tabs at ctxfile.dev/docs/clients.

Then, in your agent: "load my context" (or call get_context). Requires Node โ‰ฅ 20 (โ‰ฅ 22 on Windows).

Make it automatic

You stop typing "save this." One command installs a skill that teaches any agent, while doing its normal work, when to checkpoint context and to announce every save (never silent, paused any time, reviewable always):

ctxfile init

It renders from one canonical spec into whatever each harness reads: an Agent SKILL.md for Claude Code, OpenCode, OpenClaw, and Hermes (one portable file across all four skill systems), a Cursor rule, and managed GEMINI.md / AGENTS.md blocks. Details at ctxfile.dev/docs/automatic.

It follows you into the chat tabs, too

The same context your CLI and editor agents load over MCP can travel to web chatbots. Connect Grok, ChatGPT, Claude web, or Perplexity to your encrypted Sync vault as a custom MCP connector, or ctxfile export and paste the envelope into any prompt box (Gemini, and anything else). Walkthrough: ctxfile.dev/docs/webchat.

Private by default

This is the part we care about most, so it goes first:

  • The default path makes zero network calls. Files and git only.
  • Secret-looking content (cloud keys, tokens, private keys, JWTs, password= assignments) is redacted before it enters the snapshot. .env*, key files, and credential files are never read at all.
  • Core is read-only over your project. It never writes to your repo, your git state, or anything else.
  • No telemetry by default. An anonymous weekly install ping exists, and it is opt-in only.
  • Network connectors (Notion, local Ollama summarization, Sync) activate only when you explicitly configure them.

The full model, including what Pro and Sync add and what they can never see, is documented at ctxfile.dev/security.

What it does

Snapshotget_context returns one structured ContextObject: plan docs, ranked key files fitted to a token budget, git state, optional Notion pages and local-LLM summary.
Save and resumesave_session stores an agent-written summary of the current conversation. continue_thread hands the merged, provenance-labeled history to the next agent. Different harness, different provider, cold start: it picks up where you left off.
ThreadsDurable identities for a piece of work ("Q3 campaign"), spanning agents and machines. handoff: true enforces a complete takeover package: state, decisions with rationale, ordered open items, gotchas.
Universal ingestingest_context is the schema-enforced door for any harness without a native parser. The prompt is the adapter, so every MCP-speaking agent is supported, including ones that do not exist yet.
Cloud agentsctxfile export writes a static, repo-safe artifact for agents that never touch your machine (hosted coding agents, CI). The format is an open spec: the .ctxfile convention.
Dashboardctxfile ui: a local cockpit on 127.0.0.1. Run snapshots, watch connectors, browse context, inspect git state.
Sync (optional)An end-to-end encrypted vault through a relay you can self-host. Argon2id key derivation, XChaCha20-Poly1305 per blob. The relay stores ciphertext only.

The monorepo

PackageWhatLicense
packages/corectxfile on npm: the MCP server, snapshot engine, threads, ingest, export, Sync client, dashboard hostApache-2.0
packages/relay@ctxfile/relay on npm: the self-hostable Sync relay and team hub (encrypted vaults, /mcp endpoint, federation, audit log). One Docker imageApache-2.0
packages/dashboard + packages/ui-kitThe local instrument UI served by ctxfile uiApache-2.0
apps/webctxfile.dev: site and docsApache-2.0

Open core, honestly

Everything in this repo is Apache-2.0 and works standalone, forever. The paid Pro add-on (a separate, closed package) adds session connectors that read your recent sessions from Claude Code, Cursor, Codex CLI, OpenCode, Gemini CLI, Aider, OpenClaw, and Hermes Agent, encrypted cross-session memory, multi-provider consult (Anthropic, OpenRouter for hundreds of models on one key, any OpenAI-compatible endpoint, or local Ollama), AI-distilled prompt Playbooks, and local voice capture. Licensing is an Ed25519-signed key verified offline. No phone-home, ever. Pro funds the open-source work.

Contributing

We want your issues, your PRs, and your weird harness reports. Start with CONTRIBUTING.md. Every ingested format, every MCP client quirk, every redaction gap you find makes the whole thing better.

  • Bugs and features: issues
  • Questions and show-and-tell: discussions
  • Security reports: SECURITY.md (please do not open public issues for vulnerabilities)
git clone https://github.com/ctxfile/ctxfile.git && cd ctxfile
npm install
npm run build && npm test    # the whole gate: lint, typecheck, tests

Star history

If ctxfile saves you a cold start, a star is how other people find it.

Star history chart

License

Apache-2.0. "ctxfile" and the ctxfile logo are trademarks of ctxfile; the license covers the code, not the name.

Related MCP Servers

modelcontextprotocol/server-memoryVerified

๐Ÿ“‡ ๐Ÿ  - Knowledge graph-based persistent memory system for maintaining context

๐Ÿง  Knowledge & Memory2 views
0xshellming/mcp-summarizer

๐Ÿ“• โ˜๏ธ - AI Summarization MCP Server, Support for multiple content types: Plain text, Web pages, PDF documents, EPUB books, HTML content

๐Ÿง  Knowledge & Memory0 views
20alexl/claude-engram

๐Ÿ ๐Ÿ  - Persistent memory and session intelligence for Claude Code. Auto-tracks mistakes, decisions, and context via hooks. Mines session history for patterns and cross-session search. Loop detection, pre-edit warnings, context compaction survival. Runs locally with Ollama.

๐Ÿง  Knowledge & Memory0 views
a2cr/a2cr

๐Ÿ โ˜๏ธ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - MCP server for AI-agent handoffs. Saves client-encrypted WorkBaton checkpoints and WorkStash notes so Codex, Claude Code, Roo Code, and other MCP clients can resume work without passing full chat history.

๐Ÿง  Knowledge & Memory0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Active

Recent health check succeeded.

Last checked: 7/28/2026, 9:23:17 PM

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.