Skip to main content

1. Get an API key

Sign up at app.memcontext.in and create an API key from Settings > API Keys. Your key will look like mc_abc123... and is shown only once — store it securely.

2. Save a memory

curl -X POST https://api.memcontext.in/api/memories \
  -H "Content-Type: application/json" \
  -H "X-API-Key: mc_your_key" \
  -d '{
    "content": "User prefers TypeScript over JavaScript for type safety",
    "category": "preference"
  }'
Response:
{
  "id": "a1b2c3d4-...",
  "status": "saved"
}
The status field tells you what happened:
StatusMeaning
savedNew memory created
updatedNew memory superseded an existing one
extendedNew memory extends an existing one
duplicateContent already exists, no new memory created

3. Search memories

curl "https://api.memcontext.in/api/memories/search?query=What%20language%20does%20the%20user%20prefer" \
  -H "X-API-Key: mc_your_key"
Response:
{
  "found": 1,
  "memories": [
    {
      "id": "a1b2c3d4-...",
      "content": "User prefers TypeScript over JavaScript for type safety",
      "category": "preference",
      "project": null,
      "relevance": 0.92,
      "createdAt": "2026-04-11T12:00:00.000Z"
    }
  ]
}
Use full natural-language sentences as queries for best results. Keywords alone reduce match quality.

4. Save a project-scoped memory

curl -X POST https://api.memcontext.in/api/memories \
  -H "Content-Type: application/json" \
  -H "X-API-Key: mc_your_key" \
  -d '{
    "content": "This project uses PNPM as the package manager",
    "category": "fact",
    "project": "memcontext"
  }'

5. Connect the MCP server

Add MemContext to your AI coding assistant. For example, with Claude Code:
claude mcp add memcontext --scope user --transport http https://mcp.memcontext.in/mcp \
  --header "MEMCONTEXT-API-KEY:mc_your_key"
No local installation required. Once connected, your assistant can call save_memory and search_memory directly. See MCP Setup for Cursor, OpenCode, Codex CLI, and agent instructions.
  1. Search first — check for existing context before making assumptions
  2. Save when durable — persist stable preferences, decisions, and project facts
  3. Use categories — tag memories so they can be filtered later
  4. Use projects — scope project-specific knowledge so it does not pollute general memory
  5. Give feedback — mark retrieved memories as helpful or outdated to improve quality