ctx-manager
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., "@ctx-managerSlice the next phase section from Phase_file.md"
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.
ctx-manager
A provider-agnostic context engineering CLI + MCP server for multi-language agentic development.
ctx-manager sits between your Docs/ folder (PRDs, architecture docs,
phase plans, API specs) and AI coding agents (Claude Code, Cursor,
Windsurf), cutting token spend two ways:
Deterministic, header-based document slicing — pull exactly the section you need from a blueprint file, not the whole thing. Structural (regex over Markdown headers), not RAG/embeddings.
An append-only, git-validated
Memory_Ledger.md— accurate session state so agents don't re-derive or hallucinate what's already been built. Every entry is checked against realgit statusoutput before being marked verified.
Works identically across Rust, Go, TypeScript, Python, or any other stack
-- ctx-manager never touches your application source code, only Docs/.
Install
uvx --from ctx-manager ctx --helpNo virtualenv setup, no global install required.
Related MCP server: Claude Session MCP
Usage
Slice a blueprint file by header:
ctx build --slice "PRD.md > 5. Feature List"Prints the matched section's content to stdout — pipe it into CLAUDE.md
or wherever your agent reads context from.
Auto-slice the next phase, based on ledger history:
ctx build --auto-phaseReads Memory_Ledger.md for the latest completed phase, and slices the
next phase's section out of Phase_file.md automatically — no manual
--slice target needed. Falls back to Phase 0 with a warning if the
ledger has no completed-phase entries yet.
Append a verified entry to the session ledger:
ctx append-ledger --summary "Implemented the login endpoint" --category completedChecks git status against your project before writing, and prefixes the
entry [Verified: N files changed], [Reasoning/State Only], or
[Unverified: not a git repo] depending on what it finds -- so an agent's
self-reported "done" claim is checked against what actually happened on
disk.
Run as an MCP stdio server (for Cursor, Windsurf, Claude Desktop):
ctx mcpExposes query_slice, append_ledger_entry, and get_current_phase as
MCP tools, calling the exact same code path as the CLI commands above.
Configuration
ctx-manager searches upward from your current directory for
.context/config.toml. If none is found, it uses sane defaults
(Docs/ folder, Memory_Ledger.md, etc.) and warns once.
[project]
docs_dir = "Docs/"
ledger_file = "Memory_Ledger.md"
phase_file = "Phase_file.md"
[blueprint_files]
files = ["PRD.md", "Architecture.md", "API_Spec.md"]
[git]
scope = "docs_dir" # or "repo_root"Override the search entirely with --project-root.
Claude Code integration
Example SessionStart/SessionEnd hooks (auto-refresh CLAUDE.md before
a session via --auto-phase, auto-log to the ledger after) are in
examples/claude_code_hooks/.
Design principles
Docs/in,Docs/out — never touches application source, in any language.Cheap before heavy — stdlib
rebefore embeddings,subprocess gitbefore a git library, local stdio before any network service.Append-only ledger — no code path overwrites
Memory_Ledger.mdwholesale. Ever.Fail loud, not silent — a missing header or missing file returns an explicit error, never empty content an agent could hallucinate on.
See Docs/Architecture.md and
Docs/PRD.md for the full design writeup (this project
dogfoods itself -- its own Docs/ folder is sliced and tracked by
ctx-manager during its own development).
Limitations
ctx-manager cannot prevent an agent from bypassing it. Nothing here
stops an agent with raw filesystem access from reading Docs/PRD.md
directly instead of going through ctx build. This is a structural limit,
not a missing feature -- a subprocess-based CLI has no hook into another
process's file-read tool calls.
If you need actual enforcement (not just convention), that has to come from the agent runtime itself:
Claude Code: use
permissions.denyrules in.claude/settings.jsonto block the Read tool from touchingDocs/*.mddirectly, forcing reliance on theCLAUDE.mdthatctx build --auto-phasegenerates. See Claude Code's own permissions docs -- this is not somethingctx-managerconfigures for you.MCP clients (Cursor, Windsurf, etc.): whatever filesystem-access controls that client exposes, if any -- outside
ctx-manager's control.
Without one of those, ctx-manager is a convention the agent is expected
to follow, backed by verified session history (the ledger) -- not a
sandbox.
Development
git clone <this-repo>
cd ctx-manager
uv sync
uv run pytestLicense
MIT — see LICENSE.
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 Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables maintaining consistent project documentation and progress logs across development workflows. Provides tools for logging changes, tracking project phases, and keeping architecture docs synchronized with day-to-day development work.1
- AlicenseAqualityDmaintenanceProvides Claude Code with programmatic session awareness to track context usage, session history, and task progress. It enables intelligent context reset recommendations and automatic synchronization of project planning documentation.5MIT
- AlicenseNot gradedqualityFmaintenanceProvides AI coding assistants with persistent project memory by capturing development checkpoints during git commits, branch switches, and inactivity. It enables seamless task resumption through tools that retrieve session history, momentum, and synthesized re-entry briefings.213MIT
- AlicenseNot gradedqualityAmaintenanceProvides persistent memory for AI coding agents across sessions by saving and loading session context like tasks, decisions, and blockers.286MIT
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/saturnarians/ctx-manager'
If you have feedback or need assistance with the MCP directory API, please join our Discord server