# T6 Mem0 v2 MCP Server Setup ## ✅ MCP Server Test Results The MCP server has been tested and is working correctly: - ✓ Server initialized successfully - ✓ Memory instance connected (Supabase + Neo4j) - ✓ 7 MCP tools available and functional ## Configuration for Claude Code Add this to your Claude Code MCP configuration file: ### Location - **macOS/Linux**: `~/.config/claude-code/mcp.json` - **Windows**: `%APPDATA%\claude-code\mcp.json` ### Configuration ```json { "mcpServers": { "t6-mem0": { "command": "/home/klas/mem0/start-mcp-server.sh", "description": "T6 Mem0 v2 - Memory management with Supabase + Neo4j", "env": {} } } } ``` If you already have other MCP servers configured, just add the `"t6-mem0"` section to the existing `"mcpServers"` object. ## Available MCP Tools Once configured, you'll have access to these 7 memory management tools: ### 1. add_memory Add new memory from conversation messages. Extracts and stores important information. **Required**: `messages` (array of `{role, content}` objects) **Optional**: `user_id`, `agent_id`, `metadata` **Example**: ```javascript { "messages": [ {"role": "user", "content": "I love pizza and pasta"}, {"role": "assistant", "content": "Great! I'll remember that."} ], "user_id": "user123" } ``` ### 2. search_memories Search memories by semantic similarity. Find relevant memories based on a query. **Required**: `query` (string) **Optional**: `user_id`, `agent_id`, `limit` (default: 10, max: 50) **Example**: ```javascript { "query": "What foods does the user like?", "user_id": "user123", "limit": 5 } ``` ### 3. get_memory Get a specific memory by its ID. **Required**: `memory_id` (string) **Example**: ```javascript { "memory_id": "894a70ed-d756-4fd6-810d-265cd99b1f99" } ``` ### 4. get_all_memories Get all memories for a user or agent. **Optional**: `user_id`, `agent_id` **Example**: ```javascript { "user_id": "user123" } ``` ### 5. update_memory Update an existing memory's content. **Required**: `memory_id` (string), `data` (string) **Example**: ```javascript { "memory_id": "894a70ed-d756-4fd6-810d-265cd99b1f99", "data": "User loves pizza, pasta, and Italian food" } ``` ### 6. delete_memory Delete a specific memory by ID. **Required**: `memory_id` (string) **Example**: ```javascript { "memory_id": "894a70ed-d756-4fd6-810d-265cd99b1f99" } ``` ### 7. delete_all_memories Delete all memories for a user or agent. **Use with caution!** **Optional**: `user_id`, `agent_id` **Example**: ```javascript { "user_id": "user123" } ``` ## Backend Architecture The MCP server uses the same backend as the REST API: - **Vector Store**: Supabase (PostgreSQL with pgvector) - **Graph Store**: Neo4j (for relationships) - **LLM**: OpenAI GPT-4o-mini (for extraction) - **Embeddings**: OpenAI text-embedding-3-small All fixes applied to the REST API (serialization bug fixes) are also active in the MCP server. ## Testing To test the MCP server manually: ```bash cd /home/klas/mem0 python3 test-mcp-tools.py ``` This will verify: - MCP server initialization - Memory backend connection - All 7 tools are properly registered ## Activation After adding the configuration: 1. **Restart Claude Code** to load the new MCP server 2. The server will start automatically when Claude Code launches 3. Tools will be available in your conversations You can verify the server is running by checking for the `t6-mem0` server in Claude Code's MCP server status. ## Troubleshooting If the server doesn't start: 1. Check that all dependencies are installed: `pip install -r requirements.txt` 2. Verify Docker containers are running: `docker ps | grep mem0` 3. Check logs: Run the test script to see detailed error messages 4. Ensure Neo4j and Supabase are accessible from the host machine --- **Last tested**: 2025-10-15 **Status**: ✅ All tests passing