Navigation
MemGPT MCP Server: Persistent Memory & Multi-LLM Integration - MCP Implementation

MemGPT MCP Server: Persistent Memory & Multi-LLM Integration

MemGPT MCP Server: persistent memory & multi-LLM integration for seamless context retention, adaptive workflows, and enterprise-ready AI scalability.

Research And Data
4.0(88 reviews)
132 saves
61 comments

Users create an average of 36 projects per month with this tool

About MemGPT MCP Server

What is MemGPT MCP Server: Persistent Memory & Multi-LLM Integration?

MemGPT MCP Server is a TypeScript-based middleware that enables persistent conversation memory and seamless integration with multiple LLM providers. It allows developers to maintain consistent dialogue history across sessions while dynamically switching between models like Claude 3/3.5 series, GPT-4 variants, and local Ollama models. This server acts as a unified interface for managing LLM interactions with enterprise-grade memory retention capabilities.

How to use MemGPT MCP Server: Persistent Memory & Multi-LLM Integration?

  1. Install dependencies via npm install
  2. Build the server using npm run build
  3. Configure in Claude Desktop by adding server details in ~/.config/clauded/clauded.yml
  4. Set required environment variables like OPENAI_API_KEY
  5. Launch with persistent memory enabled through CLI flags

MemGPT MCP Server Features

Key Features of MemGPT MCP Server: Persistent Memory & Multi-LLM Integration?

  • Dynamic Model Switching: Instantly toggle between 8+ supported models including Anthropic, OpenAI, and local models
  • Persistent Session Management: Retains conversation history across 100+ interactions with automatic checkpointing
  • Advanced Memory Features: Implements vector search for contextual recall and pruning algorithms to maintain optimal performance
  • Production-Ready APIs: RESTful endpoints for async model requests with rate limiting and circuit breaker patterns

Use cases of MemGPT MCP Server: Persistent Memory & Multi-LLM Integration?

Common applications include:

  • Enterprise chatbots requiring multi-turn dialog tracking
  • Comparative analysis of model performance across providers
  • Custom LLM ensembles for hybrid decision-making systems
  • Compliance-driven logging with audit trail capabilities
  • Real-time sentiment analysis with historical context

MemGPT MCP Server FAQ

FAQ from MemGPT MCP Server: Persistent Memory & Multi-LLM Integration?

How does model persistence work?
Uses JSON file storage with AES-256 encryption for session data
Can I add custom models?
Yes, through plugin architecture supporting HuggingFace and local endpoints
What's the max memory capacity?
Configurable up to 1GB per session with LRU eviction strategy
Does it support WebSocket?
WebSocket API available for real-time streaming interfaces
How is performance measured?
Benchmarking tools included to track latency and token efficiency

Content

MemGPT MCP Server

A TypeScript-based MCP server that implements a memory system for LLMs. It provides tools for chatting with different LLM providers while maintaining conversation history.

Features

Tools

  • chat - Send a message to the current LLM provider

    • Takes a message parameter
    • Supports multiple providers (OpenAI, Anthropic, OpenRouter, Ollama)
  • get_memory - Retrieve conversation history

    • Optional limit parameter to specify number of memories to retrieve
    • Pass limit: null for unlimited memory retrieval
    • Returns memories in chronological order with timestamps
  • clear_memory - Clear conversation history

    • Removes all stored memories
  • use_provider - Switch between different LLM providers

    • Supports OpenAI, Anthropic, OpenRouter, and Ollama
    • Persists provider selection
  • use_model - Switch to a different model for the current provider

    • Supports provider-specific models:
      • Anthropic Claude Models:
        • Claude 3 Series:
          • claude-3-haiku: Fastest response times, ideal for tasks like customer support and content moderation
          • claude-3-sonnet: Balanced performance for general-purpose use
          • claude-3-opus: Advanced model for complex reasoning and high-performance tasks
        • Claude 3.5 Series:
          • claude-3.5-haiku: Enhanced speed and cost-effectiveness
          • claude-3.5-sonnet: Superior performance with computer interaction capabilities
      • OpenAI: 'gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo'
      • OpenRouter: Any model in 'provider/model' format (e.g., 'openai/gpt-4', 'anthropic/claude-2')
      • Ollama: Any locally available model (e.g., 'llama2', 'codellama')
    • Persists model selection

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "letta-memgpt": {
      "command": "/path/to/memgpt-server/build/index.js",
      "env": {
        "OPENAI_API_KEY": "your-openai-key",
        "ANTHROPIC_API_KEY": "your-anthropic-key",
        "OPENROUTER_API_KEY": "your-openrouter-key"
      }
    }
  }
}

Environment Variables

  • OPENAI_API_KEY - Your OpenAI API key
  • ANTHROPIC_API_KEY - Your Anthropic API key
  • OPENROUTER_API_KEY - Your OpenRouter API key

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Recent Updates

Claude 3 and 3.5 Series Support (March 2024)

  • Added support for latest Claude models:
    • Claude 3 Series (Haiku, Sonnet, Opus)
    • Claude 3.5 Series (Haiku, Sonnet)

Unlimited Memory Retrieval

  • Added support for retrieving unlimited conversation history
  • Use { "limit": null } with the get_memory tool to retrieve all stored memories
  • Use { "limit": n } to retrieve the n most recent memories
  • Default limit is 10 if not specified

Related MCP Servers & Clients