ctxfile
Officialctxfile is a local-first MCP server that snapshots, saves, and shares project context across AI agents, ensuring privacy and seamless continuity of work.
get_context— Load the current working context (plan docs, ranked key files, git state, optional Notion pages, and summary) as structured JSON; supports scoping tofull,plan,files, orgit.save_session— Save a summary of the current conversation (decisions made, files touched, open items) to ctxfile; supports named threads, handoff packages (with rationale, gotchas, artifacts, and a suggested first prompt), and optional full transcript storage.continue_thread— Fetch the merged, chronological, provenance-tagged history of a named thread to resume work; fuzzy-matches thread names and falls back to the most recently active thread if none is specified.list_threads— List all active threads with their last-active timestamps, session counts, status, and which client harness last touched them.ingest_context— Push a session digest from any MCP-speaking agent into ctxfile so future agents can pick up where it left off; records are stored locally, redacted, and provenance-stamped.
Additionally, ctxfile operates with zero network calls by default, supports opt-in encrypted sync vaults for cross-machine use, can export static context envelopes (.ctxfile convention) for cloud or CI agents, and provides a local dashboard (ctxfile ui) for managing snapshots and browsing contexts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ctxfileload my context"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 agent30-second quickstart
Claude Code
claude mcp add ctxfile -- npx -y ctxfileCursor (.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).
Related MCP server: knitbrain
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 initIt 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
Snapshot |
|
Save and resume |
|
Threads | Durable identities for a piece of work ("Q3 campaign"), spanning agents and machines. |
Universal ingest |
|
Cloud agents |
|
Dashboard |
|
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
Package | What | License |
| Apache-2.0 | |
| Apache-2.0 | |
The local instrument UI served by | Apache-2.0 | |
ctxfile.dev: site and docs | Apache-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, testsStar history
If ctxfile saves you a cold start, a star is how other people find it.
License
Apache-2.0. "ctxfile" and the ctxfile logo are trademarks of ctxfile; the license covers the code, not the name.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceA local-first MCP server for shared memory across AI tools, enabling context capture and resume across sessions.26624Apache 2.0
- AlicenseAqualityAmaintenanceLocal-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.37313MIT
- AlicenseNot gradedqualityAmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.43MIT
- AlicenseNot gradedqualityAmaintenanceA local-first MCP server for AI coding agents that shares structured execution state, routes context deltas, and provides preflight nudges to prevent conflicts and stale decisions.MIT
Related MCP Connectors
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
One shared context your team's AI tools read & write over MCP. No re-explaining. Free.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ctxfile/ctxfile'
If you have feedback or need assistance with the MCP directory API, please join our Discord server