kimi-code-memory-mcp
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-code-memory-mcpRemember my API key preferences for future sessions"
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-code-memory-mcp
A Python MCP (Model Context Protocol) bridge that exposes TencentDB Agent Memory as MCP tools for Kimi Code CLI.
What it does
Gives your AI coding assistant long-term memory across sessions:
L0 - Raw conversation storage
L1 - Atomic memory facts (auto-extracted)
L2 - Scene/context blocks (auto-clustered)
L3 - User persona/profile (auto-generated)
The LLM can recall relevant memories, capture new conversations, and search past interactions.
Related MCP server: TencentAgentMemoryBridge MCP Server
Architecture
Kimi Code CLI <---stdio---> Python MCP Bridge (this repo)
|
| HTTP :8420
v
TencentDB Agent Memory Gateway
(official npm package, runs locally)This repo is a thin Python bridge — it forwards 5 MCP tools to the official Gateway via HTTP. The Gateway does all the heavy lifting (L0-L3 extraction, vector search, persona generation).
Quick Start
1. Install Python dependencies
pip install -r requirements.txt2. Set up the Gateway (one-time)
python setup-gateway.pyThis installs the official @tencentdb-agent-memory/memory-tencentdb npm package and tsx into ~/.memory-tencentdb/.
3. Configure credentials
cp .env.example .env
# Edit .env and fill in your API keysYou need:
LLM API key — any OpenAI-compatible endpoint (SiliconFlow, OpenAI, SenseNova, etc.)
SiliconFlow API key — for embeddings (BAAI/bge-m3)
4. Start the Gateway
python start-gateway.pyFor background/autostart mode:
python start-gateway-background.py5. Register in Kimi Code
Add to your ~/.kimi-code/mcp.json:
{
"mcpServers": {
"tencentdb-memory": {
"command": "python",
"args": ["path/to/server.py"]
}
}
}6. (Optional) Auto-invoke on every conversation with AGENTS.md
If you want Kimi Code to automatically recall memories at the start of every conversation and capture them after each turn, create an AGENTS.md file in your project root. AGENTS.md is a project-scope instruction file that Kimi Code loads automatically; it is not a skill and does not require a trigger word.
Example AGENTS.md:
# TencentDB Agent Memory Rules
- **Fixed session_key:** always use `kimi-default` (or any stable identifier).
- **On the first user message of every conversation:**
- Call `mcp__tencentdb-memory__tencentdb_memory_recall` with `session_key="kimi-default"`.
- Do not answer the user until this recall has been attempted.
- **After every meaningful user/assistant turn:**
- Call `mcp__tencentdb-memory__tencentdb_memory_capture` with `user_content`, `assistant_content`, and `session_key="kimi-default"`.
- **When the session ends:**
- Call `mcp__tencentdb-memory__tencentdb_session_end` with `session_key="kimi-default"`.This is useful for keeping a single, persistent memory context across all your chats in a workspace.
MCP Tools
Tool | Description |
| Recall relevant L1/L2/L3 memories for current query |
| Store a completed conversation turn into memory pipeline |
| Search structured memories (L1-L3) with optional type filter |
| Search raw L0 conversation history |
| Flush pending extraction work for a session |
SKILL.md
Include SKILL.md in your Kimi Code skills directory to teach the LLM when and how to use these memory tools.
Requirements
Python >= 3.12
Node.js >= 22.16.0 (for the Gateway)
An OpenAI-compatible LLM API key
A SiliconFlow API key (for embeddings)
Acknowledgments
TencentDB-Agent-Memory by TencentCloud (MIT License)
FastMCP Python framework
License
MIT — see LICENSE
This project includes modifications based on TencentDB-Agent-Memory by TencentCloud.
This server cannot be installed
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 Servers
- Alicense-qualityCmaintenanceProvides persistent memory for AI coding agents, enabling them to read and write structured knowledge through MCP-compatible tools.Last updated1MIT
- Alicense-qualityAmaintenanceProvides CodeBuddy, Claude Code, and other MCP-compatible tools with a 4-layer long-term memory system (conversations, atomic facts, scenes, profiles) powered by TencentDB Agent Memory.Last updatedMIT
- Alicense-qualityBmaintenanceProvides long-term memory for AI agents via MCP tools to store, recall, and delete memories, with per-user scoping and usage limits.Last updatedAGPL 3.0
- Alicense-qualityCmaintenanceProvides a shared memory bridge for AI agents (QClaw, Claude Code, Codex) allowing them to store, search, and retrieve notes, decisions, and conclusions via MCP tools, using local SQLite with optional TencentDB integration.Last updatedMIT
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Shared long-term memory vault for AI agents with 20 MCP tools.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
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/perinchiang/kimi-code-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server