How to integrate Mem0 MCP with Kimi Code

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Mem0 logo
Kimi Code logo
divider

How to integrate Mem0 MCP with Kimi Code

Kimi Code is Moonshot AI's open-source coding agent, powered by Kimi K2.6. It runs in your terminal, reads and edits code, executes shell commands, and plans multi-step tasks, with native MCP support for extending it to outside tools.

In this guide, I will explain the easiest and most secure way to connect your Mem0 account to Kimi Code via Composio Connect, so it can store meeting notes from today's call, export all project memories as CSV, add new user to our team space, and more without ever putting your account credentials at risk.

Also integrate Mem0 with

Why use Composio?

Composio provides:

  • Access to 1,000+ managed apps from a single MCP endpoint. This makes it convenient for agents to run cross-app workflows.
  • Managed OAuth. You do not have to worry about authentication and authorization flows for every app.
  • Programmatic tool calling. Allows LLMs to write code in a remote workbench to handle complex tool chaining. This reduces back-and-forth for frequent tool calls.
  • Large tool response handling outside the LLM context. This minimizes context bloat from large tool responses.
  • Dynamic just-in-time access to thousands of tools across hundreds of apps. Composio loads the tools your agent needs, so LLMs are not overwhelmed by tools they do not need.

Connect Mem0 to Kimi Code

Kimi Code is a TypeScript agent distributed through npm. It acts as an MCP client and reads server definitions from an mcp.json file, and it can also add and authenticate servers conversationally through /mcp-config. Composio is a remote HTTP server that authenticates with OAuth, so no API key is stored anywhere.

1. Install Kimi Code

The quickest way is the official install script, which requires no pre-installed Node.js and places the kimi executable on your PATH.

bash
# macOS or Linux
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

# Windows PowerShell
irm https://code.kimi.com/kimi-code/install.ps1 | iex

# Confirm the installation
kimi --version

2. Log in

Start Kimi Code in your project directory, then sign in from the interactive UI:

bash
kimi

Run /login and choose Kimi Code OAuth using the device-code flow, or use a Moonshot API key.

3. Add Composio with /mcp-config

In current versions of Kimi Code, MCP servers are managed inside the app, not with a shell subcommand. From the interactive UI, run:

bash
/mcp-config
Kimi Code MCP config flow for adding the Composio MCP server

Tell it the server name and URL in plain language. For example:

Server name is Composio, and here is the server URL: https://connect.composio.dev/mcp

Kimi Code asks whether to add it globally, at ~/.kimi-code/mcp.json, or project-local for the current checkout, then writes the entry for you:

bash
{
  "mcpServers": {
    "Composio": {
      "url": "https://connect.composio.dev/mcp"
    }
  }
}

There is no transport field to set. Kimi Code infers HTTP from the url.

4. Restart the session

The new server is picked up on a fresh session, not the current one. Start a new session:

bash
/new

On the new session, Kimi Code detects that the server needs authorization and prompts you to run:

bash
/mcp-config login Composio

5. Authorize with OAuth

Run the command Kimi suggests:

bash
/mcp-config login composio

Kimi Code opens Composio's authorization page or surfaces a URL. Approve access, then return to the session. You should see confirmation that the Composio MCP server is connected.

Composio authorization page for Kimi Code MCP setup

Check the connection status any time with /mcp. Composio should appear as connected with its tools listed.

Kimi Code showing Composio connected after OAuth authorization

Connect your Mem0 account

Back in a Kimi Code session, ask the agent to connect to Mem0 or give it any Mem0-related task.

For example, ask it to:

  • "Store meeting notes from today's call"
  • "Export all project memories as CSV"
  • "Add new user to our team space"

It will prompt you to authenticate and authorize access to Mem0.

That is it. Composio tools are now available in Kimi Code, and your Mem0 account is ready to use.

Supported Tools & Triggers

