python-memory-mcp-server

python-memory-mcp-server

13

The Memory MCP Server is designed to manage knowledge graphs by handling entities, relations, and observations with strict validation protocols. It supports a wide range of entity types and relation management, ensuring data consistency and offering robust search capabilities.

Memory MCP Server

A Model Context Protocol (MCP) server that provides knowledge graph functionality for managing entities, relations, and observations in memory, with strict validation rules to maintain data consistency.

Features

  • Supports entity types such as person, concept, project, document, tool, organization, location, and event.
  • Validates entity names, ensuring uniqueness and adherence to specified naming conventions.
  • Manages observations with rules for uniqueness, maximum length, and factual accuracy.
  • Facilitates creation and management of relations such as knows, contains, uses, created, belongs-to, depends-on, and related-to with validation to prevent circular dependencies.

Usage

The server provides tools for various operations including:

  • Retrieving entities and the entire graph
  • Creating entities and observations
  • Establishing and deleting relations between entities
  • Searching memory with support for temporal and activity queries

Error Handling

The server specifies error types such as NOT_FOUND, VALIDATION_ERROR, INTERNAL_ERROR, ALREADY_EXISTS, and INVALID_RELATION for robust feedback and troubleshooting.

Development

  • Tests are run using pytest and new features involve updating validation rules, adding tests, and implementing changes in the relevant manager files.