---
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

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/mcp/installation">
    Set up the MCP server locally or in Docker
  </Card>
  <Card title="Tool Reference" icon="wrench" href="/mcp/tools">
    Detailed documentation for all available tools
  </Card>
  <Card title="n8n Integration" icon="workflow" href="/examples/n8n">
    Use MCP tools in n8n AI Agent workflows
  </Card>
  <Card title="Claude Code" icon="code" href="/examples/claude-code">
    Integrate with Claude Code for AI-powered coding
  </Card>
</CardGroup>
