MCP Memory Service MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install -g mcp-memory-ts
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "TURSO_URL=${TURSO_URL}" -e "TURSO_AUTH_TOKEN=${TURSO_AUTH_TOKEN}" -e "OPENAI_API_KEY=${OPENAI_API_KEY}" mcp-memory-ts -- node "<FULL_PATH_TO_MCP_MEMORY_TS>/dist/index.js"

Replace <FULL_PATH_TO_MCP_MEMORY_TS>/dist/index.js with the actual folder you prepared in step 1.

Required:TURSO_URLTURSO_AUTH_TOKENOPENAI_API_KEY+ 1 optional
README.md

A cloud-based vector memory service for AI assistants via MCP

MCP Memory Service - TypeScript

A modern TypeScript implementation of a cloud-based vector memory service for AI assistants via the Model Context Protocol (MCP). This service provides persistent storage with semantic search capabilities for Claude.ai and other AI assistants.

Current Version: 1.7.2 | Status: Production-ready | Test Coverage: 95.2%

Features

  • 🧠 3-Tier Memory System: SYSTEM, LEARNED, and MEMORY layers for hierarchical knowledge organization
  • šŸ‘„ Multi-Tenant Support: Secure user isolation with Clerk OAuth authentication
  • šŸ” Vector Search: Semantic similarity search using OpenAI embeddings
  • šŸ”„ Automatic Embeddings: Auto-generates and updates embeddings on data changes
  • šŸ¢ Entity Management: Track people, organizations, projects, and relationships
  • šŸ“š Interaction History: Store and retrieve conversation history with context
  • šŸ“± Contacts Sync: True bidirectional sync with macOS Contacts using LLM-based deduplication
  • šŸ”„ Google Sync: Google Contacts and Calendar integration with incremental sync (v1.7.0+)
  • šŸ“… Calendar Tracking: Week-based Google Calendar event sync with attendee linking
  • 🌐 Web Interface: Modern Next.js web UI for visual memory management (staging on port 3002)
  • šŸ”Œ MCP Protocol: JSON-RPC 2.0 over stdio (local) and HTTP (remote)
  • 🌐 REST API: HTTP interface for web applications
  • šŸ” OAuth Integration: Clerk authentication for remote access with 95.2% test coverage
  • ā˜ļø Cloud-Ready: Built for modern cloud deployment with Turso database
  • šŸ” Security Patches: Critical user isolation vulnerabilities fixed in v1.7.1
  • šŸ“ Smart Logging: LOG_LEVEL-aware logging with state tracking (v1.7.1+)

Architecture

src/
ā”œā”€ā”€ types/          # TypeScript type definitions
ā”œā”€ā”€ models/         # Data models and schemas
ā”œā”€ā”€ database/       # Database connection and operations
ā”œā”€ā”€ core/           # Core memory logic and vector search
ā”œā”€ā”€ mcp/           # MCP server implementation
ā”œā”€ā”€ api/           # REST API server
ā”œā”€ā”€ cli/           # CLI tool
ā”œā”€ā”€ utils/         # Utility functions
└── index.ts       # Main entry point

web/
ā”œā”€ā”€ app/           # Next.js app directory
ā”œā”€ā”€ components/    # React components
ā”œā”€ā”€ lib/           # Utilities and integrations
└── public/        # Static assets

Quick Start

Prerequisites

  • Node.js 18+
  • Turso database (or LibSQL compatible)
  • OpenAI API key (for embeddings)

Installation

# Clone and install dependencies
npm install

# Copy environment configuration
cp .env.local .env

# Build the project
npm run build

# Start development server
npm run dev

Environment Variables

Required variables in .env:

# Database Configuration
TURSO_URL=libsql://your-database.turso.io
TURSO_AUTH_TOKEN=your-auth-token

# OpenAI Configuration (for vector embeddings)
OPENAI_API_KEY=your-openai-api-key

# Optional Configuration
LOG_LEVEL=info              # Options: debug, info (default), warn, error (v1.7.1+)
MCP_DEBUG=0                 # Set to 1 for detailed MCP protocol debugging
DEFAULT_USER_EMAIL=user@example.com

# Automatic Embedding Updates (v1.1.0+)
ENABLE_EMBEDDING_MONITOR=true  # Enable background monitoring
EMBEDDING_MONITOR_INTERVAL=60000  # Check every 60 seconds

# Web Interface (v1.3.0+)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your-clerk-publishable-key
CLERK_SECRET_KEY=your-clerk-secret-key

# Google Integration (v1.7.0+)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=http://localhost:3002/api/auth/google/callback  # Use port 3002 for staging

Usage

MCP Server (for Claude Desktop)

Recommended: Using CLI Tool

# Install globally
npm install -g mcp-memory-ts

# Initialize configuration
mcp-memory init

# Install to Claude Desktop
mcp-memory install

# Check status
mcp-memory status

This creates a config in ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-memory-ts": {
      "command": "mcp-memory",
      "args": ["server"],
      "env": {
        "TURSO_URL": "your-database-url",
        "TURSO_AUTH_TOKEN": "your-auth-token",
        "OPENAI_API_KEY": "your-openai-key",
        "DEFAULT_USER_EMAIL": "user@example.com"
      }
    }
  }
}

Manual Setup

For development or manual configuration:

# Start MCP server
npm run mcp-server

# Or with debug logging
MCP_DEBUG=1 npm run mcp-server

# Or using CLI command
mcp-memory server --debug

Remote MCP Server (HTTP with OAuth)

For web applications and remote access with Clerk authentication:

# Start remote MCP server
npm run mcp-server-remote

The remote MCP server will be available at http://localhost:3003 with:

  • Authentication: Clerk OAuth session tokens
  • Multi-Tenant: Complete user isolation by email
  • Protocol: JSON-RPC 2.0 over HTTP
  • Security: Rate limiting, CORS, session management
  • **

Environment Variables

TURSO_URLrequiredDatabase connection URL
TURSO_AUTH_TOKENrequiredDatabase authentication token
OPENAI_API_KEYrequiredAPI key for vector embeddings
DEFAULT_USER_EMAILDefault user email for multi-tenant isolation

Configuration

claude_desktop_config.json
{"mcpServers": {"mcp-memory-ts": {"command": "mcp-memory", "args": ["server"], "env": {"TURSO_URL": "your-database-url", "TURSO_AUTH_TOKEN": "your-auth-token", "OPENAI_API_KEY": "your-openai-key", "DEFAULT_USER_EMAIL": "user@example.com"}}}}

Try it

→Store this project summary in my memory so I can reference it later.
→Search my memory for all interactions related to the Q4 marketing project.
→Find the contact details for the person I met last week regarding the software architecture.
→Retrieve the conversation history from my last meeting about the database migration.

Frequently Asked Questions

What are the key features of MCP Memory Service?

3-Tier memory system for hierarchical knowledge organization. Semantic similarity search using OpenAI embeddings. Bidirectional synchronization with macOS and Google contacts. Multi-tenant isolation with Clerk OAuth authentication. Automatic embedding generation on data changes.

What can I use MCP Memory Service for?

Maintaining persistent context across multiple AI chat sessions. Managing professional relationships by syncing contacts and interaction history. Organizing project-related knowledge and documents for quick semantic retrieval. Linking calendar events with specific project entities and attendees.

How do I install MCP Memory Service?

Install MCP Memory Service by running: npm install -g mcp-memory-ts

What MCP clients work with MCP Memory Service?

MCP Memory Service works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Memory Service docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare