← 返回 Skills 市场
sopaco

cortex-mem-mcp

作者 Sopaco · GitHub ↗ · v2.7.0 · MIT-0
cross-platform ⚠ suspicious
93
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cortex-mem-mcp
功能描述
Persistent memory enhancement for AI agents. Store conversations, search memories with semantic retrieval, and recall context across sessions. Use this skill...
使用说明 (SKILL.md)

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:

# 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

Option 1: Install from crates.io (Recommended)

cargo install cortex-mem-mcp

After installation, verify:

cortex-mem-mcp --version

Option 2: Build from Source

# 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)
# .	arget\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):

[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-4o-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:6333"
collection_name = "cortex_memories"
embedding_dim = 1536
timeout_secs = 30

Step 2: Start Qdrant (Vector Database)

# 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:

{
  "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:

{
  "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:

{
  "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:

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

Command-line Arguments

Argument Default Description
--config / -c config.toml Path to configuration file
--tenant default Tenant ID for memory isolation
--auto-trigger-threshold 10 Message count to auto-trigger memory extraction
--auto-trigger-interval 300 Min seconds between auto-trigger executions
--auto-trigger-inactivity 120 Inactivity timeout to trigger extraction
--no-auto-trigger false Disable auto-trigger feature entirely

Environment Variables

Variable Description
CORTEX_DATA_DIR Override data directory path
RUST_LOG Logging 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.

{
  "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.

{
  "thread_id": "project-alpha"
}

This triggers:

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

Search Tools

search

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

{
  "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).

{
  "query": "what did we discuss about authentication",
  "scope": "project-alpha",
  "limit": 5
}

Navigation Tools

ls

List directory contents to browse the memory space.

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

Common URIs:

  • cortex://session - List all sessions
  • cortex://user - List user-level memories
  • cortex://user/preferences - User preference memories

explore

Smart exploration of memory space, combining search and browsing.

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

Tiered Access Tools

Memory is organized in layers for efficient context management:

Layer Size Purpose
L0 ~100 tokens Quick relevance checking (abstract)
L1 ~2000 tokens Understanding core information (overview)
L2 Full content Complete original content

abstract

Get L0 abstract layer for quick relevance checking.

{
  "uri": "cortex://session/project-alpha/conversation.md"
}

overview

Get L1 overview layer for understanding core information.

{
  "uri": "cortex://session/project-alpha/conversation.md"
}

content

Get L2 full content layer - the complete original content.

{
  "uri": "cortex://session/project-alpha/conversation.md"
}

Management Tools

delete

Delete a memory by its URI.

{
  "uri": "cortex://session/old-project/conversation.md"
}

layers

Generate L0/L1 layer files for memories.

{
  "thread_id": "project-alpha"
}

index

Index memory files for vector search.

{
  "thread_id": "project-alpha"
}

Memory URI Structure

Memories are organized using a URI scheme:

cortex://session/{thread_id}/conversation.md
cortex://user/{user_id}/preferences/{topic}.md
cortex://user/{user_id}/memories/{memory_id}.md

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:

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

[llm]
api_base_url = "https://api.openai.com/v1"
api_key = "your-api-key"
model_efficient = "gpt-4o-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
安全使用建议
This skill appears to be a legitimate local memory MCP server, but there are important mismatches and risks to consider before installing: - Registry vs. reality: The package metadata declares no required credentials, yet the SKILL.md instructs you to provide LLM and embedding API keys (OpenAI-style) in a config.toml. Treat that as a red flag — expect to supply secrets even if the registry doesn't list them. - Secrets storage: The example stores API keys in plain-text config files. Prefer using environment variables, OS credential stores, or secure vaulting, and avoid leaving API keys in files under your home directory unless you understand the risk. - Source validation: The skill points to a GitHub repo and releases. Before running cargo install or downloading binaries, review the upstream repository, verify release checksums/signatures if available, and inspect the code if you can. If the homepage or repo is unknown or untrusted, run in an isolated environment (VM or container). - Config edits: The instructions tell you to edit other apps' MCP config files (Claude, Cursor). Make a backup of any config file before editing, and ensure your MCP client is trustworthy and intentionally configured to call your local server. - Data protection: The server will persist user conversations and embeddings locally. Consider data retention, encryption at rest, and who can read the data directory (~/.cortex-data by default). What would change this assessment: explicit registry fields declaring the required env vars/primary credential (so the platform can surface them), a verified homepage/repository with signed releases, or SKILL.md advising secure handling of API keys (env vars/credential stores) would reduce the concern level. Without those, treat the skill as potentially risky and proceed cautiously.
功能分析
Type: OpenClaw Skill Name: cortex-mem-mcp Version: 2.7.0 The cortex-mem-mcp skill is a standard Model Context Protocol (MCP) server designed to provide persistent memory for AI agents using a vector database (Qdrant). The SKILL.md file provides legitimate installation instructions (via cargo or GitHub), configuration templates for API keys, and a comprehensive set of tools for semantic search and tiered data retrieval. There is no evidence of malicious intent, data exfiltration, or deceptive instructions; the requested permissions and configurations are consistent with the stated purpose of a memory-enhancement utility.
能力评估
Purpose & Capability
The name and description match the instructions: this is a local MCP memory server that uses an LLM + embeddings + Qdrant. That functionality legitimately requires an LLM/embedding API and a vector DB. However, the registry metadata declares no required environment variables, primary credential, or config paths while the SKILL.md explicitly instructs creating a config file with LLM and embedding API keys and editing MCP client config files — a mismatch between what the skill 'claims' it needs and what it actually instructs the operator to provide.
Instruction Scope
The SKILL.md directs the operator to install a binary (cargo / GitHub releases), create a local config.toml containing LLM and embedding API keys, start a local Qdrant instance (docker), and edit other applications' MCP configuration files (paths for Claude Desktop, Cursor). While these steps are expected for integrating an MCP server, they involve writing secrets to disk and modifying third-party app configuration files. The instructions do not limit or warn about storage of API keys in plaintext or recommend safer alternatives (e.g., env vars, system credential stores). The skill also suggests running with debug logging which may increase log verbosity and risk of sensitive data in logs.
Install Mechanism
No install spec is present in the registry (instruction-only), and the SKILL.md recommends standard sources: cargo install (crates.io), building from the GitHub repository, or downloading pre-built releases from the project's GitHub Releases page. Those sources are normal and expected; nothing in the instructions points to obscure third-party download hosts. Because installation is manual and from external sources, users should still verify the upstream repository and signed releases before installing.
Credentials
The runtime instructions require LLM and embedding API keys (OpenAI-style base URLs and api_key values) plus a Qdrant endpoint and local data directories, but the registry lists no required env vars or primary credential. This omission is important: the skill will expect secrets/configuration not declared to the platform, increasing the chance a user supplies credentials in unsafe ways (plaintext config files). The SKILL.md does list CORTEX_DATA_DIR and RUST_LOG as environment variables, but these are not sufficient — the LLM/embedding keys are only shown as fields in a TOML example.
Persistence & Privilege
The skill expects and documents running a persistent MCP server process (cortex-mem-mcp) and modifying MCP client configuration so the client will call that server. The registry flags (always:false, disable-model-invocation:false) are reasonable; the skill does not request an elevated platform privilege like always:true. Nonetheless, installing this will create a long-running local service that has access to stored memories and any API keys placed in its config, so the persistence and storage of sensitive material is a practical consideration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cortex-mem-mcp
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cortex-mem-mcp 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.7.0
- Added detailed documentation in SKILL.md covering usage, available tools, tiered memory access (L0/L1/L2), and best practices. - Clarified when and how to use each tool, including `store`, `commit`, `search`, `recall`, `ls`, `explore`, `abstract`, `overview`, `content`, `delete`, `layers`, and `index`. - Explained memory organization using URI schemes and provided practical workflow examples. - Documented MCP server requirements, configuration, and auto-trigger features for seamless setup and operation. - Improved guidance on persistent context, user preferences, and project knowledge management for AI agents.
元数据
Slug cortex-mem-mcp
版本 2.7.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

cortex-mem-mcp 是什么?

Persistent memory enhancement for AI agents. Store conversations, search memories with semantic retrieval, and recall context across sessions. Use this skill... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 93 次。

如何安装 cortex-mem-mcp?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cortex-mem-mcp」即可一键安装,无需额外配置。

cortex-mem-mcp 是免费的吗?

是的,cortex-mem-mcp 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

cortex-mem-mcp 支持哪些平台?

cortex-mem-mcp 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 cortex-mem-mcp?

由 Sopaco(@sopaco)开发并维护,当前版本 v2.7.0。

💬 留言讨论