Skip to main content
Glama

xgmem MCP Memory Server

xgmem is a TypeScript-based Model Context Protocol (MCP) server for enabling project-specific and knowledge graph-based memory for Claude, LLM agents, and other tools. It supports storing, retrieving, and managing entities, relations, and observations per project, with a focus on flexibility and cross-project knowledge sharing.

Features

  • Knowledge graph storage for entities, relations, and observations

  • CRUD operations via MCP tools

  • Persistence to disk (memory.json)

  • Docker and TypeScript support

Related MCP server: Knowledge Graph MCP Server

Use Case

xgmem is ideal for:

  • Agents and LLMs that need to store and retrieve structured memory (entities, relations, observations) per project.

  • Cross-project knowledge sharing and migration.

  • Scalable, disk-persistent, and queryable memory for agent ecosystems.

Usage

MCP Config Example

Add to your MCP config (e.g., for windsurf):

"mcpServers": {
    "xgmem": {
      "command": "npx",
      "args": ["-y", "xgmem@latest"]
    }
  }

Install dependencies

npm install

Build

npm run build

Run (development)

npx ts-node index.ts

Run (production)

npm start

Docker

docker build -t xgmem-mcp-server .
docker run -v $(pwd)/memories:/app/memories xgmem-mcp-server

This will persist all project memory files in the memories directory on your host.

How to Save Memory (MCP API)

To save observations (memory) for a project, call the save_project_observations tool via the MCP API:

Example JSON:

{
  "name": "save_project_observations",
  "args": {
    "projectId": "demo-project",
    "observations": [
      {
        "entityName": "Alice",
        "contents": [
          "Alice joined Acme Corp in 2021.",
          "Alice is a software engineer."
        ]
      },
      {
        "entityName": "Bob",
        "contents": [
          "Bob joined Acme Corp in 2022.",
          "Bob is a product manager."
        ]
      }
    ]
  }
}

You can use any compatible MCP client, or send this JSON via stdin if running the server directly.

Tooling and API

xgmem exposes the following tools:

  • save_project_observations

  • get_project_observations

  • add_graph_observations

  • create_entities

  • create_relations

  • delete_entities

  • delete_observations

  • delete_relations

  • read_graph

  • search_nodes

  • search_all_projects

  • open_nodes

  • copy_memory

See the get_help tool (if enabled) for documentation and usage examples via the MCP API.

Configuration

  • Set MEMORY_DIR_PATH env variable to change the memory storage directory (default: /app/memories).

License

MIT

Available Tools

14 tools
add_graph_observationsB

Add new observations to existing entities in the project knowledge graph.

Inputs: projectId (required), observations (required).

copy_memoryA

Copy memory entities and their relations from one project to another

Inputs: sourceProjectId (required), targetProjectId (required), entityNames (required).

create_entitiesB

Create multiple new entities in the project knowledge graph

Inputs: projectId (required), entities (required).

create_relationsB

Create multiple new relations between entities in the project knowledge graph

Inputs: projectId (required), relations (required).

delete_entitiesB

Delete multiple entities and their associated relations from the project knowledge graph

Inputs: projectId (required), entityNames (required).

delete_observationsB

Delete specific observations from entities in the project knowledge graph

Inputs: projectId (required), deletions (required).

delete_relationsB

Delete multiple relations from the project knowledge graph

Inputs: projectId (required), relations (required).

get_project_observationsB

Get all observations saved in the separate file for a given projectId.

Inputs: projectId (required).

list_projectsB

List all projects with stored memory

Inputs: no named parameters.

open_nodesB

Open specific nodes in a project's knowledge graph by their names

Inputs: projectId (required), names (required).

read_graphA

Read the entire knowledge graph for a specific project

Inputs: projectId (required).

save_project_observationsB

Save observations for a project to a separate file in the format { projectId, observations: [{ entityName, contents: [...] }] }.

Inputs: projectId (required), observations (required).

search_all_projectsB

Search for nodes across all projects' knowledge graphs based on a query

Inputs: query (required).

search_nodesB

Search for nodes in a specific project's knowledge graph based on a query

Inputs: projectId (required), query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a distinct purpose: CRUD for entities, relations, observations, plus project management and search. No significant overlap.

    Naming Consistency4/5

    Mostly snake_case verb_noun pattern consistent. Minor deviations like 'open_nodes' vs 'get_project_observations' and 'copy_memory' instead of 'copy_entities'.

    Tool Count5/5

    14 tools is well-scoped for a knowledge graph memory system, covering essential operations without excess.

    Completeness3/5

    Covers create, delete, read, and search, but missing update operations for entities, relations, and observations. No project deletion either.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A TypeScript MCP server that allows querying documents using LLMs with context from locally stored repositories and text files through a RAG (Retrieval-Augmented Generation) system.
      4
      17
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A TypeScript MCP server for managing persistent knowledge graphs with entities, directional relations, and time-based observations. It enables users to create, search, and track structured information with built-in concurrency control and JSON file storage.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Open-source MCP server that gives any LLM long-term memory using a knowledge graph and vector search hybrid. It stores entities, observations, and relationships, enabling semantic recall across sessions with automatic clustering and fail-loud infrastructure.
      51
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A universal MCP server providing persistent, structured memory through a knowledge graph with graph storage, semantic vector search, and multi-hop traversal for AI agents and IDEs.
      18 PyPI
      1
      MIT