> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Mem0 MCP server

The Mem0 MCP connector routes your AI agent's tool calls to Mem0's own MCP server through Scalekit. Each user signs in to Mem0 once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 11 tools.

**Authentication:** OAuth 2.1/DCR
**Categories:** AI
**Tools:** 11: 6 read, 2 write, 3 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=MEM0MCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Mem0 MCP connection

   In **AgentKit > Connections**, create a Mem0 MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for Mem0 MCP server, so you don't need to register an OAuth app.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'mem0mcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Mem0 MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'mem0mcp_get_memories',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "mem0mcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Mem0 MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="mem0mcp_get_memories",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'mem0mcp_get_event_status',
  toolInput: {
    event_id: '<event_id>',
  },
  connector: 'mem0mcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="mem0mcp_get_event_status",
    tool_input={
        "event_id": "<event_id>",
    },
    connection_name="mem0mcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `mem0mcp_get_event_status`

Get Event Status · Read-only

Check the status of a specific memory operation event by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `event_id` (`string`, required): UUID of the event to check.

Example input: `{"event_id":"<event_id>"}`

### `mem0mcp_get_memories`

Get Memories · Read-only

Page through memories using filters instead of search. Use filters to list specific memories. Common filter patterns: single user: {"AND": [{"user_id": "john"}]}, agent memories: {"AND": [{"agent_id": "agent_name"}]}. user_id is automatically added to filters if not provided.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `filters` (`string`, optional): Structured filters; user_id injected automatically.
- `page` (`string`, optional): 1-indexed page number when paginating.
- `page_size` (`string`, optional): Number of memories per page (default 10).
- `source` (`string`, optional): Event source tag (defaults to MCP if omitted).

Example input: `{}`

### `mem0mcp_get_memory`

Get Memory · Read-only

Fetch a single memory by ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `memory_id` (`string`, required): Exact memory_id to fetch.

Example input: `{"memory_id":"<memory_id>"}`

### `mem0mcp_list_entities`

List Entities · Read-only

List which users/agents/apps/runs currently hold memories.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `mem0mcp_list_events`

List Events · Read-only

List memory operation events with optional filters and pagination.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `event_type` (`string`, optional): Filter by type: ADD, SEARCH, UPDATE, DELETE, GET_ALL, DELETE_ALL.
- `page` (`string`, optional): 1-indexed page number.
- `page_size` (`string`, optional): Events per page (default 50, max 100).

Example input: `{}`

### `mem0mcp_search_memories`

Search Memories · Read-only

Run a semantic search over existing memories. Use filters to narrow results. Common filter patterns: single user: {"AND": [{"user_id": "john"}]}, agent memories: {"AND": [{"agent_id": "agent_name"}]}. user_id is automatically added to filters if not provided.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): Natural language description of what to find.
- `filters` (`string`, optional): Additional filter clauses (user_id injected automatically).
- `source` (`string`, optional): Event source tag (defaults to MCP if omitted).
- `top_k` (`string`, optional): Number of results to return (1-1000, default 10).

Example input: `{"query":"<query>"}`

### `mem0mcp_add_memory`

Add Memory · Write

Store a new preference, fact, or conversation snippet. Requires at least one: user_id, agent_id, or run_id. Returns an event_id for async polling via get_event_status.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `text` (`string`, required): Plain sentence summarizing what to store.
- `agent_id` (`string`, optional): Optional agent identifier.
- `app_id` (`string`, optional): Optional app identifier.
- `messages` (`string`, optional): Structured conversation history with `role`/`content`. Use when you have multiple turns.
- `metadata` (`string`, optional): Attach arbitrary metadata JSON to the memory.
- `run_id` (`string`, optional): Optional run identifier.
- `source` (`string`, optional): Event source tag (defaults to MCP if omitted).
- `user_id` (`string`, optional): Override the default user scope for this write.

Example input: `{"text":"<text>"}`

### `mem0mcp_update_memory`

Update Memory · Write

Overwrite an existing memory's text.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `memory_id` (`string`, required): Exact memory_id to overwrite.
- `text` (`string`, required): Replacement text for the memory.
- `source` (`string`, optional): Event source tag (defaults to MCP if omitted).

Example input: `{"memory_id":"<memory_id>","text":"<text>"}`

### `mem0mcp_delete_all_memories`

Delete All Memories · Destructive

Delete every memory in the given user/agent/app/run but keep the entity.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `agent_id` (`string`, optional): Optional agent scope to delete.
- `app_id` (`string`, optional): Optional app scope to delete.
- `run_id` (`string`, optional): Optional run scope to delete.
- `source` (`string`, optional): Event source tag (defaults to MCP if omitted).
- `user_id` (`string`, optional): User scope to delete; defaults to server user.

Example input: `{}`

### `mem0mcp_delete_entities`

Delete Entities · Destructive

Remove an entity and cascade-delete its memories.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `agent_id` (`string`, optional): Delete this agent and its memories.
- `app_id` (`string`, optional): Delete this app and its memories.
- `run_id` (`string`, optional): Delete this run and its memories.
- `user_id` (`string`, optional): Delete this user and its memories.

Example input: `{}`

### `mem0mcp_delete_memory`

Delete Memory · Destructive

Delete one memory after the user confirms its memory_id.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `memory_id` (`string`, required): Exact memory_id to delete.

Example input: `{"memory_id":"<memory_id>"}`

## Related

Other AI connectors ([all 156](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
