--- title: 'MCP Server Introduction' description: 'Model Context Protocol server for AI-powered memory operations' --- # MCP Server Overview The T6 Mem0 v2 MCP (Model Context Protocol) server provides a standardized interface for AI assistants and agents to interact with the memory system. It exposes all memory operations as MCP tools that can be used by any MCP-compatible client. ## What is MCP? Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. Created by Anthropic, it enables: - **Universal tool access** - One protocol works across all AI assistants - **Secure communication** - Structured message format with validation - **Rich capabilities** - Tools, resources, and prompts in a single protocol ## Features - ✅ **7 Memory Tools** - Complete CRUD operations for memories - ✅ **HTTP/SSE Transport** - Compatible with n8n and web-based clients - ✅ **stdio Transport** - Compatible with Claude Code and terminal-based clients - ✅ **Synchronized Operations** - Ensures both Supabase and Neo4j stay in sync - ✅ **Type-safe** - Full schema validation for all operations ## Available Tools | Tool | Description | |------|-------------| | `add_memory` | Store new memories from conversation messages | | `search_memories` | Semantic search across stored memories | | `get_memory` | Retrieve a specific memory by ID | | `get_all_memories` | Get all memories for a user or agent | | `update_memory` | Update existing memory content | | `delete_memory` | Delete a specific memory | | `delete_all_memories` | Delete all memories for a user/agent | ## Transport Options ### HTTP/SSE Transport Best for: - n8n workflows - Web applications - REST API integrations - Remote access **Endpoint**: `http://localhost:8765/mcp` ### stdio Transport Best for: - Claude Code integration - Local development tools - Command-line applications - Direct Python integration **Usage**: Run as a subprocess with JSON-RPC over stdin/stdout ## Quick Example ```javascript // Using n8n MCP Client Tool { "endpointUrl": "http://172.21.0.14:8765/mcp", "serverTransport": "httpStreamable", "authentication": "none", "include": "all" } ``` ```python # Using Python MCP SDK from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client server_params = StdioServerParameters( command="python", args=["-m", "mcp_server.main"] ) async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: await session.initialize() # List available tools tools = await session.list_tools() # Call a tool result = await session.call_tool( "add_memory", arguments={ "messages": [ {"role": "user", "content": "I love Python"}, {"role": "assistant", "content": "Noted!"} ], "user_id": "user_123" } ) ``` ## Next Steps Set up the MCP server locally or in Docker Detailed documentation for all available tools Use MCP tools in n8n AI Agent workflows Integrate with Claude Code for AI-powered coding