MCP Memory Server - Python Implementation is an MCP server that provides persistent knowledge graph storage and retrieval using standard JSON Lines (JSONL) files. Built as a Python port of the official Model Context Protocol TypeScript memory server, it connects AI assistants to a local graph database of entities, relationships, and observations. Developers and AI practitioners use this server to equip language models with long-term memory across sessions without relying on complex external database engines. The server exposes nine core tools covering graph manipulation, such as creating entities, establishing relations, attaching observations, deleting elements, searching nodes by query text, and traversing interconnected nodes. Because it uses identical JSONL structures, users can migrate existing memory files directly from the TypeScript reference implementation. The server communicates over standard input and output (stdio) and supports custom file paths configured through environment variables.
Category: AI Memory & Context
Tags: jsonl, knowledge-graph, persistence, retrieval
Visit MCP Memory Server - Python Implementation
bash git clone https://github.com/jason-c-dev/memory-mcp-server-py cd memory-mcp-server-py 2. Create and activate a Python virtual environment: bash python3 -m venv .venv source .venv/bin/activate 3. Install dependencies: bash pip install -r requirements.txt 4. Add the server to your Claude Desktop configuration file (claude_desktop_config.json) under mcpServers: json { "mcpServers": { "memory": { "command": "python", "args": ["/path/to/mcp_memory_server.py"], "env": { "MEMORY_FILE_PATH": "/path/to/memory.json" } } } } Replace /path/to/ with the absolute path to your script and desired storage location.Part of MCP Servers
Clone the GitHub repository, set up a Python 3.8 or higher virtual environment, and run pip install -r requirements.txt. Once dependencies are installed, you can configure your MCP client such as Claude Desktop or Cursor to launch mcp_memory_server.py using the virtual environment Python interpreter.
It provides nine tools to build and query a local knowledge graph. The server lets clients create, delete, and read entities, establish relations between nodes, record observations, search entity properties by text query, and explore connected nodes using a local JSONL file.
The server works with any MCP client supporting stdio communication. Tested setups include Claude Desktop, Cursor IDE, and AWS Q CLI. Each client requires specifying the python executable path, the server script path, and an optional environment variable for the memory file.
This implementation was developed and tested exclusively on macOS. While it operates on standard Python and should function on other Unix-like systems, it has not been officially tested on Windows or Linux environments.
Yes, it provides full feature parity with the official TypeScript implementation. It implements the exact same nine MCP tools and utilizes identical JSON Lines file formats, allowing you to reuse existing memory.json files without manual conversion.