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
acceptedLarge content accepted for asynchronous extraction
Longer notes may return 202 Accepted with a jobId and message for tracking extraction into atomic memories.

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",
      "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 scope-isolated 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 concise release notes",
    "category": "fact",
    "scope": "user_123"
  }'
Use scope when one API key serves multiple end users or tenants. Omit it only for global, unscoped memories.

5. Save a project memory inside that scope

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",
    "scope": "user_123",
    "project": "memcontext"
  }'

6. Connect the MCP server

For Claude.ai or Claude Desktop, add a custom connector with:
https://mcp.memcontext.in/mcp
Then click Connect, sign in to MemContext, and approve access. For coding assistants, you can still connect MemContext directly. 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 Claude.ai, Claude Desktop, Cursor, OpenCode, Codex CLI, and agent instructions.

TypeScript SDK

Install the SDK when integrating from a Node.js or TypeScript app:
npm install memcontext-sdk
import { MemContextClient } from "memcontext-sdk";

const client = new MemContextClient({
  apiKey: process.env.MEMCONTEXT_API_KEY!,
});

const userMemory = client.withScope("user_123");
const projectMemory = userMemory.withProject("memcontext");

await projectMemory.save({
  content: "User prefers concise release notes",
  category: "preference",
});

const results = await projectMemory.search({
  query: "How should release notes be written?",
});
Use withScope() for the hard end-user or tenant boundary. Use withProject() only as a grouping filter inside that scope.
  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 scope - isolate each app user or tenant into its own memory container
  5. Use projects - group project-specific knowledge inside that scope
  6. Give feedback - mark retrieved memories as helpful or outdated to improve quality