Skip to main content
Glama
kavierim

MCP LTM Server

by kavierim

Networked Long-Term Memory (LTM) Server for LLMs (MCP)

A high-performance, persistent memory solution for AI agents, implemented via the Model Context Protocol (MCP). Enhance your LLM's context with cross-session networked memory.

Overview: Persistent Context for AI Agents

The MCP LTM Server provides a stateful, networked context management system for Large Language Models. By decoupling intelligence from capabilities, it allows AI agents (like GitHub Copilot and Claude) to maintain continuity across multiple chat sessions and distributed development environments.

Unlike local-only MCP servers, this implementation uses Server-Sent Events (SSE) over HTTP, providing a centralized "memory core" accessible from any machine on your network.

System Architecture & Data Flow

graph TD
    subgraph "AI Clients"
        VS[VS Code + Copilot]
        Claude[Claude Desktop]
    end

    subgraph "LTM Memory Server (127.0.0.1:8000)"
        SSE["SSE Endpoint: /mcp/sse"]
        DB[(SQLite Persistent Store)]
    end

    VS -->|Direct SSE + Auth Headers| SSE
    Claude -->|mcp-remote bridge| SSE
    SSE --> DB

Related MCP server: MCP Memento

Core Features of MCP Long-Term Memory

  • Persistent AI Context: Bridges the "amnesia" gap in LLM interactions by storing historical data in an ACID-compliant SQLite backend.

  • Networked SSE Transport: Implements Server-Sent Events (SSE), enabling remote connections and centralized memory management.

  • Secure Multi-Tenancy: Uses a partitioned architecture with user_key and repo_id to safely isolate data for different users and projects.

  • Autonomous Memory Lifecycle: Designed for AI agents to independently store, retrieve, and delete memories via tool calls.

  • Industrial-Grade Security: Supports Bearer Token authentication and is compatible with zero-trust networks like Tailscale.

Built with Modern AI Infrastructure

  • Python 3.10+: Core programming language.

  • FastAPI: High-performance asynchronous web framework for the SSE interface.

  • Uvicorn: Lightning-fast ASGI server.

  • MCP Python SDK: Native implementation of the Model Context Protocol.

  • SQLite (WAL Mode): Reliable, portable persistence with high concurrency support.

How to Install and Setup the MCP Server

Prerequisites

Ensure you have Python installed. It is recommended to use a virtual environment.

Installation

  1. Install uv if you haven't already:

    pip install uv
  2. Create and activate a virtual environment:

    uv venv
    .\.venv\Scripts\Activate.ps1
  3. Install dependencies from requirements.txt:

    uv pip install -r requirements.txt

Configuration

  1. User Identity Mapping: Create a file named user_tokens.json in the root directory. This file maps secure tokens to specific user identities, allowing the server to partition data automatically.

    {
      "your_secure_token_here": "your_user_id"
    }
  2. Environment Variables: Create a .env file in the root directory to configure the database and token paths:

    LTM_DB_PATH=ltm_store.db
    MCP_TOKENS_PATH=user_tokens.json

Running the Server

Start the server using uv run:

uv run uvicorn server:app --host 0.0.0.0 --port 8000

Connecting to GitHub Copilot and Claude Desktop

GitHub Copilot Chat (VS Code)

To integrate this LTM server with VS Code's GitHub Copilot Chat, modify your .vscode/mcp.json file.

VS Code supports direct SSE connections with custom authorization headers:

{
  "servers": {
    "ltm-memory": {
      "type": "sse",
      "url": "http://127.0.0.1:8000/mcp/sse",
      "headers": {
        "Authorization": "Bearer your_secure_token_here"
      }
    }
  }
}

Claude Desktop Integration

For Claude Desktop, edit your claude_desktop_config.json. Since Claude currently lacks native SSE header support, use the mcp-remote bridge:

{
  "mcpServers": {
    "remote-ltm": {
      "command": "npx",
      "args": [
        "-y", 
        "mcp-remote", 
        "--server-url", "http://<SERVER-IP>:8000/mcp/sse", 
        "--header", "Authorization: Bearer <TOKEN>"
      ]
    }
  }
}

Note: For remote SSE connections, use the appropriate MCP client configuration for SSE endpoints.

Project Structure

  • server.py: Main FastAPI application and MCP logic.

  • docs/spec.md: Detailed architectural blueprint and technical specifications.

  • docs/: Additional documentation and resources.

For more in-depth technical details on the architecture, security model, and persistence strategy, refer to the Technical Specification.

License

This project is licensed under the MIT License - see the LICENSE file for details (or specify otherwise).

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    A local-first persistent memory server that provides AI agents with deterministic, multimodal information retrieval across different sessions and projects. It enables long-term memory continuity using a 5-signal hybrid search engine and cognitive reasoning loops designed for complex development workflows.
    1
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    A persistent long-term memory server for AI assistants that enables storing and recalling solutions, facts, and decisions with intelligent confidence tracking and relationship mapping. It allows developers to build a cross-platform knowledge base that integrates seamlessly with IDEs and CLI agents.
    17
    2
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A production-grade long-term memory MCP server that enables AI agents to persist and recall memories across sessions with importance weighting, confidence calibration, and efficient context window management.
    9
    1
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Persistent AI memory server with hybrid search and embedded sync. Enables AI agents to store, retrieve, and manage information across sessions with temporal knowledge graph support.
    MIT

View all related MCP servers

Related MCP Connectors

  • Persistent memory for AI agents — verbatim conversations, searchable by meaning.

  • Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.

  • User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kavierim/MCP_LTM_Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server