commit 9a14cda881fa617af3d0a6ea6cca58cbb3e5532f Author: balabanovan530 <175+balabanovan530@noreply.localhost> Date: Thu May 28 06:07:07 2026 +0000 Add README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..da7b993 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Memory MCP Server + +## Overview +This project implements a simple Memory MCP (Memory Control Protocol) server using `fastmcp`. The server provides a set of tools for storing, retrieving, and managing key‑value pairs in a JSON file. It also supports namespaces and wildcard key listing. + +## Installation +```bash +# Create a virtual environment +python -m venv .venv +source .venv/bin/activate # On Windows use .venv\Scripts\activate + +# Install dependencies +pip install -r requirements.txt +``` + +## Running the Server +```bash +python memory_server.py +``` +The server runs with a stdio transport and will start listening for tool calls. + +## Running the Client Example +In a separate terminal (with the same virtual environment activated) run: +```bash +python memory_client.py +``` +The client will: +1. Save a key/value pair. +2. Retrieve it. +3. List all keys. +4. Delete the key. +5. Demonstrate namespace usage. + +## Output Example +``` +save result: True +get result: {'key': 'foo', 'value': {'bar': 1}, 'timestamp': 1701234567.890} +list_keys result: ['foo'] +delete result: True +get_by_namespace result: [{'key': 'ns1:baz', 'value': 'qux', 'timestamp': 1701234568.123}] +``` + +## Persistence +All data is stored in `memory_data.json` in the same directory as the server. Each entry contains the key, value, and a Unix timestamp. + +## Dependencies +- fastmcp +- pydantic +- python-dotenv + +All dependencies are specified in `requirements.txt`. \ No newline at end of file