Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

A networked long-term memory server that enables AI agents to maintain persistent context across sessions via Server-Sent Events (SSE), with secure multi-tenancy and autonomous memory lifecycle management.

README.md

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

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
  1. Create and activate a virtual environment:
   uv venv
   .\.venv\Scripts\Activate.ps1
  1. 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"
   }
  1. 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.

Recommended: Native SSE Connection

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

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.