Kimi Memory MCP
Uses Ollama's bge-m3 model for local embedding, enabling privacy-preserving vector generation for memory search.
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., "@Kimi Memory MCP学习 /home/docs/api.md,后端API文档"
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.
Kimi Memory MCP
为 Kimi Code CLI 打造的智能记忆系统,让大模型拥有持久化记忆能力。
功能特性
📚 文件学习 - 学习代码、文档、会议记录等各种文件
🔍 智能检索 - 使用自然语言查询已学习内容
🧠 混合存储 - 同时存储原始内容和 AI 整理后的结构化内容
🤖 智能预处理 - 自动调用 DeepSeek 整理复杂文档
🔒 本地 Embedding - 使用 Ollama + bge-m3,保护隐私
💾 持久化存储 - 数据存储在 ChromaDB,重启不丢失
Related MCP server: Vector Memory MCP Server
系统架构
┌─────────────────────────────────────────────────────────┐
│ Kimi Code CLI │
└──────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Memory MCP Server (Node.js + TypeScript) │
│ ├── embed_file - 学习文件 │
│ ├── search_memory - 检索记忆 │
│ ├── list_memories - 列出记忆 │
│ └── forget_file - 删除记忆 │
└──────────────────┬──────────────────────────────────────┘
│
┌───────────┴───────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Ollama │ │ DeepSeek │
│ (bge-m3) │ │ API │
│ Embedding │ │ 内容整理 │
└──────┬──────┘ └─────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ ChromaDB (Docker) │
│ └── 向量存储 + 元数据 │
└─────────────────────────────────────────────────────────┘快速开始
1. 克隆项目
git clone https://github.com/yourusername/kimi-memory-mcp.git
cd kimi-memory-mcp2. 安装依赖
npm install
npm run build3. 启动 ChromaDB
docker run -d --name chromadb -p 8000:8000 chromadb/chroma:latest4. 配置 MCP
编辑 ~/.kimi/mcp.json:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/kimi-memory-mcp/dist/index.js"],
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-deepseek-api-key",
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_MODEL": "deepseek-chat"
}
}
}
}5. 重启 Kimi CLI
重启 Kimi Code CLI 后,记忆功能即可使用。
使用方法
学习文件
> 学习 /path/to/auth.js,用户认证模块
> 学习 /path/to/API设计.md,后端接口规范
> 学习 /path/to/周会.md,本周开发计划检索记忆
> 回忆一下用户登录怎么实现
> 上周会议说的待办事项有哪些
> 之前学习的认证相关代码在哪里管理记忆
> 查看我已让你学习的所有文件
> 忘记 /path/to/旧文件.js项目结构
kimi-memory-mcp/
├── src/
│ ├── index.ts # MCP 服务器入口
│ ├── tools/
│ │ ├── embed.ts # 学习文件
│ │ ├── search.ts # 检索记忆
│ │ ├── list.ts # 列出记忆
│ │ └── forget.ts # 删除记忆
│ ├── store/
│ │ └── chroma_http.ts # ChromaDB HTTP 客户端
│ └── utils/
│ ├── ollama.ts # Ollama API 封装
│ ├── deepseek.ts # DeepSeek API 封装
│ └── splitter.ts # 文件切片器
├── dist/ # 编译后的 JS
├── package.json
├── tsconfig.json
└── README.md环境变量
变量名 | 说明 | 默认值 |
| DeepSeek API Key | 必填 |
| DeepSeek API 地址 |
|
| 使用的模型 |
|
| ChromaDB 地址 |
|
| Ollama 地址 |
|
技术亮点
1. 混合存储
同时存储原始内容和 AI 整理后的结构化内容:
检索时优先匹配结构化内容(更准确)
需要细节时查看原始内容(更完整)
2. 智能预处理
自动判断文件类型:
代码文件(.py, .js, .ts等)→ 直接切片
文档类(.md, .txt)→ DeepSeek 整理后存储
3. 本地 Embedding
使用 Ollama 本地运行 bge-m3 模型:
无需联网即可生成向量
保护数据隐私
免费使用
依赖要求
Node.js >= 18
Docker (用于运行 ChromaDB)
Ollama (本地 Embedding 服务)
DeepSeek API Key (文档预处理)
安装依赖服务
Ollama
# macOS/Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows
# 下载安装包: https://ollama.com/download/windows拉取 bge-m3 模型
ollama pull bge-m3开发
# 开发模式(自动编译)
npm run dev
# 构建
npm run build
# 测试连接
node dist/index.js许可证
MIT License
致谢
Available Tools
4 toolsembed_fileA
当用户需要保存文件内容、学习新知识、记住某个文件、将文件加入知识库、存储代码或文档时,调用此工具。触发场景包括:用户说"学习这个文件"、"记住这个文件"、"保存到记忆"、"加入知识库"、"存储这个文档"、"把这个代码记下来"等。支持DeepSeek自动预处理复杂内容。
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | 需要学习并向量化的本地文件绝对或相对路径。 | |
| preprocess | No | 是否启用DeepSeek LLM预处理(默认true)。对于复杂文档会进行结构化整理,代码文件会生成摘要。 | |
| description | Yes | 简要描述这个文件属于什么业务模块(例如:WebGIS 图层控制、数据要素分析等),将作为元数据保存。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden of behavioral disclosure. It mentions DeepSeek automatic preprocessing as a notable behavior, but does not explain side effects such as duplicate handling, overwriting existing entries, permissions required, or what the tool returns. Some transparency is offered, but key behavioral details are missing.
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 a single well-structured paragraph that leads with the core use case, then lists concrete trigger phrases, and closes with one relevant feature. There is no filler or redundant content—every sentence earns its place.
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 write tool with no output schema and no annotations, the description explains when to use it and what it does, but omits important context such as return values, error behavior, and what happens if a file is already embedded. It is adequate for basic understanding but has clear gaps for an agent expecting robust guidance.
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?
All three parameters are fully described in the schema (100% coverage), including file_path, description, and the preprocess boolean with default. The description adds no additional parameter-specific meaning beyond the schema, so the baseline 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 clearly states the tool's function: saving file content, learning new knowledge, remembering files, adding to knowledge base, and storing code/documents. It lists explicit trigger phrases ('学习这个文件', '记住这个文件', '保存到记忆', etc.), which unambiguously differentiates it from sibling tools (search_memory, list_memories, forget_file) by focusing on adding content to memory.
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 trigger scenarios and user expressions that indicate when to call this tool, making the usage context very clear. However, it does not explicitly state when not to use it or mention alternative tools like search_memory for retrieval, so it lacks exclusions but still offers strong guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
forget_fileA
删除指定文件的所有记忆。当用户说"忘记这个文件"、"删除记忆"、"清除这个文件"、"移除知识库中的文件"、"删掉这个记录"时,使用此工具清除相关记忆。
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | 要删除记忆的文件的完整路径。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the burden of disclosing behavior. It states that it '删除所有记忆' (deletes all memories) for the file, which conveys destructiveness and scope. However, it doesn't mention irreversibility, permissions, or side effects on other components (e.g., embeddings), leaving some behavioral gaps.
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 a single, front-loaded sentence stating the core action, followed by a list of trigger phrases that aid usage. It is efficient, though the trigger list is somewhat lengthy.
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 tool is simple (one parameter, no output schema), but without annotations, the description should cover more context. It confirms the destructive action and usage triggers, but doesn't mention error cases, irreversibility, or interaction with sibling tools, making it adequate but not comprehensive.
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%, and the file_path parameter already has a clear description ('要删除记忆的文件的完整路径'). The tool description adds little beyond '指定文件', so it doesn't provide additional semantic 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 uses a specific verb '删除' (delete) and resource '指定文件的所有记忆' (all memories of the specified file), clearly stating the tool's function. It distinguishes from sibling tools (embed_file, search_memory, list_memories) by targeting removal of memories rather than creation, search, or listing.
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?
It provides explicit trigger phrases ('忘记这个文件', '删除记忆', etc.) indicating when to use the tool. It doesn't explicitly contrast with alternative tools but offers concrete user-intent examples, giving clear usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_memoriesA
列出所有已学习的文件及其统计信息。当用户问"查看已学习的文件"、"显示记忆列表"、"都有什么文件"、"知识库里有什么"、"列出所有内容"、"查看记忆"时,使用此工具。
| Name | Required | Description | Default |
|---|---|---|---|
| file_type | No | 按文件类型过滤(例如:py, js, ts, md)。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the primary action (listing files) but does not elaborate on what 'statistics' means or whether the operation has side effects. The read-only nature is implied but not explicitly stated.
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: the first states the function, the second provides example trigger phrases. Both sentences are informative and necessary, with no wasted words.
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 low complexity (one optional parameter, no output schema), the description adequately covers the main function and typical use cases. However, the vague term 'statistics' could be more specific, and the output format is not described.
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 already fully documents the optional file_type parameter with an example. The description does not add additional parameter semantics beyond what the schema provides, so the baseline score applies.
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 lists all learned files with their statistics, using a specific verb (list) and resource (learned files). It also provides example user queries, distinguishing it from sibling tools like embed_file, search_memory, and forget_file.
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 trigger phrases indicating when to use this tool, such as '查看已学习的文件' and '列出所有内容'. It does not explicitly mention alternatives or exclusions, but the clear context of user intent makes it a solid guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_memoryA
在已学习的知识库中搜索相关内容。当用户需要查找之前的内容、寻找历史信息、查询已保存的文件、回顾之前的讨论、找之前的代码或文档、查看学习过的资料、检索记忆时,使用此工具。触发词包括:回忆、找、查、搜索、看看、之前、以前、上次、有没有、记得、说过、讨论过等。
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 返回结果的最大数量(默认5条)。 | |
| query | Yes | 搜索查询,描述你想找什么内容。 | |
| source | No | 按特定文件路径过滤。 | |
| file_type | No | 按文件类型过滤(例如:py, js, ts, md)。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility. It states the tool 'searches' content but does not explicitly disclose that it is read-only, whether it modifies memories, or how results are returned. Though the action implies non-destructive behavior, that is not stated, and the description lacks details about pagination, ranking, or output format.
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 front-loaded with a clear purpose sentence, then expands with use cases and trigger words. While the trigger word list is somewhat verbose, it serves practical guidance for deciding when to invoke the tool. Overall, it is efficient and not overly redundant.
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?
With no output schema, the description should cover return behavior, but it does not mention what the tool returns or how results are presented. The usage context is well covered, but the lack of return format and any limitations (e.g., max limit) leaves gaps for an agent invoking the tool.
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%, so the baseline is 3. The description does not add any parameter-specific information beyond the schema, but since the schema already documents each parameter fully (query, limit, source, file_type), this is adequate.
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 explicitly states the tool searches a learned knowledge base, which is a specific verb+resource pairing. It distinguishes itself from siblings like embed_file (add content), list_memories (list memories), and forget_file (delete) by focusing on retrieval.
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 a clear when-to-use list covering many scenarios (finding previous content, historical info, saved files, discussions, code, documents) and even gives trigger words. However, it does not explicitly mention when not to use it or name alternative tools, which would fully meet the 'explicit when/when-not/alternatives' criterion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool maps to a distinct operation: saving content, searching, listing, and deleting memories. There is no overlap in purpose, and the trigger scenarios clearly differentiate them.
All tool names follow a consistent verb_noun pattern (embed_file, search_memory, list_memories, forget_file). The pattern is uniform and predictable.
With only 4 tools, the server is tightly scoped to its core memory management purpose. Each tool is necessary and there is no bloat.
The set covers create, read, list, and delete operations, covering the primary lifecycle. The only missing operation is an explicit update, but users can achieve updates by forgetting and re-embedding, so the gap is minor.
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
Long-term memory for AI assistants. Hybrid retrieval, query expansion, auto-topics.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Related MCP Servers
- AlicenseAqualityDmaintenanceA personal memory system that provides AI assistants with long-term memory capabilities through semantic search and vector storage. It enables Claude Code to store, retrieve, and manage personal context and project preferences using flexible LLM backends.8MIT
- AlicenseNot gradedqualityCmaintenanceAdds persistent long-term memory to GitHub Copilot CLI via local semantic vector search, enabling Copilot to recall past conversations and code decisions across sessions.251MIT
- FlicenseNot gradedqualityDmaintenanceProvides persistent memory and semantic file discovery for AI coding agents, enabling them to remember changes and find relevant files across sessions.5
- AlicenseAqualityCmaintenanceA full-featured long-term memory system for Claude Code that persistently stores and retrieves preferences, decisions, and project context across sessions using hybrid search and LLM-powered extraction.1414MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SARPixelPioneer/kimi-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server