Claude Code
Set up MemNexus memory in Claude Code (CLI) via MCP.
Claude Code supports MCP servers, letting it access MemNexus memory during coding sessions. This means Claude Code can remember your project context, coding preferences, and past debugging sessions.
Prerequisites
You must have Claude Code installed and a MemNexus API key before proceeding. If you do not have an API key, sign up at memnexus.ai first.
- Claude Code installed
- A MemNexus API key (sign up)
- Node.js 18+ installed
Setup
1. Add the MCP server
Configure MemNexus as an MCP server in your Claude Code settings. Add to your MCP configuration:
{
"mcpServers": {
"memnexus": {
"command": "npx",
"args": ["@memnexus-ai/mcp-server"],
"env": {
"MEMNEXUS_API_KEY": "cmk_live_xxx.yyy"
}
}
}
}
2. Verify
Start a Claude Code session and ask:
"Search my memories for recent coding context"
What Claude Code remembers
With MemNexus, Claude Code can recall:
- Project structure — Tech stack, architecture, conventions
- Coding patterns — Error handling, API patterns, component structure
- Past decisions — Why you chose a particular approach
- Bug fixes — Root causes and solutions from past debugging
- Preferences — Formatting, libraries, naming conventions
Usage patterns
Automatic context loading
Add to your project's instructions:
At the start of each session, search MemNexus for context about this project
using the project name. Use the results to understand existing patterns
and conventions before making changes.
Saving debugging sessions
When you fix a tricky bug, Claude Code can save the resolution:
"Save a memory about this fix — the CORS issue was caused by the API gateway stripping the credentials header"
Building project knowledge
Over time, Claude Code builds a knowledge base about your project:
Session 1: Learns project structure and tech stack
Session 2: Learns error handling patterns
Session 3: Learns deployment process
Session 4: Applies all accumulated knowledge
Tips
- Use with CLAUDE.md — Combine MemNexus memory with project-level CLAUDE.md for both persistent and per-project context
- Save before switching — When switching between projects, save your current context
- Topic by project — Use project names as topics to keep memories organized
Troubleshooting
If tools aren't working:
- Check that the MCP server configuration is valid JSON
- Ensure
npxis in your PATH - Verify the API key:
mx auth status - Restart Claude Code
Next steps
- Cursor — Set up memory in Cursor
- Agent Patterns — Design patterns for coding assistants
- MCP Integration — Full tool reference