mem9 MCP Server
Provides memory management tools for OpenAI Codex, enabling AI agents to store, search, retrieve, update, and delete memories via the mem9 memory service.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mem9 MCP Serverremember that my favorite color is blue and I like hiking"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@mem9/mcp-server
Universal MCP Server for mem9 memory service. One server, all platforms.
Quick Start
# Requires a running mnemo-server and API key
git clone https://github.com/you06/mem9-mcp.git
cd mem9-mcp
npm installEnvironment Variables
Variable | Required | Default | Description |
| Yes | - | API key for authentication (also serves as tenant ID) |
| No |
| mnemo-server base URL |
| No | auto-detected | Agent identifier |
| No |
| Log level: debug, info, warn, error |
| No |
| HTTP request timeout (ms) |
| No |
| Default search result limit |
Agent ID is auto-detected from platform environment variables (CURSOR_WORKSPACE, CLAUDE_CODE_VERSION, CODEX_CLI_VERSION).
Related MCP server: Mem0 MCP Server
Tools
Tool | Description |
| Store a new memory (processed via fact extraction) |
| Search memories by semantic similarity and keywords |
| Retrieve a specific memory by ID |
| Update an existing memory (direct field update) |
| Delete a memory |
Development
npm install
npm run build
npm testLocal Testing with Claude Code / Codex
Before publishing, you can test the MCP server locally by pointing to the built entry file:
Claude Code:
claude mcp add mem9 -e MEM9_API_KEY=your-key -e MEM9_API_URL=http://localhost:8080 -- node /path/to/mem9-mcp/dist/index.jsOr in .mcp.json:
{
"mcpServers": {
"mem9": {
"command": "node",
"args": ["/path/to/mem9-mcp/dist/index.js"],
"env": {
"MEM9_API_URL": "http://localhost:8080",
"MEM9_API_KEY": "your-key"
}
}
}
}Codex:
codex mcp add mem9 -- node /path/to/mem9-mcp/dist/index.jsOr in .codex/config.toml:
[mcp_servers.mem9]
command = "node"
args = ["/path/to/mem9-mcp/dist/index.js"]
[mcp_servers.mem9.env]
MEM9_API_URL = "http://localhost:8080"
MEM9_API_KEY = "your-key"After code changes, run npm run build and restart the MCP client to pick up the new build.
Platform Setup
Cursor
Settings > Features > MCP Servers:
{
"mcpServers": {
"mem9": {
"command": "npx",
"args": ["-y", "@mem9/mcp-server"],
"env": {
"MEM9_API_URL": "http://localhost:8080",
"MEM9_API_KEY": "your-key"
}
}
}
}Claude Code
claude mcp add mem9 -- npx -y @mem9/mcp-serverOr in .mcp.json:
{
"mcpServers": {
"mem9": {
"command": "npx",
"args": ["-y", "@mem9/mcp-server"],
"env": {
"MEM9_API_URL": "http://localhost:8080",
"MEM9_API_KEY": "your-key"
}
}
}
}OpenAI Codex
codex mcp add mem9 -- npx -y @mem9/mcp-serverOr in .codex/config.toml:
[mcp_servers.mem9]
command = "npx"
args = ["-y", "@mem9/mcp-server"]
[mcp_servers.mem9.env]
MEM9_API_URL = "http://localhost:8080"
MEM9_API_KEY = "your-key"License
Apache-2.0
Available Tools
5 toolsmemory_deleteA
Delete a memory that is no longer relevant or accurate. Use this to clean up outdated information. This action is irreversible.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The memory ID to delete. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Given no annotations are provided, the description carries the burden of behavioral disclosure. It explicitly states 'This action is irreversible,' which is a critical behavioral trait for a destructive tool. It doesn't detail additional effects, but the irreversibility warning is a strong disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, with two sentences that cover purpose, usage, and a critical warning. Every sentence earns its place with no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple delete operation with one parameter and no output schema, the description is complete: it states what is deleted, when to use it, and warns about irreversibility. The context is fully covered without needing additional detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema fully describes the 'id' parameter as 'The memory ID to delete.' The description adds no additional semantic information beyond this, so with 100% schema coverage, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Delete') and a clear resource ('a memory'), directly stating its function. It distinguishes itself from sibling tools like memory_get, memory_store, and memory_update by focusing on removal.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear usage context by stating 'Use this to clean up outdated information' and specifying the condition 'no longer relevant or accurate.' However, it does not explicitly mention alternatives or when not to use this tool, so it falls short of full guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_getA
Retrieve a specific memory by its ID. Use this when you have a memory ID from a previous search and need the full content.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The memory ID (UUID format). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. The verb 'retrieve' clearly indicates a read-only, non-destructive operation, which is behaviorally transparent for a simple getter. It also mentions that it returns 'full content,' setting expectations for the response, though it does not detail edge cases like missing IDs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, with the main action front-loaded. The first sentence states the purpose; the second clarifies usage. No redundant information or filler words. Every sentence serves a distinct function: definition and usage guidance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one parameter and no output schema, the description adequately covers the essentials: what it does, when to use it, and what the input should be. It references sibling tools implicitly by mentioning 'previous search,' providing context for integration. The simplicity of the operation doesn't demand more detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage for the single parameter 'id', describing it as a UUID. The tool description adds context beyond the schema by stating the ID comes from 'a previous search,' helping the agent understand the provenance and relationship to sibling tools. This adds meaningful usage semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Retrieve a specific memory by its ID.' It uses a specific verb with a resource and scope, distinguishing it from siblings like memory_search (which finds memories without an ID) and memory_delete/memory_update (which modify memories). The additional clause 'need the full content' further clarifies its purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly provides usage guidance: 'Use this when you have a memory ID from a previous search and need the full content.' This tells the agent the prerequisite (an existing memory ID) and the typical workflow (search first, then retrieve). It implies that this tool is not for initial discovery, contrasting with memory_search.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_searchA
Search your memory for relevant information. Use this at the start of a task to recall relevant context, when you need to check if something was previously discussed, or when the user references past work. Supports both semantic (meaning-based) and keyword search.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Optional: filter results to only memories with these tags. | |
| limit | No | Maximum number of results to return (default: 10, max: 50). | |
| query | Yes | Natural language search query. Describe what you're looking for — the system handles both semantic and keyword matching. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses that the tool 'Supports both semantic (meaning-based) and keyword search,' which adds behavioral context. However, it does not explicitly state that it is read-only, what the return value looks like, or any side effects. Moderate but not rich transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, front-loaded with the core purpose, then usage context, then capability. Every sentence adds value and there is no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description provides purpose and usage guidance, but since there is no output schema, it does not explain what the tool returns (e.g., list of memories, ordering, pagination). It also does not mention the limit/tags parameters, though these are documented in the schema. Adequate but with some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with detailed descriptions for query, tags, and limit. The description repeats the semantic/keyword matching already present in the query parameter description, so it adds no new meaning beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'Search your memory for relevant information' with a specific verb and resource. It also lists concrete use cases (start of task, checking past discussions, referencing past work) that distinguish it from sibling tools like memory_get, memory_store, etc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to use: 'Use this at the start of a task to recall relevant context, when you need to check if something was previously discussed, or when the user references past work.' However, it does not explicitly mention when not to use it or alternatives, but the listed use cases give clear context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_storeA
Store a new memory. The content will be processed asynchronously by the memory service (fact extraction and reconciliation) — it is not stored verbatim and may take a few seconds to become searchable. Use this when you learn something worth remembering: user preferences, project conventions, important decisions, recurring patterns, or any context that would be useful in future sessions. Do NOT store trivial or transient information like current file paths, temporary debug notes, or information that only matters in the current session. Note: the response does not include the stored memory's ID. If you need to update or delete a memory you just stored, use memory_search to find it first.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Optional tags for categorization (e.g., ['coding-style', 'python', 'user-preference']). | |
| content | Yes | The memory content to store. Be specific and self-contained — this should make sense when retrieved later without additional context. | |
| metadata | No | Optional key-value metadata (e.g., { 'project': 'web-app', 'source': 'code-review' }). | |
| session_id | No | Optional session identifier to associate this memory with a specific conversation or workflow. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully discloses key behaviors: asynchronous processing, non-verbatim storage, searchability delay, and the absence of the stored memory's ID in the response. It also implicitly warns about the processing pipeline, exceeding expectations for transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently front-loaded with the core action and expands into necessary behavioral disclosures and usage guidance. Each sentence adds distinct value: purpose, async behavior, appropriate content, exclusions, and ID caveat. No redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of annotations and output schema, the description carries the full contextual burden and does so admirably: it explains the async processing, searchability delay, appropriate content, exclusions, and the response limitation regarding IDs. The schema covers parameters comprehensively, so no additional parameter context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters with specific examples and guidance. The description adds only tangential context (async processing) that affects content meaning but does not enhance understanding of individual parameters. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb ('Store') and resource ('a new memory'), explicitly distinguishing it from sibling memory tools (get/delete/search/update) by focusing on creation. It also clarifies the async behavior and non-verbatim storage, making the purpose specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage criteria with concrete examples of appropriate content (user preferences, project conventions, important decisions) and explicit exclusions (trivial/transient info). It also directs users to memory_search for subsequent updates/deletes, clearly demarcating when not to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_updateA
Update an existing memory. Use this when information has changed, needs correction, or should be enriched with additional context. Provide the memory ID and at least one field to update. This is a direct field update — content is NOT re-processed through reconciliation.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The memory ID to update. | |
| tags | No | Updated tags (replaces the entire tag list). Omit to keep current tags. | |
| content | No | The updated memory content (replaces the existing content). Omit to keep current content. | |
| metadata | No | Updated metadata (replaces existing metadata). Omit to keep current metadata. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations available, the description carries the full burden. It reveals key behavioral traits: it is a direct field update, not re-processed through reconciliation, and requires at least one field to update beyond the ID. This goes beyond the schema by clarifying operational semantics, though it doesn't address permissions or return behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences long, front-loaded with the core action, and every sentence provides necessary information. There is no redundancy or fluff, making it efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and complete schema descriptions, the description covers purpose, usage, behavioral caveats, and parameter constraints. It does not mention return values, but with no output schema this is a minor gap. Overall, it is sufficiently complete for an AI agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers 100% of parameters with descriptions, so baseline is 3. The description adds a crucial semantic constraint: 'Provide the memory ID and at least one field to update,' which is not enforced by the schema (only id is required). This clarifies invocation requirements and adds value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: 'Update an existing memory.' It distinguishes the tool from siblings by specifying it modifies existing memories rather than creating, retrieving, deleting, or searching. The verb 'update' plus resource 'memory' is specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage context: 'Use this when information has changed, needs correction, or should be enriched with additional context.' It also sets expectations with 'direct field update' and notes the need for at least one field. However, it does not explicitly name alternative tools or state when not to use it, so it's just under a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
memory_delete - First observed
memory_get - First observed
memory_search - First observed
memory_store - First observed
memory_update
TDQS
Scored across 5 tools
Each tool targets a distinct operation: create (store), read (get/search), update, and delete. There is no overlap between retrieving by ID, searching, storing, updating, or deleting.
All tool names follow the same verb_noun pattern: memory_get, memory_delete, memory_store, memory_search, memory_update. Consistent and predictable.
Five tools is well-scoped for a memory server. It covers all core operations without unnecessary bloat or missing essentials.
The tool set provides full CRUD coverage (store, get, update, delete) plus search, which is the complete lifecycle for a memory service. No obvious gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
- EngramOAuthapp.getengram
Persistent, verbatim, searchable memory for AI assistants — one memory across every MCP client.
Securely search, create, and organize your Mem notes and collections from AI assistants.
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to use advanced memory management capabilities through the memU AI framework. Supports storing conversation memories, semantic retrieval, multi-user management, and memory statistics via standardized MCP protocol.3MIT
- AlicenseAqualityNot gradedmaintenanceEnables AI applications to add, search, update, and delete long-term memories using the Mem0 Memory API, allowing agents to persistently remember user preferences, conversation history, and contextual information across sessions.9-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to store and retrieve persistent memories with a web management interface. Supports creating, searching, and managing memories through natural language commands or a visual web dashboard.141MIT
- AlicenseAqualityDmaintenanceAdds persistent memory to AI assistants by connecting to the Memphora cloud platform, allowing them to store and recall facts across conversations. It enables tools for searching memories, extracting insights, and maintaining long-term user context and preferences.53MIT