ctxd
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., "@ctxdBuild context for fixing the Stripe webhook idempotency with a 10k budget"
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.
ctxd
A context firewall for AI coding agents.
Local-first engineering memory that gives Claude Code, Cursor and friends the minimum useful context for a task — and explains every token it sent.
The problem
You paste your repo into an AI agent. It gets 60,000 tokens, most of it irrelevant, and still misses the one architectural rule that mattered. Next session you explain the same project again. And again.
Meanwhile the agent "helpfully" reformats a file you asked it to change one line in.
Related MCP server: junto-memory
What ctxd does
$ ctxd context --task "Fix Stripe webhook idempotency" --budget 10000
CONTEXT RECEIPT 87f27bbb
Candidate: 76,182 estimated tokens
Final: 4,547 estimated tokens
Estimated context avoided: 71,635
Included (16):
✓ docs/rules.md [P0] reason: mandatory (P0)
✓ src/payment/webhook.ts [P2] reason: direct task relevance
✓ src/payment/idempotency.ts [P2] reason: direct task relevance
✓ memory/decision/idempotency-key.md [P1] reason: project memory (accepted_decision)
…
Excluded (61):
× src/camera/stream.ts — no task relevance
× docs/architecture-overview.md — duplicate of docs/architecture.md
× .ctxd/sessions/session-2.md — low priority76k tokens of candidate context became 4.5k — and every inclusion and exclusion has a stated reason. Not compression: selection you can audit.
Storage is cheap. Model context is expensive. Every token sent to a model should have a reason to exist.
Principles
Local-first. No cloud, no accounts, no telemetry. Your repository, memory and decisions never leave your machine.
Deterministic. No embeddings, no LLM in the core. The same inputs produce byte-identical output, which is why it can be benchmarked.
Auditable. Every context build produces a receipt. Nothing is included without a reason, and nothing is dropped silently.
Provider-independent. Claude, Cursor and whatever comes next are workers. They are replaceable; your memory is not.
Honest. Token counts are labelled estimates, never dollar figures. Unavailable signals read as zero rather than being invented.
Install
Requires Node.js 24+ and pnpm.
git clone https://github.com/g0GobliN/ctxd.git
cd ctxd
pnpm install
pnpm build
node packages/cli/dist/index.js doctordoctor verifies Node, SQLite, FTS5, storage, config, the database, logging and
Git. Every check actually runs — none reports success without executing.
Quickstart
# 1. Register your project. Detection reads real manifest files,
# never guesses from directory names.
ctxd init --dir .
# 2. Build context for a task
ctxd context --task "Fix the webhook retry logic" --budget 10000
# 3. Record what a future session could not infer from the code
ctxd memory add --type DECISION --source accepted_decision \
--title "Retry with exponential backoff" \
--content "Fixed intervals caused a thundering herd under load."
# 4. Keep work across interruptions
ctxd session start --worker claude
ctxd checkpoint --next "Fix the 409 path then rerun tests"
ctxd resume
ctxd handoff --to cursorConnect an AI worker
claude mcp add ctxd -- ctxd mcp --dir /path/to/projectClaude Code and Cursor then share one project memory — neither owns it. The agent asks ctxd for context instead of reading your whole repository, and records what it learns.
Crucially: a worker cannot overwrite what you told it. Agent conclusions are
stored as worker_statement with visible confidence. If one contradicts a rule
you stated, the write is refused and the conflict reported.
How it works
task ──► signals ──► candidates ──► dedup ──► rank ──► budget ──► receipt
▲ │
memory + git compressionStage | What it does |
Signals | Normalise the task into terms and phrases |
Candidates | Walk the repo honouring |
Retrieval | Pull in relevant project memory and current Git state |
Dedup | Drop exact and near-duplicate copies (shingles + Jaccard > 0.90) |
Rank | Weighted signals: keyword, path, file type, priority, recency, token cost |
Budget | Select the set that fits; compress what doesn't; never truncate |
Receipt | Explain every inclusion and exclusion |
Two rules do most of the work:
Leftover budget is not a reason to send a file. An item with no connection to the task is excluded even when there is room. This is why a 10k budget often returns 4.5k.
Search decides what is relevant; it does not decide what is mandatory. Every P0 rule is retrieved whether or not it shares vocabulary with the task.
Deep dive: docs/context-engine.md.
Commands
Command | Purpose |
| Verify the local environment |
| Version, storage, database, project, Git |
| Register and index a project |
| Build minimum useful context for a task |
| Expand context incrementally |
| Record and search project knowledge |
| Track units of work |
| Track a working session |
| Record where the work stands |
| Everything another worker needs |
| What was I doing? |
| Run the MCP server |
Every command supports --help.
Project status
Early but real. Phases 1–6 of the specification are built, tested and documented — 212 tests, including a golden benchmark that turns a 76k-token fixture repository into 4.5k while keeping everything the task needs.
Phase | Status |
1 · Foundation | ✅ |
1.5 · Context engine | ✅ |
2 · Project intelligence | ✅ |
3 · Persistent memory | ✅ |
4 · Production context firewall | ✅ |
5 · MCP + worker integration | ✅ |
6 · Tasks, sessions, checkpoints, handoffs | ✅ |
7 · Verification + Diff Firewall | 🚧 next |
8 · Web UI | ⬜ |
9 · Optimisation + benchmarks | ⬜ |
10 · Optional local AI | ⬜ |
Not built yet: worker verification, the diff firewall, the web UI. Nothing in this repository calls a network service or an AI model.
APIs may change before 1.0.
Documentation
Document | Contents |
Packages, dependencies, schema | |
Ranking, selection, compression, receipts | |
Memory types, authority order, FTS5 search | |
Tasks, sessions, checkpoints, handoffs | |
The MCP tool surface | |
Building, testing, conventions | |
The full specification |
Contributing
Contributions are very welcome — especially benchmark scenarios, which is how retrieval quality gets measured rather than argued about.
Start with CONTRIBUTING.md.
pnpm install && pnpm build && pnpm testBy participating you agree to the Code of Conduct. Security issues: see SECURITY.md.
Licence
MIT © the ctxd authors.
This server cannot be installed
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
- Alicense-qualityFmaintenanceA Model Context Protocol (MCP) server that enables multiple AI agents to share memory, coordinate tasks, and collaborate effectively across IDEs and CLI tools.1214MIT
- Alicense-qualityBmaintenanceA shared memory and coordination server for multiple AI coding agents, built on the Model Context Protocol (MCP).5MIT
- Alicense-qualityBmaintenanceA Model Context Protocol (MCP) server that turns multiple AI coding agents into a coordinated team that chats, debates, remembers, audits security, and works in parallel on the same project.MIT
- Alicense-qualityCmaintenanceLocal-first MCP server for AI coding agents that provides isolated code search, memory ledger, context rot detection, and cost governance.322MIT
Related MCP Connectors
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
The project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.
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/g0GobliN/ctxd'
If you have feedback or need assistance with the MCP directory API, please join our Discord server