# How to integrate Mem0 MCP with OpenCode

```json
{
  "title": "How to integrate Mem0 MCP with OpenCode",
  "toolkit": "Mem0",
  "toolkit_slug": "mem0",
  "framework": "OpenCode",
  "framework_slug": "opencode",
  "url": "https://composio.dev/toolkits/mem0/framework/opencode",
  "markdown_url": "https://composio.dev/toolkits/mem0/framework/opencode.md",
  "updated_at": "2026-05-06T08:19:49.118Z"
}
```

## Introduction

### How to integrate Mem0 MCP with OpenCode
This guide explains how to connect Mem0 MCP to OpenCode using Composio Connect, which simplifies OAuth, API changes, and reliability concerns.
There are two ways to set this up:
- Via [Composio Connect MCP](https://dashboard.composio.dev/)
- Via the [Composio CLI](https://dashboard.composio.dev/)

## Also integrate Mem0 with

- [ChatGPT](https://composio.dev/toolkits/mem0/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/mem0/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/mem0/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/mem0/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/mem0/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/mem0/framework/codex)
- [Cursor](https://composio.dev/toolkits/mem0/framework/cursor)
- [VS Code](https://composio.dev/toolkits/mem0/framework/vscode)
- [OpenClaw](https://composio.dev/toolkits/mem0/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/mem0/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/mem0/framework/cli)
- [Google ADK](https://composio.dev/toolkits/mem0/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/mem0/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/mem0/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/mem0/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/mem0/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/mem0/framework/crew-ai)

## TL;DR

### Why use Composio?
Composio provides a single MCP server or CLI tool that exposes a set of meta-tools, allowing you to:
- Connect to 1,000+ apps with on-demand tool loading, so you do not fill your LLM context window with unnecessary tool definitions.
- Use programmatic tool calling through a remote Bash tool, letting LLMs write their own code to handle complex tool chaining. This reduces back-and-forth for frequent tool calls.
- Handle large tool responses outside the LLM context to keep conversations lean.

## Connect Mem0 to OpenCode

### Connect Mem0 with OpenCode
### Option 1: Using Composio CLI
### 1. Install Composio CLI
Install the Composio CLI, authenticate, and initialize your project:

```bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login
```

## What is the Mem0 MCP server, and what's possible with it?

The Mem0 MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Mem0 account. It provides structured and secure access to your notes, projects, and organizational knowledge, so your agent can perform actions like searching memories, managing users, adding content, and orchestrating agent runs on your behalf.
- AI-powered memory search and recall: Let your agent search and retrieve existing memory entries using advanced filters and pagination to surface just the right note or piece of information.
- Automated content and note creation: Have your agent store new memory records from conversations, meetings, or tasks—ensuring nothing slips through the cracks.
- Collaboration and organization management: Direct your agent to add members to projects or organizations, assign roles, and keep team structures up to date.
- Agent and application orchestration: Enable your agent to create new AI agents, initiate agent runs, and manage applications for custom workflows and automation.
- Structured knowledge export and reporting: Ask your agent to initiate export jobs with specific schemas and filters, so you can back up or analyze your stored knowledge on demand.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `MEM0_ADD_MEMBER_TO_PROJECT` | Add member to project | Adds an existing user to a project (identified by `project id` within organization `org id`), assigning a valid system role. |
| `MEM0_ADD_NEW_MEMORY_RECORDS` | Add new memory records | Stores new memory records from a list of messages, optionally inferring structured content; requires association via `agent id`, `user id`, `app id`, or `run id`. |
| `MEM0_ADD_ORGANIZATION_MEMBER` | Add organization member | Adds a new member, who must be a registered user, to an organization, assigning them a specific role. |
| `MEM0_CREATE_A_NEW_AGENT` | Create a new agent | Creates a new agent with a unique `agent id` and an optional `name`; additional metadata may be assigned by the system. |
| `MEM0_CREATE_A_NEW_AGENT_RUN` | Create a new agent run | Creates a new agent run in the mem0.ai system. |
| `MEM0_CREATE_A_NEW_APPLICATION` | Create a new application | Creates a new application, allowing metadata to be passed in the request body (not an explicit field in this action's request model); ensure `app id` is unique to avoid potential errors or unintended updates. |
| `MEM0_CREATE_A_NEW_ORGANIZATION_ENTRY` | Create a new organization entry | Creates a new organization entry using the provided name and returns its details. |
| `MEM0_CREATE_A_NEW_USER` | Create a new user | Creates a new user with the specified unique `user id` and supports associating `metadata` (not part of the request schema fields). |
| `MEM0_CREATE_AN_EXPORT_JOB_WITH_SCHEMA` | Create an export job with schema | Initiates an asynchronous job to export memories, structured by a schema provided in the request body and allowing optional filters. |
| `MEM0_CREATE_MEMORY_ENTRY` | Create memory entry | Lists/searches existing memory entries with filtering and pagination; critically, this action retrieves memories and does *not* create new ones, despite its name. |
| `MEM0_CREATE_PROJECT` | Create project | Creates a new project with a given name within an organization that must already exist. |
| `MEM0_DELETE_AN_ORGANIZATION` | Delete an organization | Permanently deletes an existing organization identified by its unique id. |
| `MEM0_DELETE_A_SPECIFIC_MEMORY_BY_ID` | Delete memory by id | Permanently deletes a specific memory by its unique id; ensure the `memory id` exists as this operation is irreversible. |
| `MEM0_DELETE_ENTITY_BY_TYPE_AND_ID` | Delete entity by type and id | Call to permanently and irreversibly hard-delete an existing entity (user, agent, app, or run) and all its associated data, using its type and id. |
| `MEM0_DELETE_MEMORIES_ENDPOINT` | Delete memories | Deletes memories matching specified filter criteria; omitting all filters may result in deleting all memories. required: at least one of agent id, user id, app id, or run id must be provided. |
| `MEM0_DELETE_MEMORY_BATCH_WITH_UUIDS` | Delete memory batch with uuids | Deletes a batch of up to 1000 existing memories, identified by their uuids, in a single api call. |
| `MEM0_DELETE_PROJECT` | Delete project | Permanently deletes a specific project and all its associated data from an organization; this action cannot be undone and requires the project to exist within the specified organization. |
| `MEM0_DELETE_PROJECT_MEMBER` | Delete project member | Removes an existing member, specified by username, from a project, immediately revoking their project-specific access; the user is not removed from the organization. |
| `MEM0_EXPORT_DATA_BASED_ON_FILTERS` | Export data based on filters | Retrieves memory export data, optionally filtered by various identifiers (e.g., user id); without filters, it may return all accessible or recent exports based on default behavior. |
| `MEM0_FETCH_DETAILED_LIST_OF_ORGANIZATIONS` | List organizations | Retrieves a summary list of organizations for administrative oversight; returns summary data (names, ids), not exhaustive details, despite 'detailed' in the name. |
| `MEM0_FETCH_DETAILS_OF_A_SPECIFIC_ORGANIZATION` | Fetch details of a specific organization | Fetches comprehensive details for an organization using its `org id`; the `org id` must be valid and for an existing organization. |
| `MEM0_FETCH_LIST_OF_ENTITY_FILTERS` | Get list of entity filters | Retrieves predefined filter definitions for entities (e.g., by type, creation/modification date); returns definitions only, not filtered entity data. |
| `MEM0_FETCH_SPECIFIC_ENTITY_DETAILS_WITH_OPTIONAL_FILTERS` | Get entity by id | Fetches detailed information for an existing entity (user, agent, app, or run) identified by its type and unique id. |
| `MEM0_GET_ORGANIZATION_MEMBERS` | Get organization members | Fetches a list of members for a specified, existing organization. |
| `MEM0_GET_PROJECT_DETAILS` | Get project details | Fetches comprehensive details for a specified project within an organization. |
| `MEM0_GET_PROJECT_MEMBERS` | Get project members | Retrieves all members for a specified project within an organization. |
| `MEM0_GET_PROJECTS` | Get projects | Retrieves all projects for a given organization `org id` to which the caller has access. |
| `MEM0_GET_USER_MEMORY_STATS` | Get user memory stats | Retrieves a summary of the authenticated user's memory activity, including total memories created, search events, and add events. |
| `MEM0_LIST_ENTITIES_WITH_OPTIONAL_ORG_AND_PROJECT_FILTERS` | List entities | Retrieves a list of entities, optionally filtered by organization or project (prefer `org id`/`project id` over deprecated `org name`/`project name`), noting results may be summaries and subject to limits. |
| `MEM0_PERFORM_SEMANTIC_SEARCH_ON_MEMORIES` | Perform semantic search on memories | Searches memories semantically using a natural language query (required if `only metadata based search` is false) and/or metadata filters. required: at least one of agent id, user id, app id, or run id must be provided. when `only metadata based search` is true, the `metadata` parameter is required. |
| `MEM0_REMOVE_A_MEMBER_FROM_THE_ORGANIZATION` | Remove a member from the organization | Removes a member, specified by their username, from an existing organization of which they are currently a member. |
| `MEM0_RETRIEVE_ALL_EVENTS_FOR_THE_CURRENTLY_LOGGED_IN_USER` | Retrieve all events for the currently logged in user | Retrieves a paginated list of events for the authenticated user, filterable and paginable via url query parameters. this is a read-only operation that does not modify data. supported query parameters (applied directly to the request url): - `event type` (str, optional): filters events by their type (e.g., 'add', 'search'). - `start date` (str, optional): filters events on or after this date (format: yyyy-mm-dd). - `end date` (str, optional): filters events on or before this date (format: yyyy-mm-dd). - `page` (int, optional): specifies the page number for paginated results. - `page size` (int, optional): number of events per page (default: 50, max: 100). |
| `MEM0_RETRIEVE_ENTITY_SPECIFIC_MEMORIES` | Retrieve entity-specific memories | Retrieves all memories (e.g., user preferences, chat history) for a specific entity from the mem0 platform, using its `entity type` and `entity id`; ensure the entity exists. |
| `MEM0_RETRIEVE_LIST_OF_MEMORY_EVENTS` | Retrieve list of memory events | Retrieves a chronological list of all memory events (e.g., user inputs, ai responses) from the mem0 platform, providing interaction history and context for ai assistants. |
| `MEM0_RETRIEVE_MEMORY_BY_UNIQUE_IDENTIFIER` | Retrieve memory by id | Retrieves a complete memory entry by its unique identifier; `memory id` must be valid and for an existing memory. |
| `MEM0_RETRIEVE_MEMORY_HISTORY_BY_ID` | Retrieve memory history by id | Retrieves the complete version history for an existing memory, using its unique `memory id`, to inspect its evolution or audit changes. |
| `MEM0_RETRIEVE_MEMORY_LIST` | Retrieve memory list | Retrieves a list of memories, supporting pagination and diverse filtering (e.g., by ids, metadata, keywords, date ranges); ensure dates are iso 8601 and `page`/`page size` (if used) are positive integers. required: at least one of agent id, user id, app id, or run id must be provided. |
| `MEM0_SEARCH_MEMORIES_WITH_QUERY_FILTERS` | Search memories with filters | Semantically searches memories using a natural language query and mandatory structured filters, offering options to rerank results and select specific fields; any provided `org id` or `project id` must reference a valid existing entity. |
| `MEM0_UPDATE_MEMORY_BATCH_WITH_UUID` | Update memory batch with uuid | Updates text for up to 1000 memories in a single batch, using their uuids. |
| `MEM0_UPDATE_MEMORY_DETAILS_BY_ID` | Update memory text content | Updates the text content of an existing memory, identified by its `memory id`. |
| `MEM0_UPDATE_ORGANIZATION_MEMBER_ROLE` | Update organization member role | Updates the role of an existing member to a new valid role within an existing organization. |
| `MEM0_UPDATE_PROJECT` | Update project | Updates a project by `project id` within an `org id`, modifying only provided fields (name, description, custom instructions, custom categories); list fields are fully replaced (cleared by `[]`), other omitted/null fields remain unchanged. |
| `MEM0_UPDATE_PROJECT_MEMBER_ROLE` | Update project member role | Updates the role of a specific member within a designated project, ensuring the new role is valid and recognized by the system. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

Once connected, OpenCode can access the Mem0 MCP server via Composio to run the app actions you authorize, directly from your coding workflow.

## Complete Code

None listed.

## Conclusion

### Way Forward
Now that Mem0 is connected, extend your setup by connecting the other apps you already use every day, so your agent can run true cross-app workflows end to end.
- Connect Calendar to turn threads into scheduled meetings automatically.
- Connect Slack or Teams to post summaries, approvals, and alerts where your team works.
- Connect Notion, Linear, Jira, or Asana to convert requests into tickets, tasks, and docs.
- Connect Drive, Dropbox, or OneDrive to fetch, file, and share attachments without manual steps.
Start with one workflow you do repeatedly, then keep adding apps as you find new handoffs. With everything behind a single MCP endpoint, your agent can coordinate multiple tools safely and reliably in one conversation.

## How to build Mem0 MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/mem0/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/mem0/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/mem0/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/mem0/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/mem0/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/mem0/framework/codex)
- [Cursor](https://composio.dev/toolkits/mem0/framework/cursor)
- [VS Code](https://composio.dev/toolkits/mem0/framework/vscode)
- [OpenClaw](https://composio.dev/toolkits/mem0/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/mem0/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/mem0/framework/cli)
- [Google ADK](https://composio.dev/toolkits/mem0/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/mem0/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/mem0/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/mem0/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/mem0/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/mem0/framework/crew-ai)

## Related Toolkits

- [Google Sheets](https://composio.dev/toolkits/googlesheets) - Google Sheets is a cloud-based spreadsheet tool for real-time collaboration and data analysis. It lets teams work together from anywhere, updating information instantly.
- [Notion](https://composio.dev/toolkits/notion) - Notion is a collaborative workspace for notes, docs, wikis, and tasks. It streamlines team knowledge, project tracking, and workflow customization in one place.
- [Airtable](https://composio.dev/toolkits/airtable) - Airtable combines the flexibility of spreadsheets with the power of a database for easy project and data management. Teams use Airtable to organize, track, and collaborate with custom views and automations.
- [Asana](https://composio.dev/toolkits/asana) - Asana is a collaborative work management platform for teams to organize and track projects. It streamlines teamwork, boosts productivity, and keeps everyone aligned on goals.
- [Google Tasks](https://composio.dev/toolkits/googletasks) - Google Tasks is a to-do list and task management tool integrated into Gmail and Google Calendar. It helps you organize, track, and complete tasks across your Google ecosystem.
- [Linear](https://composio.dev/toolkits/linear) - Linear is a modern issue tracking and project planning tool for fast-moving teams. It helps streamline workflows, organize projects, and boost productivity.
- [Jira](https://composio.dev/toolkits/jira) - Jira is Atlassian’s platform for bug tracking, issue tracking, and agile project management. It helps teams organize work, prioritize tasks, and deliver projects efficiently.
- [Clickup](https://composio.dev/toolkits/clickup) - ClickUp is an all-in-one productivity platform for managing tasks, docs, goals, and team collaboration. It streamlines project workflows so teams can work smarter and stay organized in one place.
- [Monday](https://composio.dev/toolkits/monday) - Monday.com is a customizable work management platform for project planning and collaboration. It helps teams organize tasks, automate workflows, and track progress in real time.
- [Addressfinder](https://composio.dev/toolkits/addressfinder) - Addressfinder is a data quality platform for verifying addresses, emails, and phone numbers. It helps you ensure accurate customer and contact data every time.
- [Agiled](https://composio.dev/toolkits/agiled) - Agiled is an all-in-one business management platform for CRM, projects, and finance. It helps you streamline workflows, consolidate client data, and manage business processes in one place.
- [Ascora](https://composio.dev/toolkits/ascora) - Ascora is a cloud-based field service management platform for service businesses. It streamlines scheduling, invoicing, and customer operations in one place.
- [Basecamp](https://composio.dev/toolkits/basecamp) - Basecamp is a project management and team collaboration tool by 37signals. It helps teams organize tasks, share files, and communicate efficiently in one place.
- [Beeminder](https://composio.dev/toolkits/beeminder) - Beeminder is an online goal-tracking platform that uses monetary pledges to keep you motivated. Stay accountable and hit your targets with real financial incentives.
- [Boxhero](https://composio.dev/toolkits/boxhero) - Boxhero is a cloud-based inventory management platform for SMBs, offering real-time updates, barcode scanning, and team collaboration. It helps businesses streamline stock tracking and analytics for smarter inventory decisions.
- [Breathe HR](https://composio.dev/toolkits/breathehr) - Breathe HR is cloud-based HR software for SMEs to manage employee data, absences, and performance. It simplifies HR admin, making it easy to keep employee records accurate and up to date.
- [Breeze](https://composio.dev/toolkits/breeze) - Breeze is a project management platform designed to help teams plan, track, and collaborate on projects. It streamlines workflows and keeps everyone on the same page.
- [Bugherd](https://composio.dev/toolkits/bugherd) - Bugherd is a visual feedback and bug tracking tool for websites. It helps teams and clients report website issues directly on live sites for faster fixes.
- [Canny](https://composio.dev/toolkits/canny) - Canny is a platform for managing customer feedback and feature requests. It helps teams prioritize product decisions based on real user insights.
- [Chmeetings](https://composio.dev/toolkits/chmeetings) - Chmeetings is a church management platform for events, members, donations, and volunteers. It streamlines church operations and improves community engagement.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Mem0 MCP?

With a standalone Mem0 MCP server, the agents and LLMs can only access a fixed set of Mem0 tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Mem0 and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with OpenCode?

Yes, you can. OpenCode fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Mem0 tools.

### Can I manage the permissions and scopes for Mem0 while using Tool Router?

Yes, absolutely. You can configure which Mem0 scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Mem0 data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
