> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memcontext.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first MemContext API and MCP calls in under 2 minutes.

## 1. Get an API key

Sign up at [app.memcontext.in](https://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

```bash theme={null}
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:**

```json theme={null}
{
  "id": "a1b2c3d4-...",
  "status": "saved"
}
```

The `status` field tells you what happened:

| Status      | Meaning                                            |
| ----------- | -------------------------------------------------- |
| `saved`     | New memory created                                 |
| `updated`   | New memory superseded an existing one              |
| `extended`  | New memory extends an existing one                 |
| `duplicate` | Content already exists, no new memory created      |
| `accepted`  | Large 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

```bash theme={null}
curl "https://api.memcontext.in/api/memories/search?query=What%20language%20does%20the%20user%20prefer" \
  -H "X-API-Key: mc_your_key"
```

**Response:**

```json theme={null}
{
  "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

```bash theme={null}
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

```bash theme={null}
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:

```text theme={null}
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:

```bash theme={null}
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](/guides/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:

```bash theme={null}
npm install memcontext-sdk
```

```typescript theme={null}
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.

## Recommended workflow

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
