Agent skill

Cortex Mem MCP

by sopaco in sopaco/cortex-mem

Persistent memory enhancement for AI agents. An agent skill from sopaco/cortex-mem.

MITAuto-check passedAgent Workflows

Install Cortex Mem MCP

skills CLI
$ npx skills add sopaco/cortex-mem --skill cortex-mem-mcp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sopaco/cortex-mem cortex-mem-mcp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sopaco/cortex-mem.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cortex-mem-mcp/skill .claude/skills/cortex-mem-mcp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cortex-mem-mcp
GitHub stars
312
Token cost
~2.8k tokens
SKILL.md length
689 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Persistent memory enhancement for AI agents. An agent skill from sopaco/cortex-mem.

  • Works in 5 steps: Create Configuration File → Start Qdrant (Vector Database) → Configure MCP Client → …
  • You need to remember user preferences
  • SKILL.md covers Prerequisites Check, Installation, Configuration and Command-line Arguments, plus 8 more sections
  • Calls cargo, git and docker; reaches api.openai.com

What it does

Cortex Mem MCP is an agent skill from sopaco/cortex-mem. Persistent memory enhancement for AI agents. Store conversations, search memories with semantic retrieval, and recall context across sessions. Use this skill when you need to remember user preferences, past conversations, project context, or any information that should persist beyond the current session. Provides tiered access (abstract/overview/content) for efficient context management.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Requires cortex-mem-mcp MCP server running with configured LLM and vector database (Qdrant). Needs API keys for LLM and embedding services.

It sits in Agent Workflows, covering MCP servers, Agent memory and Context engineering. It works with Model Context Protocol, Linux and macOS. The repository describes itself as: 🧠 The production-ready cognitive foundation for autonomous systems such as Embodied-AI and OpenClaw. For memory management, from extraction and search to automated optimization… The licence is MIT.

When your agent uses it

  • You need to remember user preferences
  • Past conversations
  • Project context
  • Any information that should persist beyond the current session

Example prompts

  • “/cortex-mem-mcp”

Requirements

  • Docker
  • Compatibility (from SKILL.md): Requires cortex-mem-mcp MCP server running with configured LLM and vector database (Qdrant). Needs API keys for LLM and embedding services.
  • Pre-approved tools (allowed-tools): store, search, recall, ls, explore, abstract, overview, content, commit, delete, layers, index

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Create Configuration File
  2. Start Qdrant (Vector Database)
  3. Configure MCP Client
  4. Restart Your MCP Client
  5. Verify Installation

What it can do on your machine

Read from SKILL.md and the folder at commit 82a1c83. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • store
    • search
    • recall
    • ls
    • explore
    • abstract
    • overview
    • content
    • commit
    • delete

    …and 2 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo
    • git
    • docker
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.openai.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires cortex-mem-mcp MCP server running with configured LLM and vector database (Qdrant). Needs API keys for LLM and embedding services.

    From compatibility in the SKILL.md frontmatter.

Context cost

Cortex Mem MCP loads about 2.8k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 689 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sopaco/cortex-mem at commit 82a1c83, republished under its MIT licence (© sopaco). 689 words, ~2,814 tokens.

