Skip to main content
MemContext provides a hosted MCP server. You can connect it directly to Claude.ai or Claude Desktop with OAuth, or use an API key for coding agents like Claude Code, Cursor, OpenCode, and Codex CLI.

Prerequisites

  • A MemContext account at app.memcontext.in
  • An API key if you are connecting a coding agent (create one under Settings > API Keys)
The MCP page in your dashboard generates ready-to-paste configs with your API key pre-filled.

Claude.ai & Claude Desktop

Use this path when you want everyday Claude conversations to remember preferences, project context, and recurring details without editing config files. Step 1 - Open Connectors In Claude.ai or Claude Desktop, open Settings → Connectors. Step 2 - Add a custom connector Choose Add custom connector. Step 3 - Enter the production URL Use:
https://mcp.memcontext.in/mcp
Step 4 - Connect and approve access Click Connect, sign in to MemContext if prompted, then approve the requested scopes on the consent screen. Paste this into Claude → Settings → Profile → Instructions for Claude:
- Search MemContext before assuming my preferences, projects, or past decisions.
- Save only stable preferences, recurring facts, and useful project context.
- Do not save one-off questions, random searches, or temporary details unless I ask you to remember them.
- Keep memory updates brief, accurate, and practical.
Claude.ai and Claude Desktop use OAuth for this flow. You do not need to paste API keys, headers, or config files.

Claude Code

Step 1 - Add the MCP server via CLI:
claude mcp add memcontext --scope user --transport http https://mcp.memcontext.in/mcp \
  --header "MEMCONTEXT-API-KEY:mc_your_key"
Or add this to ~/.claude.json:
{
  "mcpServers": {
    "memcontext": {
      "url": "https://mcp.memcontext.in/mcp",
      "headers": {
        "MEMCONTEXT-API-KEY": "mc_your_key"
      }
    }
  }
}
Step 2 - Add agent instructions to ~/.claude/CLAUDE.md:
# MemContext

At conversation start, ALWAYS call search_memory to load user context - do not skip.
Before making decisions or assumptions, search_memory to check for past context.
SAVE immediately (do not defer) when any of these happen:

- User shares a preference → save_memory(category: "preference")
- A technology or architecture decision is made → save_memory(category: "decision")
- User corrects you or says "remember" → save_memory(category: "fact")
- Important project fact learned → save_memory(category: "fact", project: "<known-project-name>")
- Significant work completed → save_memory(category: "context")
- MCP tools do not accept scope. Use the REST API or TypeScript SDK when an app needs hard per-user or per-tenant isolation.
- Use project only when a clear project/app name is already known. Good: "memcontext", "carq". Omit if unsure. Never invent vague names like "123" or "abc".
- MCP memories use automatic TTL. Use the REST API, TypeScript SDK, or dashboard when exact expiry is required.
- After using search results, call memory_feedback to rate memories as helpful/not_helpful/outdated/wrong.
- If a retrieved memory is wrong or outdated and you know the corrected fact, call update_memory with the corrected content. Feedback alone only changes retrieval ranking; update_memory changes the saved memory.
- Use delete_memory only when a memory was saved incorrectly and should be removed entirely.
- Duplicates are handled automatically - when in doubt, save.
- Memory persists across all sessions. Use project only for known project-specific context.

Cursor

Step 1 - Add this to ~/.cursor/mcp.json:
{
  "mcpServers": {
    "memcontext": {
      "url": "https://mcp.memcontext.in/mcp",
      "headers": {
        "x-api-key": "mc_your_key"
      }
    }
  }
}
Step 2 - Add the agent instructions to Cursor Settings > Rules and commands > User Rules.

OpenCode

Step 1 - Add the MCP server to ~/.config/opencode/opencode.json:
{
  "mcp": {
    "memcontext": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "mcp-remote",
        "https://mcp.memcontext.in/mcp",
        "--header",
        "MEMCONTEXT-API-KEY:mc_your_key"
      ],
      "enabled": true
    }
  }
}
Step 2 - Add the agent instructions to ~/.config/opencode/AGENTS.md.

Codex CLI

Step 1 - Add the MCP server to ~/.codex/config.toml:
[mcp_servers.memcontext]
url = "https://mcp.memcontext.in/mcp"

[mcp_servers.memcontext.http_headers]
MEMCONTEXT-API-KEY = "mc_your_key"
Step 2 - Add the agent instructions to ~/.codex/instructions.md.

Agent instructions

These instructions tell your AI assistant how and when to use MemContext. Add them to the preferences file for your client (listed above):
# MemContext

At conversation start, ALWAYS call search_memory to load user context - do not skip.
Before making decisions or assumptions, search_memory to check for past context.
SAVE immediately (do not defer) when any of these happen:

- User shares a preference → save_memory(category: "preference")
- A technology or architecture decision is made → save_memory(category: "decision")
- User corrects you or says "remember" → save_memory(category: "fact")
- Important project fact learned → save_memory(category: "fact", project: "<known-project-name>")
- Significant work completed → save_memory(category: "context")
- MCP tools do not accept scope. Use the REST API or TypeScript SDK when an app needs hard per-user or per-tenant isolation.
- Use project only when a clear project/app name is already known. Good: "memcontext", "carq". Omit if unsure. Never invent vague names like "123" or "abc".
- MCP memories use automatic TTL. Use the REST API, TypeScript SDK, or dashboard when exact expiry is required.
- After using search results, call memory_feedback to rate memories as helpful/not_helpful/outdated/wrong.
- If a retrieved memory is wrong or outdated and you know the corrected fact, call update_memory with the corrected content. Feedback alone only changes retrieval ranking; update_memory changes the saved memory.
- Use delete_memory only when a memory was saved incorrectly and should be removed entirely.
- Duplicates are handled automatically - when in doubt, save.
- Memory persists across all sessions. Use project only for known project-specific context.
ClientPreferences file
Claude Code~/.claude/CLAUDE.md
CursorCursor Settings > Rules and commands > User Rules
OpenCode~/.config/opencode/AGENTS.md
Codex CLI~/.codex/instructions.md

Available tools

Once connected, your assistant has access to five tools:
ToolPurpose
save_memoryPersist preferences, facts, decisions, and context
search_memoryFind relevant memories before responding
memory_feedbackRate memory quality after retrieval
update_memoryCorrect or refine an existing saved memory
delete_memoryRemove a memory by ID
See the MCP Tools section for parameter documentation.

Verifying the connection

After setup, ask Claude or your coding assistant:
“Search your memory for any information about me.”
If the connection is working, it will call search_memory and return results (or an empty set if no memories exist yet).