Tools
Add member to projectAdds an existing user to a project (identified by `project_id` within organization `org_id`), assigning a valid system role.
Add new memory recordsStores new memory records from a list of messages, optionally inferring structured content; requires association via `agent_id`, `user_id`, `app_id`, or `run_id`.
Add organization memberAdds a new member, who must be a registered user, to an organization, assigning them a specific role.
Create a new agentCreates a new agent with a unique `agent_id` and an optional `name`; additional metadata may be assigned by the system.
Create a new agent runCreates a new agent run in the mem0.
Create a new applicationCreates 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.
Create a new organization entryCreates a new organization entry using the provided name and returns its details.
Create a new userCreates a new user with the specified unique `user_id` and supports associating `metadata` (not part of the request schema fields).
Create memory entryLists/searches existing memory entries with filtering and pagination; critically, this action retrieves memories and does *not* create new ones, despite its name.
Create projectCreates a new project with a given name within an organization that must already exist.
Create webhookCreates a new webhook for a specific project to receive real-time notifications.
Delete an organizationPermanently deletes an existing organization identified by its unique ID.
Delete memory by idPermanently deletes a specific memory by its unique ID; ensure the `memory_id` exists as this operation is irreversible.
Delete entity by type and idCall to permanently and irreversibly hard-delete an existing entity (user, agent, app, or run) and all its associated data, using its type and ID.
Delete memoriesDeletes all memories matching specified filter criteria.
Delete memory batch with uuidsDeletes a batch of up to 1000 existing memories, identified by their UUIDs, in a single API call.
Delete projectPermanently 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.
Delete project memberRemoves an existing member, specified by email address, from a project, immediately revoking their project-specific access; the user is not removed from the organization.
Delete webhookDeletes a webhook and stops receiving notifications for the specified webhook ID.
Export data based on filtersCreates a new memory export job with optional entity filters (user_id, agent_id, app_id, run_id).
List organizationsRetrieves a summary list of organizations for administrative oversight; returns summary data (names, IDs), not exhaustive details, despite 'detailed' in the name.
Fetch details of a specific organizationFetches comprehensive details for an organization using its `org_id`; the `org_id` must be valid and for an existing organization.
Get list of entity filtersRetrieves predefined filter definitions for entities (e.
Get entity by idFetches detailed information for an existing entity (user, agent, app, or run) identified by its type and unique ID.
Get event status by event IDRetrieves a single async event by ID to check its current status and results.
Get memories by entityTool to retrieve all memories associated with a specific entity (user, agent, app, or run).
Get memory exportRetrieves the status and results of a memory export job by its ID.
Get organization membersFetches a list of members for a specified, existing organization.
Get project detailsFetches comprehensive details for a specified project within an organization.
Get project membersRetrieves all members for a specified project within an organization.
Get projectsRetrieves all projects for a given organization `org_id` to which the caller has access.
Get project webhooksRetrieves all webhooks configured for a specific project.
Get user memory statsRetrieves a summary of the authenticated user's memory activity, including total memories created, search events, and add events.
List entitiesRetrieves 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.
Perform semantic search on memoriesSearches memories semantically using a natural language query and metadata filters.
Remove a member from the organizationRemoves a member, specified by their username, from an existing organization of which they are currently a member.
Retrieve all events for the currently logged in userRetrieves a paginated list of events for the authenticated user, filterable and paginable via URL query parameters.
Retrieve list of memory eventsRetrieves a chronological list of all memory events (e.
Retrieve memory by idRetrieves a complete memory entry by its unique identifier; `memory_id` must be valid and for an existing memory.
Retrieve memory history by idRetrieves the complete version history for an existing memory, using its unique `memory_id`, to inspect its evolution or audit changes.
Retrieve memory listRetrieves a list of memories, supporting pagination and diverse filtering (e.
Search memories with filtersSemantically searches memories using structured filters with an optional natural language query.
Update memory batch with uuidUpdates text for up to 1000 memories in a single batch, using their UUIDs.
Update memory text contentUpdates the text content of an existing memory, identified by its `memory_id`.
Update organization member roleUpdates the role of an existing member to a new valid role within an existing organization.
Update projectUpdates 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.
Update project member roleUpdates the role of a specific member within a designated project, ensuring the new role is valid and recognized by the system.

Conclusion

You have successfully connected Mem0 to Kimi Code using Composio Connect. Your agent can now manage Mem0 from the terminal with natural language, without exposing credentials in prompts or local scripts.

Since the same Composio endpoint exposes 1,000+ apps, you can add Slack, Calendar, Linear, and more to the same server and chain them into cross-app workflows.

How to build Mem0 MCP Agent with another framework

FAQ

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 Kimi Code?

Yes, you can. Kimi Code 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.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.