Cortex
Cortex is an AI memory & context management MCP server that facilitates a structured plan → do → commit workflow for AI assistants, ensuring persistent project context, consistent plans, and code quality.
Memory Bank Management: Create, update, and persist structured project context (plans, roadmaps, progress, active context). Supports structured mutations, compression for token optimization, and a write-ahead log (WAL) for auditing and rollback.
Session Management: Start sessions with orientation briefs, register/deregister sessions, compact session history for handoffs, and track goals, roles, checkpoints, and task progress.
Plan & Roadmap Orchestration: Create, list, get, complete, register, and archive development plans. View dependency graphs and manage plan lifecycles within a project roadmap.
Quality Assurance: Run zero-argument quality gates — Phase A (tests, linting, type checks, coverage) and Phase B (documentation/memory-bank sync validation). Auto-fix formatting (Black), linting (Ruff), type errors, and Markdown issues.
Inter-Agent Pipeline Handoff: Structured state exchange between pipeline phases (init/write/read/clear/snapshot/rollback), persisted in
.cortex/.session/.Memory Compression: Compress
CLAUDE.mdand.cortex/memory-bank/*.mdfiles to reduce token costs, with automatic backups and structural integrity validation.Auditing & Rollback: Inspect WAL entries, detect anomalies, and snapshot/restore the memory bank for rollback safety.
Reasoning Scratchpad: Append structured thoughts for multi-step deliberation and branching reasoning before taking action.
External Content Ingestion: Stage raw external sources into the memory bank.
Shared Rules (Synapse): Propose and self-test shared prompt/rule changes across projects via Git submodules.
Project Initialization & Migration: Set up new projects with the
.cortex/structure and migrate legacy memory bank layouts.
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., "@Cortexinitialize the Memory Bank"
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.
Cortex - AI Memory & Context Management Server
Powered by Enlighter and Hyperskill.
What it's for
Cortex is an MCP server that helps build and maintain a project Memory Bank so AI assistants always have up-to-date context, plans, and rules.
It follows the Memory Bank pattern and keeps your .cortex/ files (roadmap, activeContext, progress, rules) in sync so agents can reliably run a plan → do → commit loop instead of ad-hoc edits.
Use Cortex when you want reproducible, high-quality AI-driven development that survives restarts, editor changes, and long-running projects.
Related MCP server: memory-bank-mcp
How to use it
Install prerequisites: Python 3.13+ and the Rust-based
rumdlMarkdown linter (installed via the Python dev environment; see Prerequisites).Run the server: Add the config snippet from Running the Server to your
mcp.json(most users pick uvx).Start with the plan → do → commit loop (see below). In your IDE/assistant, ask the agent to orchestrate these commands:
Start a session (get an orientation brief)
Load task-specific context
Follow the plan → do → commit loop
For new projects, use the initialize prompt to create the Memory Bank and .cortex/ structure.
Plan → do → commit
This is the daily workflow:
Step | What happens |
Plan | Create or refine plans in |
Do | Apply the next PENDING roadmap step with tests and quality checks. |
Commit | Run the full pre-commit pipeline and push only healthy commits. |
See docs/prompts for setup/migration prompt details.
If Cortex MCP cannot be reached in your environment, you can still do a read-only audit of the repo under the boundaries in AGENTS.md (MCP unavailable: read-only audit fallback) and the runbook MCP unavailable: read-only audits.
Features
Memory Bank — structured project context that persists across sessions
Session & Context — orientation briefs, token-budgeted context loading, end-of-session compaction
Validation & Quality — schema validation, lint/format/type auto-fix, pre-commit checks
Plans & Roadmap — plan lifecycle management tied to a roadmap
DRY Linking — transclusion engine to embed content without duplication
Shared Rules (Synapse) — cross-project rule and prompt sharing via Git submodule
Refactoring — pattern analysis, suggestions, safe execution with rollback
Token Optimization — context summarization and relevance scoring
Prerequisites
Python 3.13+
rumdl — Markdown linter/formatter installed into the Python environment (for example via
uv sync --extra dev, which adds therumdlCLI to.venv/bin/rumdl)
Running the Server
With uvx (recommended)
{
"mcpServers": {
"cortex": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/igrechuhin/Cortex.git",
"cortex"
]
}
}
}First run / IDE timeouts: uvx --from git+… must resolve GitHub HEAD, download dependencies, and build the package into uv’s cache. That can take minutes on a cold machine or right after uv cache clean. Some MCP clients time out during the first Initialize if the server is not ready yet. Pre-warm once in a terminal (same command you use in mcp.json), then start or reload the MCP client:
uvx --from git+https://github.com/igrechuhin/Cortex.git cortex --helpDetails: Getting started — Stable MCP setup, Troubleshooting — uvx cold start.
Project-level vs global config: Place the snippet in your project's .mcp.json rather than in the global client config. Project-level config lets Cortex resolve the correct workspace root immediately. A global config makes your client launch Cortex with CWD set to the home directory; Cortex falls back to a heuristic root-finder that can pick up stale .cortex/ state left in ~/ and show spurious setup prompts.
With Smithery
{
"mcpServers": {
"cortex": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@igrechuhin/cortex",
"--key",
"your_smithery_key"
]
}
}
}With Docker
{
"mcpServers": {
"cortex": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"19283744/cortex:latest"
]
}
}
}Manually
Clone the repository, then:
bash scripts/bootstrap.shOptionally initialize the Synapse submodule for shared rules:
git submodule update --init --recursiveAdd to your mcp.json:
{
"mcpServers": {
"cortex": {
"command": "uv",
"args": ["run", "cortex"]
}
}
}Developer commands
For local development, use these Make targets (after running bash scripts/bootstrap.sh once to create the virtualenv and install dependencies):
Dependency setup / connectivity triage: If
uv syncor installs fail (proxy, SSL, or registry access), use Dependency and network verification to separate environment setup failures from actual test failures.make preflight: Probe PyPI orUV_INDEX_URLbeforeuv syncwhen triaging connectivity; see Dependency and network verification.make bootstrap: Runscripts/bootstrap.shto create or update the.venvand install all dependencies.make check: Non-mutating local gate: verify Black onsrc/andtests/, Ruff lint, Pyright, then the fast test suite. Does not rewrite files; usemake fixwhen checks fail for formatting or auto-fixable lint.make fix: Apply Black, Ruff import sorting (I), and Ruff--fixonsrc/andtests/(mutating).make check-ci-parity: Run a broader subset of the GitHub Actions Code Quality workflow viauv run(synapse format/lint scripts, type checks, file/function limits, rumdl, pytest with coverage). Requiresuvon yourPATH. Still not identical to CI: spell check (cspell), the eval suite, Codecov, and health-check upload steps run only in Actions—see Troubleshooting — Local make check vs CI.make test: Run the default suite in parallel (-n auto), skip@pytest.mark.slow, no coverage (timeouts). Usemake check-ci-parityfor the full pytest+coverage command that matches CI.make test-full: Run the full test suite (including slower tests) with a longer timeout.make commit-check: Run the same checks asmake checkbefore using/cortex/commitfor the full commit pipeline. With Cortex MCP connected, Phase A / Step 12 use the zero-arg tools documented in docs/api/tools.md.
Key Tools
Cortex exposes 14 MCP tools, 6 static cortex:// resources, and up to 4 setup prompts (one always-on plus up to three configuration-dependent). Machine-readable inventory: docs/_generated/tool-inventory.json (must match cortex.discovery.published_inventory; CI enforces parity).
Published tools (canonical TOOL_CATEGORIES order — see docs/api/tools.md):
Tool | Purpose |
| Memory bank read/write (zero-arg reads activeContext.md) |
| Plan create/list/get/complete/register/archive_completed |
| Roadmap/progress/activeContext mutations |
| Session start, orientation, compact |
| Phase A quality checks and Step 12 final gate (zero-arg) |
| Auto-fix lint/format/types/markdown (zero-arg) |
| Reasoning scratchpad |
| Stage raw external sources under memory-bank for |
| Phase B docs validation (zero-arg) |
| Inter-phase state exchange (init/write/read/clear) |
| Allowlisted skill JSON and Synapse rule artifact writes |
| Compress project CLAUDE.md and memory-bank markdown to reduce session tokens |
| Memory-bank WAL read, anomaly hints, snapshot/restore |
| Draft/self-test a Synapse prompt/rule change in an isolated, always-removed worktree |
Read-only discovery uses resources (not in this table): cortex://health/connection, cortex://structure, cortex://context, cortex://rules, cortex://validation, cortex://analysis. Quick “do not” guidance: AGENTS.md quick reference.
Prompts
Prompts are for setup and migration; for daily work use plan → do → commit tools.
Situation | Prompt |
New project, no Memory Bank |
|
Legacy Memory Bank under |
|
Share rules across projects |
|
tiktoken cache missing (local encoding cache setup) |
|
Full prompt list: docs/prompts
Memory Bank Structure
The Memory Bank lives under .cortex/ and works with any editor, LLM, or agent.
.cortex/memory-bank/— core files: projectBrief, productContext, activeContext, systemPatterns, techContext, progress, roadmap.cortex/plans/— development plans linked to the roadmap.cortex/synapse/— shared rules and prompts (Git submodule).cortex/config/,.cortex/history/,.cortex/index.json— configuration, history, and metadata
Legacy layouts are migrated by the migrate prompt; see Getting started.
Documentation
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
- Flicense-quality-maintenanceAn MCP server that provides persistent project context, workflow management, and knowledge capture for AI coding agents. It enables agents to maintain structured memory across sessions by tracking project profiles, conventions, skills, and technical debt.7
- AlicenseBqualityBmaintenanceAn MCP server that gives AI assistants persistent memory across sessions. It stores project context, decisions, and progress in structured markdown files as well as a knowledge graph and sequential thinking for better memory storage.36371MIT
- Alicense-qualityDmaintenanceAn MCP server that provides persistent, cross-session memory and team knowledge sharing for AI development workflows. It enables project DNA scanning, semantic search, context budgeting, and git-aware indexing to prevent AI context loss between sessions.17MIT
- Alicense-qualityDmaintenanceA local-first MCP server and continuity control plane that helps AI coding tools maintain project state, tasks, and context across sessions, models, and interruptions, with features like session tracking, token-efficient context assembly, and code understanding via Code Atlas.MIT
Related MCP Connectors
The project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
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/igrechuhin/Cortex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server