qzhaojing/Trae_MEM
If you are the rightful owner of Trae_MEM and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Trae Memory MCP Server is a local server that provides long-term memory capabilities for Trae AI using a hybrid search approach.
Trae Memory MCP Server
A Model Context Protocol (MCP) server that provides long-term memory capabilities for Trae AI (or any MCP client). It uses a local SQLite database with hybrid search (Keyword + Semantic) to store and retrieve code snippets, decisions, and context.
Features
- Long-term Memory: Store text content with optional tags.
- Hybrid Search: Combines Full-Text Search (SQLite FTS5) with Semantic Search (Sentence Transformers).
- Local & Private: All data is stored locally in
memory.db. - Fast: Uses a lightweight embedding model (
all-MiniLM-L6-v2) and efficient vector operations.
Prerequisites
- Python 3.10 or higher
- Windows, Linux, or macOS
Installation
1. Clone the repository
git clone https://github.com/yourusername/trae_mem_mcp.git
cd trae_mem_mcp
2. Create a Virtual Environment (Recommended)
Windows:
python -m venv .venv
.venv\Scripts\activate
Linux/macOS:
python3 -m venv .venv
source .venv/bin/activate
3. Install Dependencies
pip install -r requirements.txt
Note: The first time you run the server, it will download the embedding model (approx. 90MB) from Hugging Face. If you are in a region with restricted access, set the HF_ENDPOINT environment variable to a mirror before running (handled automatically in the Windows batch script).
Configuration in Trae
- Open Trae Settings -> MCP Servers.
- Click "Add" (Edit Configuration).
- Add the following configuration (replace
G:\\...with the actual path to yourstart_server.bat):
{
"mcpServers": {
"Trae_Memory": {
"command": "cmd.exe",
"args": [
"/c",
"G:\\path\\to\\trae_mem_mcp\\trae_mem_mcp\\start_server.bat"
]
}
}
}
Make sure to use double backslashes \\ in the JSON path.
Usage
Once connected, you can ask Trae to:
- "Remember that we decided to use JWT for authentication."
- "Search memory for authentication details."
- "What did we save about the database schema?"
Project Structure
trae_mem_mcp/: Source code packageserver.py: MCP server entry point and tool definitionsdb.py: SQLite database operations (FTS + Vector storage)model.py: Embedding model wrapper (SentenceTransformers)start_server.bat: Windows startup script
memory.db: SQLite database (created on first run)
License
MIT