Download SKILL.mdSave it as .claude/skills/cortex-mem-mcp/SKILL.md (or your agent's skills folder).
name
cortex-mem-mcp
description
Persistent memory enhancement for AI agents. Store conversations, search memories with semantic retrieval, and recall context across sessions. Use this skill when you need to remember user preferences, past conversations, project context, or any information that should persist beyond the current session. Provides tiered access (abstract/overview/content) for efficient context management.
allowed-tools
store, search, recall, ls, explore, abstract, overview, content, commit, delete, layers, index
compatibility
Requires cortex-mem-mcp MCP server running with configured LLM and vector database (Qdrant). Needs API keys for LLM and embedding services.
license
MIT
metadata.author
Sopaco
metadata.version
2.7.0
metadata.homepage
https://github.com/sopaco/cortex-mem
metadata.category
memory

Cortex Memory MCP Skill

This skill enables persistent memory capabilities for AI agents, allowing them to store, search, and recall information across sessions using semantic retrieval.

Prerequisites Check

Before configuring this skill, verify if cortex-mem-mcp is available in your system:

bash
# Check if cortex-mem-mcp is in PATH
which cortex-mem-mcp || where cortex-mem-mcp  # Linux/macOS || Windows

If the command returns a path, the binary is already installed. If not, proceed to the installation section below.

Installation

bash
cargo install cortex-mem-mcp

After installation, verify:

bash
cortex-mem-mcp --version
Option 2: Build from Source
bash
# Clone the repository
git clone https://github.com/sopaco/cortex-mem.git
cd cortex-mem

# Build the release binary
cargo build --release --bin cortex-mem-mcp

# The binary will be at:
# ./target/release/cortex-mem-mcp (Linux/macOS)
# .\target\release\cortex-mem-mcp.exe (Windows)
Option 3: Download Pre-built Binary

Download the latest release from GitHub:

Choose the appropriate binary for your platform:

  • cortex-mem-mcp-linux-x86_64 (Linux x64)
  • cortex-mem-mcp-darwin-arm64 (macOS Apple Silicon)
  • cortex-mem-mcp-darwin-x86_64 (macOS Intel)
  • cortex-mem-mcp-windows-x86_64.exe (Windows x64)

Configuration

Step 1: Create Configuration File

Create a config.toml file (e.g., ~/.config/cortex-mem/config.toml):

toml
[cortex]
# Data directory for storing memories
data_dir = "~/.cortex-data"

[llm]
# LLM API configuration
api_base_url = "https://api.openai.com/v1"
api_key = "your-api-key"
model_efficient = "gpt-5-mini"
temperature = 0.1
max_tokens = 65536

[embedding]
# Embedding configuration
api_base_url = "https://api.openai.com/v1"
api_key = "your-embedding-api-key"
model_name = "text-embedding-3-small"
batch_size = 10
timeout_secs = 30

[qdrant]
# Vector database configuration
url = "http://localhost:6334"
collection_name = "cortex_memories"
embedding_dim = 1536
timeout_secs = 30
Step 2: Start Qdrant (Vector Database)
bash
# Using Docker
docker run -d -p 6333:6333 qdrant/qdrant

# Verify Qdrant is running
curl http://localhost:6333
Step 3: Configure MCP Client

Configure your MCP client (e.g., Claude Desktop, Cursor, etc.) to use cortex-mem-mcp.

Claude Desktop

Edit the configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Add the following configuration:

json
{
  "mcpServers": {
    "cortex-memory": {
      "command": "cortex-mem-mcp",
      "args": [
        "--config", "/path/to/config.toml",
        "--tenant", "default"
      ],
      "env": {
        "RUST_LOG": "info"
      }
    }
  }
}

If you built from source, use the full path to the binary:

json
{
  "mcpServers": {
    "cortex-memory": {
      "command": "/path/to/cortex-mem/target/release/cortex-mem-mcp",
      "args": [
        "--config", "/path/to/config.toml",
        "--tenant", "default"
      ]
    }
  }
}
Cursor IDE

Add to your Cursor MCP settings:

json
{
  "mcpServers": {
    "cortex-memory": {
      "command": "cortex-mem-mcp",
      "args": ["--config", "/path/to/config.toml"]
    }
  }
}
Step 4: Restart Your MCP Client

After configuration, restart Claude Desktop or your MCP client to load the new server.

Step 5: Verify Installation

Test the MCP server manually:

bash
# Run with debug logging
RUST_LOG=debug cortex-mem-mcp --config /path/to/config.toml --tenant default

Command-line Arguments

ArgumentDefaultDescription
--config / -cconfig.tomlPath to configuration file
--tenantdefaultTenant ID for memory isolation
--auto-trigger-threshold10Message count to auto-trigger memory extraction
--auto-trigger-interval300Min seconds between auto-trigger executions
--auto-trigger-inactivity120Inactivity timeout to trigger extraction
--no-auto-triggerfalseDisable auto-trigger feature entirely

Environment Variables

VariableDescription
CORTEX_DATA_DIROverride data directory path
RUST_LOGLogging level (debug, info, warn, error)

When to Use This Skill

Use this skill when you need to:

  • Remember user preferences - Store and recall user-specific settings, preferences, and context
  • Persist conversation context - Keep important information from past conversations accessible
  • Build project knowledge - Accumulate and retrieve project-specific information over time
  • Track user-agent interactions - Maintain a history of interactions for better personalization
  • Search memories semantically - Find relevant information using natural language queries

Available Tools

Storage Tools
store

Add a message to memory for a specific session.

json
{
  "content": "The user prefers dark mode in all applications",
  "thread_id": "project-alpha",
  "role": "user"
}
  • content: The message content to store
  • thread_id: Optional session/thread identifier (defaults to "default")
  • role: Message role - "user", "assistant", or "system"
commit

Commit accumulated conversation content and trigger memory extraction.

json
{
  "thread_id": "project-alpha"
}

This triggers:

  • Memory extraction (session → user/agent memories)
  • L0/L1 layer generation
  • Vector indexing
Search Tools

Layered semantic search across memory using L0/L1/L2 tiered retrieval.

json
{
  "query": "user preferences for UI",
  "scope": "project-alpha",
  "limit": 10,
  "min_score": 0.5,
  "return_layers": ["L0", "L1"]
}
recall

Recall memories with full context (L0 snippet + L2 content).

json
{
  "query": "what did we discuss about authentication",
  "scope": "project-alpha",
  "limit": 5
}
Show full SKILL.md (276 more words)Show less
Navigation Tools
ls

List directory contents to browse the memory space.

json
{
  "uri": "cortex://session",
  "recursive": true,
  "include_abstracts": true
}

Common URIs:

  • cortex://session - List all sessions
  • cortex://user - List user-level memories
  • cortex://user/{user_id}/preferences - User preference memories
explore

Smart exploration of memory space, combining search and browsing.

json
{
  "query": "authentication implementation details",
  "start_uri": "cortex://session",
  "return_layers": ["L0"]
}
Tiered Access Tools

Memory is organized in layers for efficient context management:

LayerSizePurpose
L0~100 tokensQuick relevance checking (abstract)
L1~2000 tokensUnderstanding core information (overview)
L2Full contentComplete original content
abstract

Get L0 abstract layer for quick relevance checking.

json
{
  "uri": "cortex://session/project-alpha/timeline/2024-03/15/10_30_45_abc123.md"
}
overview

Get L1 overview layer for understanding core information.

json
{
  "uri": "cortex://session/project-alpha/timeline/2024-03/15/10_30_45_abc123.md"
}
content

Get L2 full content layer - the complete original content.

json
{
  "uri": "cortex://session/project-alpha/timeline/2024-03/15/10_30_45_abc123.md"
}
Management Tools
delete

Delete a memory by its URI.

json
{
  "uri": "cortex://session/old-project/timeline/2024-03/15/10_30_45_xyz.md"
}
layers

Generate L0/L1 layer files for memories.

json
{
  "thread_id": "project-alpha"
}
index

Index memory files for vector search.

json
{
  "thread_id": "project-alpha"
}

Memory URI Structure

Memories are organized using a URI scheme:

cortex://session/{thread_id}/timeline/{YYYY-MM}/{DD}/{HH_MM_SS}_{id}.md
cortex://user/{user_id}/preferences/{topic}.md
cortex://user/{user_id}/entities/{name}.md
cortex://user/{user_id}/events/{name}.md
cortex://agent/{agent_id}/cases/{name}.md
cortex://agent/{agent_id}/skills/{name}.md

Note: Session dimension stores conversation timeline; extracted memories (preferences, entities, etc.) are stored in user/agent dimensions after commit.

Best Practices

  1. Use meaningful thread IDs - Use descriptive names like project-alpha or user-123-support instead of generic IDs

  2. Commit periodically - Call commit after significant conversation milestones to ensure memory extraction

  3. Start with search - Before storing new information, search to avoid duplication

  4. Use tiered access - Start with abstract or search to find relevant memories, then use overview or content for details

  5. Scope your searches - Use the scope parameter to limit searches to relevant sessions

Example Workflow

Storing a User Preference
1. Store the preference:
   store(content="User prefers TypeScript over JavaScript for all new projects", role="user")

2. Commit to persist:
   commit()
Recalling Past Context
1. Search for relevant memories:
   search(query="TypeScript preferences", limit=5)

2. Get overview of most relevant result:
   overview(uri="cortex://user/default/preferences/typescript.md")
Building Project Knowledge
1. Store project decisions:
   store(content="Decided to use PostgreSQL for the main database", thread_id="project-x", role="assistant")

2. Later, recall project decisions:
   recall(query="database decisions", scope="project-x")

Auto-Trigger Feature

The MCP server supports automatic memory processing:

  • Triggers after configurable message count threshold (default: 10)
  • Triggers after inactivity timeout (default: 2 minutes)
  • Can be disabled with --no-auto-trigger flag

Configuration

The MCP server requires a config.toml with:

toml
[cortex]
data_dir = "./cortex-data"

[llm]
api_base_url = "https://api.openai.com/v1"
api_key = "your-api-key"
model_efficient = "gpt-5-mini"

[embedding]
api_base_url = "https://api.openai.com/v1"
api_key = "your-api-key"
model_name = "text-embedding-3-small"

[qdrant]
url = "http://localhost:6333"
collection_name = "cortex_mem"
embedding_dim = 1536

© sopaco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in cortex-mem-mcp/skill of sopaco/cortex-mem.

Open the folder on GitHubat commit 82a1c83

Compare with similar skills

Cortex Mem MCP next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cortex Mem MCP compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cortex Mem MCP this skillsopaco/cortex-mem312—~2.8kAutomated safety check: PassMIT
LemmalogJordyZomer/lemmalog329—~2.8kAutomated safety check: PassMIT
Mps Project ManagementJetBrains/MPS1.7k—~2.2kAutomated safety check: PassApache-2.0
Gearcoleco Romhackingdrhelius/Gearcoleco141—~3.9kAutomated safety check: PassGPL-3.0
Context Mode Searchmksglu/context-mode26k—~250Automated safety check: PassCustom licence
AI Memory Obsidiankipperacademy/skillpper134—~1.4kAutomated safety check: NotesNone

Similar skills

  • Lemmalog

    JordyZomer/lemmalog

    Externalize working memory and logical state into the lemmalog Datalog engine (MCP).

    329 GitHub stars~2.8k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check passed
  • Official

    Open an MPS project in a running or freshly started MPS instance when MCP tools fail because no project is open (welcome screen), close an open project with mpsmcpcloseproject, or create a new empty…

    1.7k GitHub stars~2.2k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Gearcoleco Romhacking

    drhelius/Gearcoleco

    Hack, modify, and translate ColecoVision and Super Game Module ROMs using the Gearcoleco emulator MCP server.

    141 GitHub stars~3.9k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Context Mode Search

    mksglu/context-mode

    Search context-mode's persistent FTS5 knowledge base for previously indexed local project content, documentation, or session memory. Trigger…

    26k GitHub stars~250 tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • AI Memory Obsidian

    kipperacademy/skillpper

    Portable workflows for persistent memory and Obsidian across macOS, Linux, and Windows.

    134 GitHub stars~1.4k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check: notes
  • Ogham Research

    ogham-mcp/ogham-mcp

    Structured memory capture for Ogham shared memory. An agent skill from ogham-mcp/ogham-mcp.

    115 GitHub stars~1.4k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed

Categories

Questions about Cortex Mem MCP

What does Cortex Mem MCP do?

Persistent memory enhancement for AI agents. An agent skill from sopaco/cortex-mem. Cortex Mem MCP is an agent skill from sopaco/cortex-mem. Persistent memory enhancement for AI agents.

When should I use Cortex Mem MCP?

Cortex Mem MCP fits situations like: you need to remember user preferences; past conversations; project context; any information that should persist beyond the current session.

How do I install Cortex Mem MCP in Claude Code?

Run `npx skills add sopaco/cortex-mem --skill cortex-mem-mcp -a claude-code`. Or copy the skill folder (cortex-mem-mcp/skill in sopaco/cortex-mem) into .claude/skills/cortex-mem-mcp in your project. Claude Code loads it when a task matches its description.

How do I install Cortex Mem MCP in Codex?

Run `npx skills add sopaco/cortex-mem --skill cortex-mem-mcp -a codex`. Or copy the skill folder (cortex-mem-mcp/skill in sopaco/cortex-mem) into .agents/skills/cortex-mem-mcp in your project. Codex loads it when a task matches its description.

Can I use Cortex Mem MCP in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sopaco/cortex-mem --skill cortex-mem-mcp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cortex-mem-mcp, .gemini/skills/cortex-mem-mcp, .github/skills/cortex-mem-mcp and .opencode/skills/cortex-mem-mcp in your project.

What does Cortex Mem MCP need to run?

Going by SKILL.md and its folder, Cortex Mem MCP needs the command-line tools its instructions call (cargo, git, docker and curl). Our summary lists: Docker. Its frontmatter pre-approves these tools: store, search, recall, ls, explore, abstract, overview, content, commit, delete, layers, index. Compatibility (from SKILL.md): Requires cortex-mem-mcp MCP server running with configured LLM and vector database (Qdrant). Needs API keys for LLM and embedding services..

Does Cortex Mem MCP access the network?

SKILL.md names 1 domain. In commands or code: api.openai.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Cortex Mem MCP safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cortex Mem MCP use?

Cortex Mem MCP is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cortex Mem MCP use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cortex Mem MCP?

Skills that share tags, products or a category with Cortex Mem MCP: Lemmalog (JordyZomer/lemmalog, 329 stars), Mps Project Management (JetBrains/MPS, 1.7k stars), Gearcoleco Romhacking (drhelius/Gearcoleco, 141 stars) and Context Mode Search (mksglu/context-mode, 26k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cortex Mem MCP?

sopaco (a GitHub user) maintains it in sopaco/cortex-mem, which has 312 GitHub stars. The repository was last updated on July 22, 2026.

Source: sopaco/cortex-mem on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.