From 0e3ba467f2dec59dd8c8fb3396233b747ab8a7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Tue, 2 Jun 2026 07:05:45 +0000 Subject: [PATCH] Update README.md --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aae3789..aac2f35 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,49 @@ -# task-69f8e929da860fb4533faa2a +# MCP Memory Server -MCP-сервер для управления памятью агента \ No newline at end of file +This repository contains a simple **MCP (Model Context Protocol)** server that provides a persistent key/value store with optional namespace support. The server is built with **FastMCP** and exposes tools that can be called by other agents or CLI utilities. + +## Features + +- **Basic CRUD** operations: `save`, `get`, `delete`, `list_keys`. +- **Namespace support**: `save_with_namespace`, `get_by_namespace`, etc. +- Data is persisted to `memory_data.json` with timestamps. +- Simple client demo (`memory_client.py`). + +## Installation + +```bash +pip install -r requirements.txt +``` + +## Running the Server + +```bash +python memory_server.py +``` + +The server will start listening via **stdio** transport. + +## Running the Client Demo + +```bash +python memory_client.py +``` + +You should see output similar to: + +``` +Сохранено: True +Данные namespace 'default': + default:username: Алексей +Ключи с 'name': ['default:username'] +``` + +## How It Works + +- The server uses a JSON file (`memory_data.json`) to store data. Each entry is a mapping of `namespace:key` to a dictionary containing `value` and `timestamp`. +- All tools are registered with `@mcp.tool()` and can be invoked by any MCP client. +- The client uses `fastmcp.Client` to connect via stdio and call the tools. + +## Extending + +You can add more tools or modify the storage backend (e.g., switch to a database) by extending the `MemoryServer` class.