# Vault Cortex MCP server

> Gives AI agents hybrid search, task management, structured memory, and read/write access to an Obsidian vault without plugins.

- Repository: https://github.com/aliasunder/vault-cortex
- Page: https://hostedmcp.org/servers/aliasunder/vault-cortex
- Transport: remote
- Stars: 37
- License: MIT
- Latest version: 0.57.5

## Install

### Claude Code

```sh
claude mcp add --env MCP_AUTH_TOKEN=<YOUR_MCP_AUTH_TOKEN> vault-cortex -- docker run -i --rm ghcr.io/aliasunder/vault-cortex:0.57.5
```

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

```json
{
  "mcpServers": {
    "vault-cortex": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/aliasunder/vault-cortex:0.57.5"
      ],
      "env": {
        "MCP_AUTH_TOKEN": "<YOUR_MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "vault-cortex": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/aliasunder/vault-cortex:0.57.5"
      ],
      "env": {
        "MCP_AUTH_TOKEN": "<YOUR_MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "vault-cortex": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/aliasunder/vault-cortex:0.57.5"
      ],
      "env": {
        "MCP_AUTH_TOKEN": "<YOUR_MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

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

```toml
[mcp_servers.vault-cortex]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/aliasunder/vault-cortex:0.57.5"]

[mcp_servers.vault-cortex.env]
MCP_AUTH_TOKEN = "<YOUR_MCP_AUTH_TOKEN>"
```

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

```json
{
  "mcpServers": {
    "vault-cortex": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/aliasunder/vault-cortex:0.57.5"
      ],
      "env": {
        "MCP_AUTH_TOKEN": "<YOUR_MCP_AUTH_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MCP_AUTH_TOKEN` | yes | yes | Bearer token for MCP client authentication. Must match the Authorization header sent by clients. Generate with: openssl rand -hex 32 |
| `DAILY_NOTES_FOLDER` | no | no | Vault folder for daily notes. Overrides the folder configured in Obsidian's daily-notes plugin. When unset, read from the vault's .obsidian/daily-notes.json (an empty folder there follows Obsidian's new-note location), falling back to "Daily Notes" when that file is missing or unreadable. Set to / for the vault root. |
| `DAILY_NOTES_FORMAT` | no | no | Filename date format for daily notes (Moment.js tokens). Overrides the format configured in Obsidian's daily-notes plugin. When unset, read from the vault's .obsidian/daily-notes.json, falling back to "YYYY-MM-DD". |
| `DISABLED_TOOLS` | no | no | Hide individual tools by name, comma-separated. Subtractive only — it cannot re-enable a tool another setting hides; an unknown tool name stops the server at startup. |
| `EMBEDDING_ENABLED` | no | no | Enable or disable the embedding pipeline. When false, no ONNX model is downloaded, no vector tables are created, and search uses FTS5 only. |
| `FILE_TOOLS_ENABLED` | no | no | Enable or disable file tools (vault_read_file, vault_list_files). When false, file tools are hidden and server metadata omits file tool references. |
| `LOG_DIR` | no | no | Directory for log files that survive container re-creation. The container's own log is always written but discarded when the container is recreated; date-stamped files under LOG_DIR persist on the data volume. Default: /data/logs (remote image), $STORAGE_ROOT/data/logs (single-volume mode), none (local image). none keeps only the container log. |
| `LOG_LEVEL` | no | no | Logging verbosity. |
| `LOG_MAX_DAILY_MB` | no | no | Maximum MB per daily log file (1 MB = 1,000,000 bytes). Whole numbers of at least 1, or none to disable the cap. File logging pauses at the cap until midnight in TZ (UTC by default); console logging continues. |
| `LOG_RETENTION_DAYS` | no | no | Days to keep log files; cleanup runs at startup and each day. Only applies when LOG_DIR is a path. |
| `MAX_FILE_BYTES` | no | no | Largest file vault_read_file will read, in bytes. Reading a larger file returns an error instead of content. |
| `MAX_IMAGE_OUTPUT_BYTES` | no | no | Byte budget for images returned by vault_read_file, in binary bytes before base64 encoding. Images exceeding the budget are downscaled/recompressed server-side to fit; raise for clients that accept larger tool responses. |
| `MAX_PDF_RENDER_PAGES` | no | no | Maximum PDF pages to render as images when raw: true is set on vault_read_file. The per-page byte budget is MAX_IMAGE_OUTPUT_BYTES divided evenly across the rendered pages. |
| `MEMORY_DIR` | no | no | Vault folder for structured memory files (About Me-style notes). Memory tools are hidden when MEMORY_ENABLED is false, but this value still feeds the defaults for PROTECTED_PATHS and ORPHAN_EXCLUDE_FOLDERS. |
| `MEMORY_ENABLED` | no | no | Enable or disable the structured memory layer. When false, memory tools are hidden, bootstrap is skipped, and server metadata omits memory references. |
| `ORPHAN_EXCLUDE_FOLDERS` | no | no | Comma-separated vault folder names excluded from vault_find_orphans. Default: the daily notes folder, "Templates", and MEMORY_DIR. DAILY_NOTES_FOLDER wins; otherwise .obsidian/daily-notes.json is read per query (fallback "Daily Notes"; no daily folder when that setting is the vault root or empty). When set, replaces the defaults entirely. Set to a comma (,) to exclude nothing; an empty value uses the defaults. |
| `PROTECTED_PATHS` | no | no | Comma-separated vault folder names blocked from vault_delete_note and vault_move_note. Default: MEMORY_DIR plus the daily notes folder, read from DAILY_NOTES_FOLDER or .obsidian/daily-notes.json (default Daily Notes; none when that setting is the vault root or empty). When set, overrides the default entirely. |
| `PUBLIC_URL` | no | no | Public URL clients use to reach this server. Used as the OAuth issuer URL in discovery metadata. Override when exposing the server outside localhost or on a non-default port. |
| `READONLY_MODE` | no | no | Run the server read-only: every vault-writing tool is hidden, the memory folder is not auto-created, and server metadata omits write references. |
| `RERANK_MODE` | no | no | Cross-encoder reranking mode: blended (position-aware score blending after RRF fusion) or none (skip reranking). Only takes effect when EMBEDDING_ENABLED is true. |
| `SERVICE_DOCUMENTATION_URL` | no | no | Override the OAuth service documentation URL exposed via discovery metadata. |
| `TRUST_FORWARDED_HOPS` | no | no | How many entries from the end of the RFC 7239 Forwarded header's for= list to count to reach the client IP for OAuth rate limiting and request logs. 0 ignores the header; 1 when the proxy in front writes it (e.g. AWS API Gateway) and is the only way to reach the server; 2 when a CDN fronts that proxy and is the only way to reach it. |
| `TRUST_PROXY_HOPS` | no | no | Number of trusted reverse-proxy hops used to derive the client IP from X-Forwarded-For for OAuth rate limiting and request logs. With 0, injected forwarding headers are ignored. |
| `TZ` | no | no | IANA timezone for timestamps and daily note resolution. |
| `WINDOWS_MODE` | no | no | Windows bind-mount mode: enables filesystem polling for the file watcher and rename-based moves across the Docker Desktop/WSL2 bridge. Set to true when the vault lives on a Windows drive. |

## FAQ

### Does Vault Cortex require Obsidian to be running?

No. It works directly on the markdown files on disk, so Obsidian itself doesn't need to be open.

### How does Vault Cortex search an Obsidian vault?

It combines FTS5 keyword matching with vector semantic similarity through RRF fusion, then reranks results with a cross-encoder.

### How do I set up Vault Cortex locally?

Run the init command with npx; the CLI asks for your vault path, generates config and a token, and starts the server.

### Can I access my vault remotely from my phone?

Yes. You can deploy to Railway, Render, or your own VPS and connect from any MCP client, secured with OAuth 2.1.

### Does Vault Cortex support managing tasks?

Yes. It queries and updates Kanban-aware tasks by status, dates, or priority, and spawns the next occurrence of recurring tasks.
