Skip to content
Docs/Setup
Setup Guide

Install in 2 minutes

One command installs the MCP server and connects it to your AI editor. No config files to write, no API keys needed.

1

Run the setup command

This installs the MCP server and connects it to your AI editor in one command. It auto-detects Claude Code, Cursor, and Windsurf.

shell
npx context-vault setup

Setup will:

  • Install the context-vault npm package globally
  • Detect your AI client and write the MCP config to the correct location
  • Install the agent rules file (optional, recommended)
  • Print every file path it creates or modifies

Use --dry-run to preview without writing, --no-rules to skip agent rules.

2

Restart your AI editor

MCP connections are established on editor startup. Restart Claude Code, Cursor, or Windsurf after setup completes.

After restart, your AI editor will connect to the context-vault MCP server automatically. You can verify the connection by asking your AI:

prompt
What MCP tools do you have available?

You should see get_context, save_context, and list_context in the response.

3

Save your first entry

Ask your AI to save something to the vault. It'll use the save_context MCP tool automatically.

prompt
Save this decision to the vault: we're using SQLite for local storage because it requires no infra and the data stays on the machine. Tag it as architecture.

Your AI will call save_context with the title, body, tags, and kind. The entry is saved as a markdown file in your vault folder and indexed in a local SQLite database.

4

Retrieve it in a new session

Start a new AI session and ask about the thing you saved. It retrieves from the vault automatically.

prompt
What database are we using and why?

The agent rules file (installed in step 1) teaches your AI to search the vault before answering questions about architecture, decisions, or past work. It will call get_context and surface the entry you saved.

Config paths by client

Setup writes the MCP config automatically. Here are the exact paths for reference or manual setup.

Claude Code

MCP config:~/.claude/mcp.json

Agent rules are installed to ~/.claude/rules/context-vault.md

Cursor

MCP config:.cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Agent rules are appended to .cursorrules in your project root.

Windsurf

MCP config:~/.codeium/windsurf/mcp_config.json

Agent rules are appended to .windsurfrules in your project root.

Agent-assisted setup (optional)

After the CLI setup, run this in your AI session for conflict detection, project-aware bucket configuration, and rule merging:

prompt
/vault setup

The agent verifies the MCP connection, scans existing rules for conflicts, detects active projects, and configures vault buckets. It shows everything before writing and never modifies user-written files.

Requirements

Node.js: 22 or later
Package manager: npm or pnpm
AI client: Any MCP-compatible client
OS: macOS, Linux, Windows