# Cortex MCP server

> Gives AI clients persistent cross-session memory stored locally, with encrypted sync and 30 MCP tools for storing and retrieving context.

- Repository: https://github.com/gambletan/cortex
- Page: https://hostedmcp.org/servers/gambletan/cortex
- Transport: stdio
- Stars: 38
- License: MIT
- Latest version: 1.8.0

## Install

### Claude Code

```sh
claude mcp add cortex -- docker run -i --rm ghcr.io/gambletan/cortex:v1.8.0
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "cortex": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gambletan/cortex:v1.8.0"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "cortex": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gambletan/cortex:v1.8.0"
      ]
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "cortex": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gambletan/cortex:v1.8.0"
      ]
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.cortex]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/gambletan/cortex:v1.8.0"]
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "cortex": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gambletan/cortex:v1.8.0"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CORTEX_BIN` | no | no |  |
| `CORTEX_DB` | no | no |  |

## Tools (30)

- `memory_ingest`
- `memory_set_privacy`
- `memory_search`
- `memory_context`
- `memory_consolidate`
- `memory_infer`
- `memory_compress`
- `memory_stats`
- `memory_decay`
- `belief_observe`
- `belief_list`
- `fact_add`
- `fact_query`
- `preference_set`
- `preference_query`
- `person_resolve`
- `person_list`
- `contradiction_check`
- `relationship_extract`
- `sync_status`
- `sync_providers`
- `sync_enable`
- `sync_pull`
- `memory_archive`
- `memory_restore`
- `memory_delete`
- `memory_ingest_batch`
- `tag_list_taxonomy`
- `namespace_list`
- `person_merge`

## FAQ

### Does Cortex store my AI memory in the cloud?

No, memories are kept in a local SQLite file by default; cloud sync and sharing are explicit opt-in.

### Which MCP clients can use Cortex memory?

Any MCP client, including Claude Code and Claude Desktop, can connect to the cortex-mcp-server.

### How fast is Cortex compared to cloud memory APIs?

The README reports 156µs ingest and 568µs search, with no network round-trip.

### Does Cortex collect telemetry?

No, the local engine collects zero telemetry, which the project says is CI-enforced.

### Can Cortex work fully offline?

Yes, semantic search downloads a small model once, or you can disable embeddings entirely for offline use.
