Claude Code & Claude Desktop
Claude integrates with Contox through the Model Context Protocol (MCP), giving it native access to 23 tools for loading, searching, saving, and managing project memory. This is the deepest integration available.
What you get
With MCP, Claude can:
- Load the full project brain at session start (
contox_get_memory) - Search memory semantically (
contox_search) - Build focused context packs for specific tasks (
contox_context_pack) - Save structured session work when you ask (
contox_save_session) - Scan your codebase (
contox_scan) - Digest git history (
contox_git_digest) - Manage contexts, links, entries, and the knowledge graph
- Run memory hygiene analysis (
contox_hygiene)
All 23 tools are documented in the MCP Server Reference.
Prerequisites
- Node.js 18+ installed
- Contox MCP server installed:
npm install -g @contox/mcp-server - A Contox account with an API key and a project
Setup for Claude Code (.mcp.json)
Claude Code reads MCP server configuration from a .mcp.json file in your project root.
Create .mcp.json in your workspace:
{
"mcpServers": {
"contox": {
"command": "contox-mcp",
"env": {
"CONTOX_API_KEY": "your-api-key",
"CONTOX_API_URL": "https://contox.dev",
"CONTOX_TEAM_ID": "your-team-id",
"CONTOX_PROJECT_ID": "your-project-id"
}
}
}
}
Replace the placeholder values with your actual credentials from the Contox dashboard.
Add .mcp.json to your .gitignore to avoid committing API keys to version control.
Setup for Claude Desktop
Claude Desktop uses a global configuration file.
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the Contox server to your configuration:
{
"mcpServers": {
"contox": {
"command": "contox-mcp",
"env": {
"CONTOX_API_KEY": "your-api-key",
"CONTOX_API_URL": "https://contox.dev",
"CONTOX_TEAM_ID": "your-team-id",
"CONTOX_PROJECT_ID": "your-project-id"
}
}
}
}
Restart Claude Desktop after saving the configuration. The Contox tools will appear in the tools list.
Automatic setup via VS Code extension
The easiest way to configure Claude is through the VS Code extension setup wizard:
- Run Contox: Setup Wizard from the command palette
- Complete the login, team, and project steps
- In Step 4, check Claude (checked by default)
- The extension creates
.mcp.jsonwith your credentials pre-filled
The extension also stores the HMAC secret for auto-capture signing.
CLAUDE.md injection
In addition to the MCP server, Contox injects a memory summary into your CLAUDE.md file between markers:
<!-- contox:start -->
# Contox — Auto-generated Project Context
...memory summary here...
<!-- contox:end -->
Your own content outside the markers is preserved. This gives Claude Code additional context even before MCP tools are invoked.
How a session works
- Session starts -- Claude calls
contox_get_memoryto load the full project brain - During work -- Claude uses tools as needed:
contox_searchto find relevant memory,contox_context_packfor focused context,contox_scanfor codebase analysis - Session end -- When you say "save", Claude calls
contox_save_sessionwith a structured summary
Claude will never call contox_save_session automatically. Saving is always user-initiated to avoid mixing contexts when working on multiple tasks.
Environment variables
The MCP server accepts these environment variables:
| Variable | Required | Description |
|---|---|---|
CONTOX_API_KEY | Yes | Your Contox API key |
CONTOX_API_URL | No | API base URL (default: https://contox.dev) |
CONTOX_TEAM_ID | Yes | Your team ID |
CONTOX_PROJECT_ID | Yes | Your project ID |
CONTOX_HMAC_SECRET | No | HMAC secret for V2 ingest signing |
Verifying the connection
After setup, start a new Claude session and ask it to load project memory. You should see Claude invoke the contox_get_memory tool and return your project's brain document.
Next steps
- MCP Server Overview -- Full reference for all 23 tools
- Cursor Integration -- Add file-based integration alongside MCP